mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Stringify gas estimate in backend, before it is serialized and sent to ui (#11266)
* Stringify gas estimate in backend, before it is serialized and sent to ui * Fix send.utils.test.js
This commit is contained in:
parent
523c04b47a
commit
3af174b590
@ -1937,7 +1937,7 @@ export default class MetamaskController extends EventEmitter {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
return resolve(res);
|
||||
return resolve(res.toString(16));
|
||||
},
|
||||
);
|
||||
});
|
||||
|
@ -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 =
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user