use sameAddress function to check address eqaulity when fetching transactions (#365)

This commit is contained in:
Mikhail Mikheev 2019-12-17 18:53:30 +04:00 committed by GitHub
parent d58954aa6f
commit d0c48a8b48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 305 additions and 713 deletions

View File

@ -31,18 +31,18 @@
"dependencies": {
"@gnosis.pm/safe-contracts": "1.0.0",
"@gnosis.pm/util-contracts": "2.0.4",
"@material-ui/core": "4.7.2",
"@material-ui/core": "4.8.0",
"@material-ui/icons": "4.5.1",
"@portis/web3": "^2.0.0-beta.45",
"@testing-library/jest-dom": "4.2.4",
"@toruslabs/torus-embed": "0.2.9",
"@toruslabs/torus-embed": "0.2.10",
"@walletconnect/web3-provider": "^1.0.0-beta.37",
"@welldone-software/why-did-you-render": "3.3.9",
"@welldone-software/why-did-you-render": "3.4.1",
"axios": "0.19.0",
"bignumber.js": "9.0.0",
"connected-react-router": "6.6.1",
"date-fns": "2.8.1",
"currency-flags": "^2.1.1",
"date-fns": "2.8.1",
"dotenv": "^8.2.0",
"ethereum-ens": "0.7.8",
"final-form": "4.18.6",
@ -102,7 +102,7 @@
"@babel/preset-env": "7.7.6",
"@babel/preset-flow": "7.7.4",
"@babel/preset-react": "7.7.4",
"@testing-library/react": "9.3.3",
"@testing-library/react": "9.4.0",
"autoprefixer": "9.7.3",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "10.0.3",
@ -113,7 +113,7 @@
"babel-plugin-transform-es3-property-literals": "^6.22.0",
"babel-polyfill": "^6.26.0",
"classnames": "^2.2.6",
"css-loader": "3.3.0",
"css-loader": "3.3.2",
"detect-port": "^1.3.0",
"eslint": "6.7.2",
"eslint-config-airbnb": "18.0.1",
@ -125,7 +125,7 @@
"ethereumjs-abi": "0.6.8",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "5.0.2",
"flow-bin": "0.113.0",
"flow-bin": "0.114.0",
"fs-extra": "8.1.0",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
@ -140,12 +140,12 @@
"prettier-eslint-cli": "5.0.0",
"run-with-testrpc": "0.3.1",
"style-loader": "1.0.1",
"terser-webpack-plugin": "2.2.3",
"truffle": "5.1.3",
"terser-webpack-plugin": "2.3.0",
"truffle": "5.1.4",
"truffle-contract": "4.0.31",
"truffle-solidity-loader": "0.1.32",
"url-loader": "3.0.0",
"webpack": "4.41.2",
"webpack": "4.41.3",
"webpack-bundle-analyzer": "3.6.0",
"webpack-cli": "3.3.10",
"webpack-dev-server": "3.9.0",

View File

@ -47,7 +47,7 @@ const activateTokensByBalance = (safeAddress: string) => async (
// update list of active tokens
dispatch(updateActiveTokens(safeAddress, activeTokens))
} catch (err) {
console.error('Error fetching token list', err)
console.error('Error fetching active token list', err)
}
return null

View File

@ -19,7 +19,7 @@ import { getHumanFriendlyToken } from '~/logic/tokens/store/actions/fetchTokens'
import { isTokenTransfer } from '~/logic/tokens/utils/tokenHelpers'
import { decodeParamsFromSafeMethod } from '~/logic/contracts/methodIds'
import { ALTERNATIVE_TOKEN_ABI } from '~/logic/tokens/utils/alternativeAbi'
import { ZERO_ADDRESS } from '~/logic/wallets/ethAddresses'
import { ZERO_ADDRESS, sameAddress } from '~/logic/wallets/ethAddresses'
let web3
@ -77,10 +77,10 @@ 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 modifySettingsTx = sameAddress(tx.to, safeAddress) && Number(tx.value) === 0 && !!tx.data
const cancellationTx = sameAddress(tx.to, safeAddress) && Number(tx.value) === 0 && !tx.data
const isSendTokenTx = await isTokenTransfer(tx.data, tx.value)
const customTx = tx.to !== safeAddress && !!tx.data && !isSendTokenTx
const customTx = !sameAddress(tx.to, safeAddress) && !!tx.data && !isSendTokenTx
let refundParams = null
if (tx.gasPrice > 0) {

988
yarn.lock

File diff suppressed because it is too large Load Diff