From a0daa3869620ddcddd87c073941de7d9ec65b38c Mon Sep 17 00:00:00 2001 From: clar Date: Thu, 19 Dec 2024 01:54:00 +0800 Subject: [PATCH] Add gasLimit option to EvmSignerOptions for overriding default gas limit (#755) Co-authored-by: Berg Jefferson --- platforms/evm/src/signer.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platforms/evm/src/signer.ts b/platforms/evm/src/signer.ts index cdc84fb10..20aab16e0 100644 --- a/platforms/evm/src/signer.ts +++ b/platforms/evm/src/signer.ts @@ -23,6 +23,8 @@ import { _platform } from './types.js'; export type EvmSignerOptions = { // Whether or not to log messages debug?: boolean; + // Override gas limit + gasLimit?: bigint; // Do not exceed this gas limit maxGasLimit?: bigint; // Partially override specific transaction request fields @@ -117,6 +119,10 @@ export class EvmNativeSigner } } + if (this.opts?.gasLimit !== undefined) { + gasLimit = this.opts.gasLimit; + } + if (this.opts?.maxGasLimit !== undefined) { // why doesnt math.min work for bigints? gasLimit =