1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-28 03:08:30 +00:00

fix: estimateGasPrice reload currentState instance

This commit is contained in:
Szymon Lesisz 2018-05-11 14:41:24 +02:00
parent 5b2e642b20
commit b8b8ed6a34

View File

@ -758,7 +758,7 @@ const estimateGasPrice = (): AsyncAction => {
const web3instance: ?Web3Instance = getState().web3.filter(w3 => w3.network === accountState.network)[0]; const web3instance: ?Web3Instance = getState().web3.filter(w3 => w3.network === accountState.network)[0];
if (!web3instance) return; if (!web3instance) return;
const web3 = web3instance.web3; const web3 = web3instance.web3;
const currentState: State = getState().sendForm; let currentState: State = getState().sendForm;
const data: string = '0x' + (currentState.data.length % 2 === 0 ? currentState.data : '0' + currentState.data); const data: string = '0x' + (currentState.data.length % 2 === 0 ? currentState.data : '0' + currentState.data);
const gasLimit = await estimateGas(web3instance.web3, { const gasLimit = await estimateGas(web3instance.web3, {
@ -768,6 +768,8 @@ const estimateGasPrice = (): AsyncAction => {
gasPrice: web3.toHex( EthereumjsUnits.convert(currentState.gasPrice, 'gwei', 'wei') ), gasPrice: web3.toHex( EthereumjsUnits.convert(currentState.gasPrice, 'gwei', 'wei') ),
}); });
currentState = getState().sendForm;
dispatch({ dispatch({
type: SEND.GAS_LIMIT_CHANGE, type: SEND.GAS_LIMIT_CHANGE,
state: { state: {