aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/tests/send-utils.test.js
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-09-27 21:46:24 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-10-01 23:23:32 +0800
commit918fb71df3079a80102fb77893af69ef3372e75f (patch)
tree6cfd03137fc27a53acee80ced7d0f78645fc0a32 /ui/app/components/send/tests/send-utils.test.js
parent3741927d8d63bbee1eb9a628d2aac4c8e2e67f99 (diff)
downloadtangerine-wallet-browser-918fb71df3079a80102fb77893af69ef3372e75f.tar.gz
tangerine-wallet-browser-918fb71df3079a80102fb77893af69ef3372e75f.tar.zst
tangerine-wallet-browser-918fb71df3079a80102fb77893af69ef3372e75f.zip
Update gas when hex data changes on send screen
Diffstat (limited to 'ui/app/components/send/tests/send-utils.test.js')
-rw-r--r--ui/app/components/send/tests/send-utils.test.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/app/components/send/tests/send-utils.test.js b/ui/app/components/send/tests/send-utils.test.js
index 3d983a5dc..b72d87eee 100644
--- a/ui/app/components/send/tests/send-utils.test.js
+++ b/ui/app/components/send/tests/send-utils.test.js
@@ -367,6 +367,18 @@ describe('send utils', () => {
assert.equal(result, '0xabc16')
})
+ it('should call ethQuery.estimateGas without a recipient if the recipient is empty and data passed', async () => {
+ const data = 'mockData'
+ const to = ''
+ const result = await estimateGas({...baseMockParams, data, to})
+ assert.equal(baseMockParams.estimateGasMethod.callCount, 1)
+ assert.deepEqual(
+ baseMockParams.estimateGasMethod.getCall(0).args[0],
+ { gasPrice: undefined, value: undefined, data, from: baseExpectedCall.from, gas: baseExpectedCall.gas},
+ )
+ assert.equal(result, '0xabc16')
+ })
+
it(`should return ${SIMPLE_GAS_COST} if ethQuery.getCode does not return '0x'`, async () => {
assert.equal(baseMockParams.estimateGasMethod.callCount, 0)
const result = await estimateGas(Object.assign({}, baseMockParams, { to: '0x123' }))