Skip to content

Commit

Permalink
fix my mess once more (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitcoinera authored Feb 20, 2020
1 parent 3378bd3 commit 2f4a296
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/reducers/cosmosV0-reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,18 +401,18 @@ function formatTransactionsReducer(txs, reducers) {
const sortedTxs = sortBy(duplicateFreeTxs, ['timestamp'])
const reversedTxs = reverse(sortedTxs)
// here we filter out all transactions related to validators
let filteredTxs = []
let filteredMsgs = []
reversedTxs.forEach(transaction => {
const index = transaction.tx.value.msg.findIndex(msg =>
cosmosWhitelistedMessageTypes.has(msg.type.split('/')[1])
)
// only push transactions messages supported by Lunie
if (index !== -1) {
transaction.tx.value.msg = [transaction.tx.value.msg[index]]
filteredTxs.push(transaction)
}
transaction.tx.value.msg.forEach(msg => {
// only push transactions messages supported by Lunie
if (cosmosWhitelistedMessageTypes.has(msg.type.split('/')[1])) {
filteredMsgs.push(msg)
}
})
transaction.tx.value.msg = filteredMsgs
filteredMsgs = []
})
return filteredTxs.map(tx => transactionReducer(tx, reducers))
return reversedTxs.map(tx => transactionReducer(tx, reducers))
}

function transactionReducerV2(transaction, reducers) {
Expand Down

0 comments on commit 2f4a296

Please sign in to comment.