aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers/metamask.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-09-22 12:15:26 +0800
committerDan <danjm.com@gmail.com>2017-09-26 08:24:55 +0800
commit88c4226bf1dca8647a45f3921396daaa88bbf939 (patch)
treeb1a777ed4dcfcf058166e5b9a180f11c8654caf1 /ui/app/reducers/metamask.js
parenta1d87b821b7e0a444257065d284b13f98e4d3173 (diff)
downloadtangerine-wallet-browser-88c4226bf1dca8647a45f3921396daaa88bbf939.tar
tangerine-wallet-browser-88c4226bf1dca8647a45f3921396daaa88bbf939.tar.gz
tangerine-wallet-browser-88c4226bf1dca8647a45f3921396daaa88bbf939.tar.bz2
tangerine-wallet-browser-88c4226bf1dca8647a45f3921396daaa88bbf939.tar.lz
tangerine-wallet-browser-88c4226bf1dca8647a45f3921396daaa88bbf939.tar.xz
tangerine-wallet-browser-88c4226bf1dca8647a45f3921396daaa88bbf939.tar.zst
tangerine-wallet-browser-88c4226bf1dca8647a45f3921396daaa88bbf939.zip
Estimate gasPrice and gasLimit in send screen.
Diffstat (limited to 'ui/app/reducers/metamask.js')
-rw-r--r--ui/app/reducers/metamask.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js
index cdc98d05e..e78f51f3a 100644
--- a/ui/app/reducers/metamask.js
+++ b/ui/app/reducers/metamask.js
@@ -19,6 +19,8 @@ function reduceMetamask (state, action) {
addressBook: [],
selectedTokenAddress: null,
tokenExchangeRates: {},
+ estimatedGas: null,
+ blockGasPrice: null,
}, state.metamask)
switch (action.type) {
@@ -74,6 +76,26 @@ function reduceMetamask (state, action) {
},
})
+ case actions.UPDATE_GAS_ESTIMATE:
+ return extend(metamaskState, {
+ estimatedGas: action.value,
+ })
+
+ case actions.UPDATE_GAS_PRICE:
+ return extend(metamaskState, {
+ blockGasPrice: action.value,
+ })
+
+ case actions.CLEAR_GAS_ESTIMATE:
+ return extend(metamaskState, {
+ estimatedGas: null,
+ })
+
+ case actions.CLEAR_GAS_PRICE:
+ return extend(metamaskState, {
+ blockGasPrice: null,
+ })
+
case actions.COMPLETED_TX:
var stringId = String(action.id)
newState = extend(metamaskState, {