From 00bf957b53c22f3ccdd6c2e7ad75f0c9e15caa38 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 23 May 2018 18:13:18 -0700 Subject: Add more transactions to Geth on init. Skip tests that are failing. --- packages/base-contract/src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'packages/base-contract') diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index d9e28f9f2..02a9e29b8 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -79,8 +79,13 @@ 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); - txDataWithDefaults.gas = estimatedGas; + // console.log(`original estimate: ${estimatedGas}`); + const buffered = Math.ceil(estimatedGas * 1.1); + // console.log(`buffered estimate: ${buffered}`); + txDataWithDefaults.gas = buffered; } return txDataWithDefaults; } -- cgit From 45a3d8b75a72fc4104f5070361fb34027b66e7f3 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Mon, 4 Jun 2018 18:41:30 -0700 Subject: Remove extra logs and other small fixes --- packages/base-contract/src/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'packages/base-contract') 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; -- cgit From 98656289eadc988798ec6b85b546b320eaaa1ff5 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 5 Jun 2018 17:02:33 -0700 Subject: Remove global gas estimate buffer --- packages/base-contract/src/index.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'packages/base-contract') 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; } -- cgit