diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-28 15:13:56 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-28 15:13:56 +0800 |
commit | f49a5072972296677cc19ab5d5354175b8f8287b (patch) | |
tree | e005b63f8aca73e188af0eb08c495822c6b7ec2b | |
parent | c308359f59cc24510ff3d42ae777226a599db376 (diff) | |
download | dexon-sol-tools-f49a5072972296677cc19ab5d5354175b8f8287b.tar dexon-sol-tools-f49a5072972296677cc19ab5d5354175b8f8287b.tar.gz dexon-sol-tools-f49a5072972296677cc19ab5d5354175b8f8287b.tar.bz2 dexon-sol-tools-f49a5072972296677cc19ab5d5354175b8f8287b.tar.lz dexon-sol-tools-f49a5072972296677cc19ab5d5354175b8f8287b.tar.xz dexon-sol-tools-f49a5072972296677cc19ab5d5354175b8f8287b.tar.zst dexon-sol-tools-f49a5072972296677cc19ab5d5354175b8f8287b.zip |
Add missing awaitTransactionSuccessAsync calls
-rw-r--r-- | packages/contracts/src/utils/erc20_wrapper.ts | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/contracts/src/utils/erc20_wrapper.ts b/packages/contracts/src/utils/erc20_wrapper.ts index 652f29726..451f16513 100644 --- a/packages/contracts/src/utils/erc20_wrapper.ts +++ b/packages/contracts/src/utils/erc20_wrapper.ts @@ -90,9 +90,11 @@ export class ERC20Wrapper { } public async setBalanceAsync(userAddress: string, assetData: string, amount: BigNumber): Promise<void> { const tokenContract = this._getTokenContractFromAssetData(assetData); - await tokenContract.setBalance.sendTransactionAsync(userAddress, amount, { - from: this._contractOwnerAddress, - }); + await this._web3Wrapper.awaitTransactionSuccessAsync( + await tokenContract.setBalance.sendTransactionAsync(userAddress, amount, { + from: this._contractOwnerAddress, + }), + ); } public async getProxyAllowanceAsync(userAddress: string, assetData: string): Promise<BigNumber> { const tokenContract = this._getTokenContractFromAssetData(assetData); @@ -103,9 +105,11 @@ export class ERC20Wrapper { public async setAllowanceAsync(userAddress: string, assetData: string, amount: BigNumber): Promise<void> { const tokenContract = this._getTokenContractFromAssetData(assetData); const proxyAddress = (this._proxyContract as ERC20ProxyContract).address; - await tokenContract.approve.sendTransactionAsync(proxyAddress, amount, { - from: userAddress, - }); + await this._web3Wrapper.awaitTransactionSuccessAsync( + await tokenContract.approve.sendTransactionAsync(proxyAddress, amount, { + from: userAddress, + }), + ); } public async getBalancesAsync(): Promise<ERC20BalancesByOwner> { this._validateDummyTokenContractsExistOrThrow(); |