Temporal fix: update of the creationTxHash

This commit is contained in:
Germán Martínez 2019-07-22 14:30:18 +02:00
parent 64de39ae35
commit eaae2b3b9f
2 changed files with 434 additions and 273 deletions

View File

@ -38,6 +38,19 @@ type TxServiceModel = {
isExecuted: boolean,
}
const compareConfirmations = (a, b) => {
const confA = a.hash.toLowerCase()
const confB = b.hash.toLowerCase()
let comparison = 0
if (confA > confB) {
comparison = 1
} else if (confA < confB) {
comparison = -1
}
return comparison
}
export const buildTransactionFrom = async (
safeAddress: string,
tx: TxServiceModel,
@ -59,7 +72,7 @@ export const buildTransactionFrom = async (
const modifySettingsTx = tx.to === safeAddress && Number(tx.value) === 0 && !!tx.data
const cancellationTx = tx.to === safeAddress && Number(tx.value) === 0 && !tx.data
const isTokenTransfer = await isAddressAToken(tx.to)
const creationTxHash = confirmations.first().hash
const creationTxHash = confirmations.sort(compareConfirmations).first().hash
let executionTxHash
const executionTx = confirmations.find(conf => conf.type === TX_TYPE_EXECUTION)

692
yarn.lock

File diff suppressed because it is too large Load Diff