Merge pull request #194 from gnosis/refactor-tx-service

Update safe-react for the refactor of the Safe Transaction Service
This commit is contained in:
Mikhail Mikheev 2019-11-08 14:45:21 +04:00 committed by GitHub
commit d4f0cc8f47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 9 deletions

View File

@ -14,7 +14,6 @@ import { EMPTY_DATA } from '~/logic/wallets/ethTransactions'
import { addTransactions } from './addTransactions' import { addTransactions } from './addTransactions'
import { getHumanFriendlyToken } from '~/logic/tokens/store/actions/fetchTokens' import { getHumanFriendlyToken } from '~/logic/tokens/store/actions/fetchTokens'
import { isTokenTransfer } from '~/logic/tokens/utils/tokenHelpers' import { isTokenTransfer } from '~/logic/tokens/utils/tokenHelpers'
import { TX_TYPE_EXECUTION } from '~/logic/safe/transactions'
import { decodeParamsFromSafeMethod } from '~/logic/contracts/methodIds' import { decodeParamsFromSafeMethod } from '~/logic/contracts/methodIds'
import { ALTERNATIVE_TOKEN_ABI } from '~/logic/tokens/utils/alternativeAbi' import { ALTERNATIVE_TOKEN_ABI } from '~/logic/tokens/utils/alternativeAbi'
@ -38,6 +37,7 @@ type TxServiceModel = {
executionDate: string, executionDate: string,
confirmations: ConfirmationServiceModel[], confirmations: ConfirmationServiceModel[],
isExecuted: boolean, isExecuted: boolean,
transactionHash: string,
} }
export const buildTransactionFrom = async ( export const buildTransactionFrom = async (
@ -63,13 +63,6 @@ export const buildTransactionFrom = async (
const isSendTokenTx = await isTokenTransfer(tx.data, tx.value) const isSendTokenTx = await isTokenTransfer(tx.data, tx.value)
const customTx = tx.to !== safeAddress && !!tx.data && !isSendTokenTx const customTx = tx.to !== safeAddress && !!tx.data && !isSendTokenTx
let executionTxHash
const executionTx = confirmations.find((conf) => conf.type === TX_TYPE_EXECUTION)
if (executionTx) {
executionTxHash = executionTx.hash
}
let symbol = 'ETH' let symbol = 'ETH'
let decimals = 18 let decimals = 18
let decodedParams let decodedParams
@ -112,7 +105,7 @@ export const buildTransactionFrom = async (
isExecuted: tx.isExecuted, isExecuted: tx.isExecuted,
submissionDate: tx.submissionDate, submissionDate: tx.submissionDate,
executionDate: tx.executionDate, executionDate: tx.executionDate,
executionTxHash, executionTxHash: tx.transactionHash,
safeTxHash: tx.safeTxHash, safeTxHash: tx.safeTxHash,
isTokenTransfer: isSendTokenTx, isTokenTransfer: isSendTokenTx,
decodedParams, decodedParams,