diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-06-15 05:04:14 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-06-15 05:58:42 +0800 |
commit | 1b9ed237527b9970c3dfcbb0234cfdb2ffa8c807 (patch) | |
tree | 2a2f2d53cce25455c8c41b6cc4393cb5bd2efab3 /ui/app | |
parent | 299abee666d7f8347e062afff4f2fae47c7f6968 (diff) | |
download | tangerine-wallet-browser-1b9ed237527b9970c3dfcbb0234cfdb2ffa8c807.tar tangerine-wallet-browser-1b9ed237527b9970c3dfcbb0234cfdb2ffa8c807.tar.gz tangerine-wallet-browser-1b9ed237527b9970c3dfcbb0234cfdb2ffa8c807.tar.bz2 tangerine-wallet-browser-1b9ed237527b9970c3dfcbb0234cfdb2ffa8c807.tar.lz tangerine-wallet-browser-1b9ed237527b9970c3dfcbb0234cfdb2ffa8c807.tar.xz tangerine-wallet-browser-1b9ed237527b9970c3dfcbb0234cfdb2ffa8c807.tar.zst tangerine-wallet-browser-1b9ed237527b9970c3dfcbb0234cfdb2ffa8c807.zip |
Add hex-prefix to gas estimate result
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/components/send_/send.utils.js | 4 | ||||
-rw-r--r-- | ui/app/components/send_/tests/send-utils.test.js | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ui/app/components/send_/send.utils.js b/ui/app/components/send_/send.utils.js index 67699be77..04a41456c 100644 --- a/ui/app/components/send_/send.utils.js +++ b/ui/app/components/send_/send.utils.js @@ -201,12 +201,12 @@ async function estimateGas ({ selectedAddress, selectedToken, blockGasLimit, to, err.message.includes('gas required exceeds allowance or always failing transaction') ) if (simulationFailed) { - return resolve(paramsForGasEstimate.gas) + return resolve(ethUtil.addHexPrefix(paramsForGasEstimate.gas)) } else { return reject(err) } } - return resolve(estimatedGas.toString(16)) + return resolve(ethUtil.addHexPrefix(estimatedGas.toString(16))) }) }) } diff --git a/ui/app/components/send_/tests/send-utils.test.js b/ui/app/components/send_/tests/send-utils.test.js index b3f6372ef..6db875342 100644 --- a/ui/app/components/send_/tests/send-utils.test.js +++ b/ui/app/components/send_/tests/send-utils.test.js @@ -285,7 +285,7 @@ describe('send utils', () => { baseMockParams.estimateGasMethod.getCall(0).args[0], Object.assign({ gasPrice: undefined, value: undefined }, baseExpectedCall) ) - assert.equal(result, 'mockToString:16') + assert.equal(result, '0xmockToString:16') }) it('should call ethQuery.estimateGas with a value of 0x0 and the expected data and to if passed a selectedToken', async () => { @@ -300,7 +300,7 @@ describe('send utils', () => { to: 'mockAddress', }) ) - assert.equal(result, 'mockToString:16') + assert.equal(result, '0xmockToString:16') }) it(`should return ${SIMPLE_GAS_COST} if ethQuery.getCode does not return '0x'`, async () => { |