Fix build

This commit is contained in:
Leonid Logvinov
2018-02-23 14:56:05 -08:00
parent 93b2736d65
commit 4e451479f8
2 changed files with 6 additions and 6 deletions

View File

@@ -7,8 +7,8 @@ import * as Web3 from 'web3';
export class BaseContract { export class BaseContract {
protected _ethersInterface: ethersContracts.Interface; protected _ethersInterface: ethersContracts.Interface;
protected _web3Wrapper: Web3Wrapper; protected _web3Wrapper: Web3Wrapper;
protected _abi: Web3.ContractAbi; public abi: Web3.ContractAbi;
protected _address: string; public address: string;
protected static _transformABIData( protected static _transformABIData(
abis: Web3.DataItem[], abis: Web3.DataItem[],
values: any[], values: any[],
@@ -49,7 +49,7 @@ export class BaseContract {
// 3. Gas estimate calculation + safety margin // 3. Gas estimate calculation + safety margin
const removeUndefinedProperties = _.pickBy; const removeUndefinedProperties = _.pickBy;
const txDataWithDefaults = { const txDataWithDefaults = {
to: this._address, to: this.address,
...removeUndefinedProperties(this._web3Wrapper.getContractDefaults()), ...removeUndefinedProperties(this._web3Wrapper.getContractDefaults()),
...removeUndefinedProperties(txData as any), ...removeUndefinedProperties(txData as any),
// HACK: TS can't prove that T is spreadable. // HACK: TS can't prove that T is spreadable.
@@ -63,8 +63,8 @@ export class BaseContract {
} }
constructor(web3Wrapper: Web3Wrapper, abi: Web3.ContractAbi, address: string) { constructor(web3Wrapper: Web3Wrapper, abi: Web3.ContractAbi, address: string) {
this._web3Wrapper = web3Wrapper; this._web3Wrapper = web3Wrapper;
this._abi = abi; this.abi = abi;
this._address = address; this.address = address;
this._ethersInterface = new ethersContracts.Interface(abi); this._ethersInterface = new ethersContracts.Interface(abi);
} }
} }

View File

@@ -43,6 +43,6 @@ export class {{contractName}}Contract extends BaseContract {
{{/each}} {{/each}}
constructor(web3Wrapper: Web3Wrapper, abi: Web3.ContractAbi, address: string) { constructor(web3Wrapper: Web3Wrapper, abi: Web3.ContractAbi, address: string) {
super(web3Wrapper, abi, address); super(web3Wrapper, abi, address);
classUtils.bindAll(this, ['_ethersInterface', '_address', '_abi', '_web3Wrapper']); classUtils.bindAll(this, ['_ethersInterface', 'address', 'abi', '_web3Wrapper']);
} }
} // tslint:disable:max-file-line-count } // tslint:disable:max-file-line-count