aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorEsteban MiƱo <efmino@uc.cl>2019-01-23 02:22:56 +0800
committerDan Finlay <542863+danfinlay@users.noreply.github.com>2019-01-23 02:22:56 +0800
commite21dfd18622dd7f70dac51855a0052a56fb74e57 (patch)
tree03fe6571c87474c15af266fa0e3bc9c1a755c450 /ui/app/components
parentfe780fb3d457dd22be84cf7ef386327ba9a2ec93 (diff)
downloadtangerine-wallet-browser-e21dfd18622dd7f70dac51855a0052a56fb74e57.tar
tangerine-wallet-browser-e21dfd18622dd7f70dac51855a0052a56fb74e57.tar.gz
tangerine-wallet-browser-e21dfd18622dd7f70dac51855a0052a56fb74e57.tar.bz2
tangerine-wallet-browser-e21dfd18622dd7f70dac51855a0052a56fb74e57.tar.lz
tangerine-wallet-browser-e21dfd18622dd7f70dac51855a0052a56fb74e57.tar.xz
tangerine-wallet-browser-e21dfd18622dd7f70dac51855a0052a56fb74e57.tar.zst
tangerine-wallet-browser-e21dfd18622dd7f70dac51855a0052a56fb74e57.zip
Use Parity on-chain registry only when is needed (#6052)
* add and use knownMethodData to avoid infura requests * dataMethod to methodData and check empty response
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/transaction-list-item/transaction-list-item.container.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/app/components/transaction-list-item/transaction-list-item.container.js b/ui/app/components/transaction-list-item/transaction-list-item.container.js
index e08d3232f..45777057c 100644
--- a/ui/app/components/transaction-list-item/transaction-list-item.container.js
+++ b/ui/app/components/transaction-list-item/transaction-list-item.container.js
@@ -3,7 +3,7 @@ import { withRouter } from 'react-router-dom'
import { compose } from 'recompose'
import withMethodData from '../../higher-order-components/with-method-data'
import TransactionListItem from './transaction-list-item.component'
-import { setSelectedToken, showModal, showSidebar } from '../../actions'
+import { setSelectedToken, showModal, showSidebar, addKnownMethodData } from '../../actions'
import { hexToDecimal } from '../../helpers/conversions.util'
import { getTokenData } from '../../helpers/transactions.util'
import { increaseLastGasPrice } from '../../helpers/confirm-transaction/util'
@@ -15,11 +15,19 @@ import {
setCustomGasLimit,
} from '../../ducks/gas.duck'
+const mapStateToProps = state => {
+ const { metamask: { knownMethodData } } = state
+ return {
+ knownMethodData,
+ }
+}
+
const mapDispatchToProps = dispatch => {
return {
fetchBasicGasAndTimeEstimates: () => dispatch(fetchBasicGasAndTimeEstimates()),
fetchGasEstimates: (blockTime) => dispatch(fetchGasEstimates(blockTime)),
setSelectedToken: tokenAddress => dispatch(setSelectedToken(tokenAddress)),
+ addKnownMethodData: (fourBytePrefix, methodData) => dispatch(addKnownMethodData(fourBytePrefix, methodData)),
retryTransaction: (transaction, gasPrice) => {
dispatch(setCustomGasPriceForRetry(gasPrice || transaction.txParams.gasPrice))
dispatch(setCustomGasLimit(transaction.txParams.gas))
@@ -64,6 +72,6 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
export default compose(
withRouter,
- connect(null, mapDispatchToProps, mergeProps),
+ connect(mapStateToProps, mapDispatchToProps, mergeProps),
withMethodData,
)(TransactionListItem)