diff options
author | Brandon Millman <brandon@0xproject.com> | 2018-02-08 03:16:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-08 03:16:24 +0800 |
commit | 852811b314de3d62ee9068e3c5cbcfaa0650b058 (patch) | |
tree | 2740ad3525a18986ebf09e7e24bba2a755fc35f4 /packages/testnet-faucets/src/ts/ether_request_queue.ts | |
parent | e443cb2a3b58003c5e0dffc0ea2aaa955fc12366 (diff) | |
parent | 2404ff030422e5ad021536135d57a19e98bedcd8 (diff) | |
download | dexon-sol-tools-852811b314de3d62ee9068e3c5cbcfaa0650b058.tar.gz dexon-sol-tools-852811b314de3d62ee9068e3c5cbcfaa0650b058.tar.zst dexon-sol-tools-852811b314de3d62ee9068e3c5cbcfaa0650b058.zip |
Merge pull request #375 from 0xProject/feature/testnet-faucets/queue-by-network
Organize async task queues by network
Diffstat (limited to 'packages/testnet-faucets/src/ts/ether_request_queue.ts')
-rw-r--r-- | packages/testnet-faucets/src/ts/ether_request_queue.ts | 27 |
1 files changed, 0 insertions, 27 deletions
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); - } - } -} |