diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-02-08 03:00:42 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-02-08 03:00:42 +0800 |
commit | 9ff4cacf0f9122c035537632d68169d7c2d5763f (patch) | |
tree | 6a27330cc3b1b2076e933a573312eaac2948b40b /packages/testnet-faucets/src/ts/handler.ts | |
parent | f3c6cce4559d096a2f3babfc7af670d078a6f0dd (diff) | |
download | dexon-sol-tools-9ff4cacf0f9122c035537632d68169d7c2d5763f.tar dexon-sol-tools-9ff4cacf0f9122c035537632d68169d7c2d5763f.tar.gz dexon-sol-tools-9ff4cacf0f9122c035537632d68169d7c2d5763f.tar.bz2 dexon-sol-tools-9ff4cacf0f9122c035537632d68169d7c2d5763f.tar.lz dexon-sol-tools-9ff4cacf0f9122c035537632d68169d7c2d5763f.tar.xz dexon-sol-tools-9ff4cacf0f9122c035537632d68169d7c2d5763f.tar.zst dexon-sol-tools-9ff4cacf0f9122c035537632d68169d7c2d5763f.zip |
Addressed review comments
Diffstat (limited to 'packages/testnet-faucets/src/ts/handler.ts')
-rw-r--r-- | packages/testnet-faucets/src/ts/handler.ts | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index ce7a81eba..ad05a13f5 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -96,26 +96,19 @@ export class Handler { private _dispenseAsset(req: express.Request, res: express.Response, requestedAssetType: RequestedAssetType) { const networkId = req.params.networkId; const recipient = req.params.recipient; - const networkConfig = _.get(this._networkConfigByNetworkId, networkId); - if (_.isUndefined(networkConfig)) { - res.status(400).send('UNSUPPORTED_NETWORK_ID'); - return; - } + const networkConfig = this._networkConfigByNetworkId[networkId]; let dispenserTask; switch (requestedAssetType) { case RequestedAssetType.ETH: dispenserTask = dispenseAssetTasks.dispenseEtherTask(recipient, networkConfig.web3); break; case RequestedAssetType.WETH: - dispenserTask = dispenseAssetTasks.dispenseTokenTask(recipient, requestedAssetType, networkConfig.zeroEx); - break; case RequestedAssetType.ZRX: dispenserTask = dispenseAssetTasks.dispenseTokenTask(recipient, requestedAssetType, networkConfig.zeroEx); break; default: throw new Error(`Unsupported asset type: ${requestedAssetType}`); } - const didAddToQueue = networkConfig.dispatchQueue.add(dispenserTask); if (!didAddToQueue) { res.status(503).send('QUEUE_IS_FULL'); |