diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 67b8286a7..ecee4dd0b 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1937,7 +1937,7 @@ export default class MetamaskController extends EventEmitter { return reject(err); } - return resolve(res); + return resolve(res.toString(16)); }, ); }); diff --git a/ui/pages/send/send.utils.js b/ui/pages/send/send.utils.js index 1603061e2..889015a77 100644 --- a/ui/pages/send/send.utils.js +++ b/ui/pages/send/send.utils.js @@ -254,11 +254,7 @@ async function estimateGasForSend({ // run tx try { const estimatedGas = await estimateGasMethod(paramsForGasEstimate); - const estimateWithBuffer = addGasBuffer( - estimatedGas.toString(16), - blockGasLimit, - 1.5, - ); + const estimateWithBuffer = addGasBuffer(estimatedGas, blockGasLimit, 1.5); return addHexPrefix(estimateWithBuffer); } catch (error) { const simulationFailed = diff --git a/ui/pages/send/send.utils.test.js b/ui/pages/send/send.utils.test.js index 06d3d8edc..91b94d8ef 100644 --- a/ui/pages/send/send.utils.test.js +++ b/ui/pages/send/send.utils.test.js @@ -290,7 +290,7 @@ describe('send utils', () => { if (typeof to === 'string' && to.match(/willFailBecauseOf:/u)) { throw new Error(to.match(/:(.+)$/u)[1]); } - return { toString: (n) => `0xabc${n}` }; + return '0xabc16'; }), }; const baseexpectedCall = {