mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add hex-prefix to gas estimate result
This commit is contained in:
parent
299abee666
commit
1b9ed23752
@ -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)))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -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 () => {
|
||||
|
Loading…
Reference in New Issue
Block a user