diff options
Diffstat (limited to 'packages/testnet-faucets/src/ts/dispense_asset_tasks.ts')
-rw-r--r-- | packages/testnet-faucets/src/ts/dispense_asset_tasks.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts b/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts index 99f1bad36..39ba4bc14 100644 --- a/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts +++ b/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts @@ -11,8 +11,10 @@ const DISPENSE_AMOUNT_TOKEN = 0.1; const DISPENSE_MAX_AMOUNT_TOKEN = 2; const DISPENSE_MAX_AMOUNT_ETHER = 2; +type AsyncTask = () => Promise<void>; + export const dispenseAssetTasks = { - dispenseEtherTask(recipientAddress: string, web3: Web3) { + dispenseEtherTask(recipientAddress: string, web3: Web3): AsyncTask { return async () => { logUtils.log(`Processing ETH ${recipientAddress}`); const userBalance = await promisify<BigNumber>(web3.eth.getBalance)(recipientAddress); @@ -32,7 +34,7 @@ export const dispenseAssetTasks = { logUtils.log(`Sent ${DISPENSE_AMOUNT_ETHER} ETH to ${recipientAddress} tx: ${txHash}`); }; }, - dispenseTokenTask(recipientAddress: string, tokenSymbol: string, zeroEx: ZeroEx) { + dispenseTokenTask(recipientAddress: string, tokenSymbol: string, zeroEx: ZeroEx): AsyncTask { return async () => { logUtils.log(`Processing ${tokenSymbol} ${recipientAddress}`); const amountToDispense = new BigNumber(DISPENSE_AMOUNT_TOKEN); |