aboutsummaryrefslogtreecommitdiffstats
path: root/packages/testnet-faucets/src/ts/handler.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/testnet-faucets/src/ts/handler.ts')
-rw-r--r--packages/testnet-faucets/src/ts/handler.ts9
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');