From d9b1d31e7310f7f554f1740f93e4ccd5b5db90f5 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Tue, 6 Feb 2018 15:15:24 -0800 Subject: Organize async task queues by network --- .../testnet-faucets/src/ts/ether_request_queue.ts | 27 ---------------------- 1 file changed, 27 deletions(-) delete mode 100644 packages/testnet-faucets/src/ts/ether_request_queue.ts (limited to 'packages/testnet-faucets/src/ts/ether_request_queue.ts') diff --git a/packages/testnet-faucets/src/ts/ether_request_queue.ts b/packages/testnet-faucets/src/ts/ether_request_queue.ts deleted file mode 100644 index 710d49f39..000000000 --- a/packages/testnet-faucets/src/ts/ether_request_queue.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { promisify } from '@0xproject/utils'; -import * as _ from 'lodash'; - -import { configs } from './configs'; -import { errorReporter } from './error_reporter'; -import { RequestQueue } from './request_queue'; -import { utils } from './utils'; - -const DISPENSE_AMOUNT_ETHER = 0.1; - -export class EtherRequestQueue extends RequestQueue { - protected async _processNextRequestFireAndForgetAsync(recipientAddress: string) { - utils.consoleLog(`Processing ETH ${recipientAddress}`); - const sendTransactionAsync = promisify(this._web3.eth.sendTransaction); - try { - const txHash = await sendTransactionAsync({ - from: configs.DISPENSER_ADDRESS, - to: recipientAddress, - value: this._web3.toWei(DISPENSE_AMOUNT_ETHER, 'ether'), - }); - utils.consoleLog(`Sent ${DISPENSE_AMOUNT_ETHER} ETH to ${recipientAddress} tx: ${txHash}`); - } catch (err) { - utils.consoleLog(`Unexpected err: ${err} - ${JSON.stringify(err)}`); - await errorReporter.reportAsync(err); - } - } -} -- cgit v1.2.3