aboutsummaryrefslogtreecommitdiffstats
path: root/packages/base-contract/src
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-06-05 09:41:30 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-06-07 03:40:31 +0800
commit45a3d8b75a72fc4104f5070361fb34027b66e7f3 (patch)
tree0632faafc1ed048bd0f0f5e915922a5baa0372fa /packages/base-contract/src
parentbca62c813d2e821c56968916615861366402435b (diff)
downloaddexon-sol-tools-45a3d8b75a72fc4104f5070361fb34027b66e7f3.tar
dexon-sol-tools-45a3d8b75a72fc4104f5070361fb34027b66e7f3.tar.gz
dexon-sol-tools-45a3d8b75a72fc4104f5070361fb34027b66e7f3.tar.bz2
dexon-sol-tools-45a3d8b75a72fc4104f5070361fb34027b66e7f3.tar.lz
dexon-sol-tools-45a3d8b75a72fc4104f5070361fb34027b66e7f3.tar.xz
dexon-sol-tools-45a3d8b75a72fc4104f5070361fb34027b66e7f3.tar.zst
dexon-sol-tools-45a3d8b75a72fc4104f5070361fb34027b66e7f3.zip
Remove extra logs and other small fixes
Diffstat (limited to 'packages/base-contract/src')
-rw-r--r--packages/base-contract/src/index.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts
index 02a9e29b8..b32eba2fa 100644
--- a/packages/base-contract/src/index.ts
+++ b/packages/base-contract/src/index.ts
@@ -20,6 +20,8 @@ export interface EthersInterfaceByFunctionSignature {
[key: string]: ethers.Interface;
}
+const GAS_BUFFER_AMOUNT = 1.1;
+
export class BaseContract {
protected _ethersInterfacesByFunctionSignature: EthersInterfaceByFunctionSignature;
protected _web3Wrapper: Web3Wrapper;
@@ -79,12 +81,8 @@ export class BaseContract {
// Awaiting https://github.com/Microsoft/TypeScript/pull/13288 to be merged
} as any;
if (_.isUndefined(txDataWithDefaults.gas) && !_.isUndefined(estimateGasAsync)) {
- // TODO(albrow): Move this code into a subprovider which we only
- // use for Geth.
const estimatedGas = await estimateGasAsync(txData);
- // console.log(`original estimate: ${estimatedGas}`);
- const buffered = Math.ceil(estimatedGas * 1.1);
- // console.log(`buffered estimate: ${buffered}`);
+ const buffered = Math.ceil(estimatedGas * GAS_BUFFER_AMOUNT);
txDataWithDefaults.gas = buffered;
}
return txDataWithDefaults;