From 84d610b1ce67623d535e47d58a5cbb6fd6b412a1 Mon Sep 17 00:00:00 2001 From: mmv Date: Mon, 8 Jul 2019 17:55:03 +0400 Subject: [PATCH] use findLast in fetch transactions because it adds new confirmations to the beginning --- src/routes/safe/store/actions/fetchTransactions.js | 2 +- src/routes/safe/store/actions/processTransaction.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/safe/store/actions/fetchTransactions.js b/src/routes/safe/store/actions/fetchTransactions.js index d67e64ef..91cd45f9 100644 --- a/src/routes/safe/store/actions/fetchTransactions.js +++ b/src/routes/safe/store/actions/fetchTransactions.js @@ -49,7 +49,7 @@ const buildTransactionFrom = async (safeAddress: string, tx: TxServiceModel, saf }), ) const isToken = await isAddressAToken(tx.to) - const creationTxHash = confirmations.find(conf => conf.type === TX_TYPE_CONFIRMATION).hash + const creationTxHash = confirmations.findLast(conf => conf.type === TX_TYPE_CONFIRMATION).hash let executionTxHash const executionTx = confirmations.find(conf => conf.type === TX_TYPE_EXECUTION) diff --git a/src/routes/safe/store/actions/processTransaction.js b/src/routes/safe/store/actions/processTransaction.js index 7b20f876..a257bf75 100644 --- a/src/routes/safe/store/actions/processTransaction.js +++ b/src/routes/safe/store/actions/processTransaction.js @@ -10,7 +10,8 @@ import { approveTransaction, executeTransaction, CALL } from '~/logic/safe/trans // https://gnosis-safe.readthedocs.io/en/latest/contracts/signatures.html#pre-validated-signatures // https://github.com/gnosis/safe-contracts/blob/master/test/gnosisSafeTeamEdition.js#L26 const generateSignaturesFromTxConfirmations = (tx: Transaction) => { - // The constant parts need to be sorted so that the recovered signers are sorted ascending (natural order) by address (not checksummed). + // The constant parts need to be sorted so that the recovered signers are sorted ascending + // (natural order) by address (not checksummed). const confirmedAdresses = tx.confirmations.map(conf => conf.owner.address).sort() let sigs = '0x'