diff options
author | Leonid <logvinov.leon@gmail.com> | 2017-09-07 00:32:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-07 00:32:02 +0800 |
commit | c56724981970f90dfe68212d0447e8c7c9866b07 (patch) | |
tree | 0d57265a1d2a405987a6764e0c3c858fc87f26c0 /src/0x.ts | |
parent | 912d15cb73de0d44394c9d2e11e8dfdb248ade9c (diff) | |
parent | d2dc4d18be93fd04f237bef7fe7e29e4a9447517 (diff) | |
download | dexon-sol-tools-c56724981970f90dfe68212d0447e8c7c9866b07.tar dexon-sol-tools-c56724981970f90dfe68212d0447e8c7c9866b07.tar.gz dexon-sol-tools-c56724981970f90dfe68212d0447e8c7c9866b07.tar.bz2 dexon-sol-tools-c56724981970f90dfe68212d0447e8c7c9866b07.tar.lz dexon-sol-tools-c56724981970f90dfe68212d0447e8c7c9866b07.tar.xz dexon-sol-tools-c56724981970f90dfe68212d0447e8c7c9866b07.tar.zst dexon-sol-tools-c56724981970f90dfe68212d0447e8c7c9866b07.zip |
Merge pull request #157 from 0xProject/feature/throw-for-exchange-errors
Feature/throw for exchange errors
Diffstat (limited to 'src/0x.ts')
-rw-r--r-- | src/0x.ts | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -13,6 +13,7 @@ import {utils} from './utils/utils'; import {signatureUtils} from './utils/signature_utils'; import {assert} from './utils/assert'; import {AbiDecoder} from './utils/abi_decoder'; +import {intervalUtils} from './utils/interval_utils'; import {artifacts} from './artifacts'; import {ExchangeWrapper} from './contract_wrappers/exchange_wrapper'; import {TokenRegistryWrapper} from './contract_wrappers/token_registry_wrapper'; @@ -280,10 +281,10 @@ export class ZeroEx { txHash: string, pollingIntervalMs: number = 1000): Promise<TransactionReceiptWithDecodedLogs> { const txReceiptPromise = new Promise( (resolve: (receipt: TransactionReceiptWithDecodedLogs) => void, reject) => { - const intervalId = setInterval(async () => { + const intervalId = intervalUtils.setAsyncExcludingInterval(async () => { const transactionReceipt = await this._web3Wrapper.getTransactionReceiptAsync(txHash); if (!_.isNull(transactionReceipt)) { - clearInterval(intervalId); + intervalUtils.clearAsyncExcludingInterval(intervalId); const logsWithDecodedArgs = _.map(transactionReceipt.logs, (log: Web3.LogEntry) => { const decodedLog = this._abiDecoder.decodeLog(log); if (_.isUndefined(decodedLog)) { |