diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-06 08:02:33 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-07 03:41:14 +0800 |
commit | 98656289eadc988798ec6b85b546b320eaaa1ff5 (patch) | |
tree | b1450ccfcd078d514307e196672f2a2c30d67b0a /packages | |
parent | 167a38e27d09af12af6c59f1b486c835420fbac1 (diff) | |
download | dexon-sol-tools-98656289eadc988798ec6b85b546b320eaaa1ff5.tar dexon-sol-tools-98656289eadc988798ec6b85b546b320eaaa1ff5.tar.gz dexon-sol-tools-98656289eadc988798ec6b85b546b320eaaa1ff5.tar.bz2 dexon-sol-tools-98656289eadc988798ec6b85b546b320eaaa1ff5.tar.lz dexon-sol-tools-98656289eadc988798ec6b85b546b320eaaa1ff5.tar.xz dexon-sol-tools-98656289eadc988798ec6b85b546b320eaaa1ff5.tar.zst dexon-sol-tools-98656289eadc988798ec6b85b546b320eaaa1ff5.zip |
Remove global gas estimate buffer
Diffstat (limited to 'packages')
-rw-r--r-- | packages/base-contract/src/index.ts | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index b32eba2fa..64783b469 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -20,8 +20,6 @@ export interface EthersInterfaceByFunctionSignature { [key: string]: ethers.Interface; } -const GAS_BUFFER_AMOUNT = 1.1; - export class BaseContract { protected _ethersInterfacesByFunctionSignature: EthersInterfaceByFunctionSignature; protected _web3Wrapper: Web3Wrapper; @@ -81,9 +79,7 @@ export class BaseContract { // Awaiting https://github.com/Microsoft/TypeScript/pull/13288 to be merged } as any; if (_.isUndefined(txDataWithDefaults.gas) && !_.isUndefined(estimateGasAsync)) { - const estimatedGas = await estimateGasAsync(txData); - const buffered = Math.ceil(estimatedGas * GAS_BUFFER_AMOUNT); - txDataWithDefaults.gas = buffered; + txDataWithDefaults.gas = await estimateGasAsync(txData); } return txDataWithDefaults; } |