diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-05 17:38:28 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-05 17:38:28 +0800 |
commit | a12df1c73a97b3ba18ab53c1b25be39b837f6240 (patch) | |
tree | 6d9ea6902ad1011b0395fc62fa89e89eca259dd9 /src/web3_wrapper.ts | |
parent | 876032a8a71f9eedbf3394727dbc0ea513100836 (diff) | |
download | dexon-sol-tools-a12df1c73a97b3ba18ab53c1b25be39b837f6240.tar dexon-sol-tools-a12df1c73a97b3ba18ab53c1b25be39b837f6240.tar.gz dexon-sol-tools-a12df1c73a97b3ba18ab53c1b25be39b837f6240.tar.bz2 dexon-sol-tools-a12df1c73a97b3ba18ab53c1b25be39b837f6240.tar.lz dexon-sol-tools-a12df1c73a97b3ba18ab53c1b25be39b837f6240.tar.xz dexon-sol-tools-a12df1c73a97b3ba18ab53c1b25be39b837f6240.tar.zst dexon-sol-tools-a12df1c73a97b3ba18ab53c1b25be39b837f6240.zip |
Fix gasPrice regression
Diffstat (limited to 'src/web3_wrapper.ts')
-rw-r--r-- | src/web3_wrapper.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/web3_wrapper.ts b/src/web3_wrapper.ts index f3fe8a00b..a0923bef9 100644 --- a/src/web3_wrapper.ts +++ b/src/web3_wrapper.ts @@ -7,10 +7,12 @@ import {Contract} from './contract'; export class Web3Wrapper { private web3: Web3; + private defaults: Partial<Web3.TxData>; private networkIdIfExists?: number; - constructor(provider: Web3.Provider) { + constructor(provider: Web3.Provider, defaults: Partial<Web3.TxData>) { this.web3 = new Web3(); this.web3.setProvider(provider); + this.defaults = defaults; } public setProvider(provider: Web3.Provider) { delete this.networkIdIfExists; @@ -97,7 +99,7 @@ export class Web3Wrapper { } private getContractInstance<A extends Web3.ContractInstance>(abi: Web3.ContractAbi, address: string): A { const web3ContractInstance = this.web3.eth.contract(abi).at(address); - const contractInstance = new Contract(web3ContractInstance) as any as A; + const contractInstance = new Contract(web3ContractInstance, this.defaults) as any as A; return contractInstance; } private async getNetworkAsync(): Promise<number> { |