WA-238 Fix updating executed txs

This commit is contained in:
apanizo 2018-05-27 13:56:22 +02:00
parent 192eb9b909
commit 194e51d207
2 changed files with 4 additions and 4 deletions

View File

@ -21,7 +21,7 @@ export const buildConfirmationsFrom =
throw new Error('This safe has no owners') throw new Error('This safe has no owners')
} }
if (!owners.find((owner: Owner) => owner.get('address') === creator)) { if (!owners.find((owner: Owner) => owner.get('address').toLowerCase() === creator.toLowerCase())) {
throw new Error('The creator of the tx is not an owner') throw new Error('The creator of the tx is not an owner')
} }

View File

@ -3,7 +3,7 @@ import { List } from 'immutable'
import { type Owner } from '~/routes/safe/store/model/owner' import { type Owner } from '~/routes/safe/store/model/owner'
import { load, TX_KEY } from '~/utils/localStorage' import { load, TX_KEY } from '~/utils/localStorage'
import { type Confirmation, makeConfirmation } from '~/routes/safe/store/model/confirmation' import { type Confirmation, makeConfirmation } from '~/routes/safe/store/model/confirmation'
import { makeTransaction, type Transaction } from '~/routes/safe/store/model/transaction' import { makeTransaction, type Transaction, type TransactionProps } from '~/routes/safe/store/model/transaction'
import { getGnosisSafeContract } from '~/wallets/safeContracts' import { getGnosisSafeContract } from '~/wallets/safeContracts'
import { getWeb3 } from '~/wallets/getWeb3' import { getWeb3 } from '~/wallets/getWeb3'
import { EXECUTED_CONFIRMATION_HASH } from '~/routes/safe/component/AddTransaction/createTransactions' import { EXECUTED_CONFIRMATION_HASH } from '~/routes/safe/component/AddTransaction/createTransactions'
@ -27,9 +27,9 @@ export const updateTransaction = (
const transactions = safeTransactions[safeAddress] const transactions = safeTransactions[safeAddress]
const txsRecord = transactions ? List(transactions) : List([]) const txsRecord = transactions ? List(transactions) : List([])
const index = txsRecord.findIndex((trans: Transaction) => trans.get('nonce') === nonce) const index = txsRecord.findIndex((trans: TransactionProps) => trans.nonce === nonce)
safeTransactions[safeAddress] = txsRecord.update(index, transaction) safeTransactions[safeAddress] = txsRecord.remove(index).push(transaction)
localStorage.setItem(TX_KEY, JSON.stringify(safeTransactions)) localStorage.setItem(TX_KEY, JSON.stringify(safeTransactions))
} }