diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2017-12-13 09:18:15 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2017-12-14 04:36:29 +0800 |
commit | 91f276d9254bba3d93fc821c4fadab2eb6fc1d65 (patch) | |
tree | 9c33a09f44f06d5f9b45da74e027012cf4dfbbb6 /packages/kovan-faucets/src/ts/zrx_request_queue.ts | |
parent | 1e9f23ebba5e0729b64e757d6901205278871e9f (diff) | |
download | dexon-sol-tools-91f276d9254bba3d93fc821c4fadab2eb6fc1d65.tar.gz dexon-sol-tools-91f276d9254bba3d93fc821c4fadab2eb6fc1d65.tar.zst dexon-sol-tools-91f276d9254bba3d93fc821c4fadab2eb6fc1d65.zip |
Cleanup kovan-faucet package
Diffstat (limited to 'packages/kovan-faucets/src/ts/zrx_request_queue.ts')
-rw-r--r-- | packages/kovan-faucets/src/ts/zrx_request_queue.ts | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/packages/kovan-faucets/src/ts/zrx_request_queue.ts b/packages/kovan-faucets/src/ts/zrx_request_queue.ts index 8971f94f0..72500789c 100644 --- a/packages/kovan-faucets/src/ts/zrx_request_queue.ts +++ b/packages/kovan-faucets/src/ts/zrx_request_queue.ts @@ -1,6 +1,6 @@ import {ZeroEx} from '0x.js'; +import {promisify} from '@0xproject/utils'; import BigNumber from 'bignumber.js'; -import promisify = require('es6-promisify'); import * as _ from 'lodash'; import * as Web3 from 'web3'; @@ -8,24 +8,19 @@ import {configs} from './configs'; import {errorReporter} from './error_reporter'; import {RequestQueue} from './request_queue'; import {utils} from './utils'; -// HACK: web3 leaks XMLHttpRequest into the global scope and causes requests to hang -// because they are using the wrong XHR package. -// Issue: https://github.com/trufflesuite/truffle-contract/issues/14 -delete (global as any).XMLHttpRequest; const DISPENSE_AMOUNT_ZRX = new BigNumber(0.1); const QUEUE_INTERVAL_MS = 5000; -const KOVAN_NETWORK_ID = 42; export class ZRXRequestQueue extends RequestQueue { private zeroEx: ZeroEx; constructor(web3: Web3) { super(web3); this.queueIntervalMs = QUEUE_INTERVAL_MS; - const config = { - networkId: KOVAN_NETWORK_ID, + const zeroExConfig = { + networkId: configs.KOVAN_NETWORK_ID, }; - this.zeroEx = new ZeroEx(web3.currentProvider, config); + this.zeroEx = new ZeroEx(web3.currentProvider, zeroExConfig); } protected async processNextRequestFireAndForgetAsync(recipientAddress: string) { utils.consoleLog(`Processing ZRX ${recipientAddress}`); |