Remove extra logs and other small fixes

This commit is contained in:
Alex Browne
2018-06-04 18:41:30 -07:00
parent bca62c813d
commit 45a3d8b75a
4 changed files with 14 additions and 19 deletions

View File

@@ -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;

View File

@@ -78,7 +78,6 @@ export class {{contractName}}Contract extends BaseContract {
logUtils.log(`transactionHash: ${txHash}`);
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
logUtils.log(`{{contractName}} successfully deployed at ${txReceipt.contractAddress}`);
logUtils.log(`{{contractName}} reported status: ${txReceipt.status}`);
const contractInstance = new {{contractName}}Contract(abi, txReceipt.contractAddress as string, provider, txDefaults);
contractInstance.constructorArgs = [{{> params inputs=ctor.inputs}}];
return contractInstance;

View File

@@ -28,7 +28,6 @@ export class BlockchainLifecycle {
break;
case NodeType.Geth:
const blockNumber = await this._web3Wrapper.getBlockNumberAsync();
console.log(`block number for snapshot: ${blockNumber}`);
this._snapshotIdsStack.push(blockNumber);
break;
default:
@@ -47,7 +46,6 @@ export class BlockchainLifecycle {
break;
case NodeType.Geth:
const blockNumber = this._snapshotIdsStack.pop() as number;
console.log(`setting head: ${blockNumber}`);
await this._web3Wrapper.setHeadAsync(blockNumber);
break;
default:

File diff suppressed because one or more lines are too long