diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-07 00:22:28 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-07 00:22:28 +0800 |
commit | 88791f732fc83bb273508ec8d4b1e87c6bea05dc (patch) | |
tree | 6f1bf2e6b8c01fb4e4a22aedbc57c7e182faee68 /src/0x.ts | |
parent | b1feb5ac29bf2dbe424a5485eb3e48e90c08ba94 (diff) | |
download | dexon-sol-tools-88791f732fc83bb273508ec8d4b1e87c6bea05dc.tar dexon-sol-tools-88791f732fc83bb273508ec8d4b1e87c6bea05dc.tar.gz dexon-sol-tools-88791f732fc83bb273508ec8d4b1e87c6bea05dc.tar.bz2 dexon-sol-tools-88791f732fc83bb273508ec8d4b1e87c6bea05dc.tar.lz dexon-sol-tools-88791f732fc83bb273508ec8d4b1e87c6bea05dc.tar.xz dexon-sol-tools-88791f732fc83bb273508ec8d4b1e87c6bea05dc.tar.zst dexon-sol-tools-88791f732fc83bb273508ec8d4b1e87c6bea05dc.zip |
Make intervalUtils an object instead of a class and make instance variable local
Diffstat (limited to 'src/0x.ts')
-rw-r--r-- | src/0x.ts | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -13,7 +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 {intervalUtils} from './utils/interval_utils'; import {artifacts} from './artifacts'; import {ExchangeWrapper} from './contract_wrappers/exchange_wrapper'; import {TokenRegistryWrapper} from './contract_wrappers/token_registry_wrapper'; @@ -73,7 +73,6 @@ export class ZeroEx { public proxy: TokenTransferProxyWrapper; private _web3Wrapper: Web3Wrapper; private _abiDecoder: AbiDecoder; - private _intervalUtils: IntervalUtils; /** * Verifies that the elliptic curve signature `signature` was generated * by signing `data` with the private key corresponding to the `signerAddress` address. @@ -194,7 +193,6 @@ export class ZeroEx { const defaults = { gasPrice, }; - this._intervalUtils = new IntervalUtils(); this._web3Wrapper = new Web3Wrapper(provider, defaults); this.token = new TokenWrapper(this._web3Wrapper); this.proxy = new TokenTransferProxyWrapper(this._web3Wrapper); @@ -283,10 +281,10 @@ export class ZeroEx { txHash: string, pollingIntervalMs: number = 1000): Promise<TransactionReceiptWithDecodedLogs> { const txReceiptPromise = new Promise( (resolve: (receipt: TransactionReceiptWithDecodedLogs) => void, reject) => { - const intervalId = this._intervalUtils.setAsyncExcludingInterval(async () => { + const intervalId = intervalUtils.setAsyncExcludingInterval(async () => { const transactionReceipt = await this._web3Wrapper.getTransactionReceiptAsync(txHash); if (!_.isNull(transactionReceipt)) { - this._intervalUtils.clearAsyncExcludingInterval(intervalId); + intervalUtils.clearAsyncExcludingInterval(intervalId); const logsWithDecodedArgs = _.map(transactionReceipt.logs, (log: Web3.LogEntry) => { const decodedLog = this._abiDecoder.decodeLog(log); if (_.isUndefined(decodedLog)) { |