You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
841 B
18 lines
841 B
9 years ago
|
const valuesFor = require('../app/util').valuesFor
|
||
|
|
||
8 years ago
|
module.exports = function (unapprovedTxs, unapprovedMsgs, personalMsgs, network) {
|
||
8 years ago
|
log.debug('tx-helper called with params:')
|
||
8 years ago
|
log.debug({ unapprovedTxs, unapprovedMsgs, personalMsgs, network })
|
||
8 years ago
|
|
||
8 years ago
|
const txValues = network ? valuesFor(unapprovedTxs).filter(txMeta => txMeta.metamaskNetworkId === network) : valuesFor(unapprovedTxs)
|
||
8 years ago
|
log.debug(`tx helper found ${txValues.length} unapproved txs`)
|
||
8 years ago
|
const msgValues = valuesFor(unapprovedMsgs)
|
||
8 years ago
|
log.debug(`tx helper found ${msgValues.length} unsigned messages`)
|
||
8 years ago
|
let allValues = txValues.concat(msgValues)
|
||
|
const personalValues = valuesFor(personalMsgs)
|
||
8 years ago
|
log.debug(`tx helper found ${personalValues.length} unsigned personal messages`)
|
||
8 years ago
|
allValues = allValues.concat(personalValues)
|
||
|
|
||
8 years ago
|
return allValues.sort(txMeta => txMeta.time)
|
||
9 years ago
|
}
|