diff options
Diffstat (limited to 'packages/kovan-faucets/src')
-rw-r--r-- | packages/kovan-faucets/src/ts/configs.ts | 2 | ||||
-rw-r--r-- | packages/kovan-faucets/src/ts/id_management.ts | 4 | ||||
-rw-r--r-- | packages/kovan-faucets/src/ts/request_queue.ts | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/packages/kovan-faucets/src/ts/configs.ts b/packages/kovan-faucets/src/ts/configs.ts index 697e7522b..2e5a7f64d 100644 --- a/packages/kovan-faucets/src/ts/configs.ts +++ b/packages/kovan-faucets/src/ts/configs.ts @@ -1,5 +1,5 @@ export const configs = { - DISPENSER_ADDRESS: process.env.DISPENSER_ADDRESS.toLowerCase(), + DISPENSER_ADDRESS: (process.env.DISPENSER_ADDRESS as string).toLowerCase(), DISPENSER_PRIVATE_KEY: process.env.DISPENSER_PRIVATE_KEY, ENVIRONMENT: process.env.FAUCET_ENVIRONMENT, ROLLBAR_ACCESS_KEY: process.env.FAUCET_ROLLBAR_ACCESS_KEY, diff --git a/packages/kovan-faucets/src/ts/id_management.ts b/packages/kovan-faucets/src/ts/id_management.ts index 74865afb8..930821172 100644 --- a/packages/kovan-faucets/src/ts/id_management.ts +++ b/packages/kovan-faucets/src/ts/id_management.ts @@ -3,7 +3,7 @@ import EthereumTx = require('ethereumjs-tx'); import { configs } from './configs'; import { utils } from './utils'; -type Callback = (err: Error, accounts: any) => void; +type Callback = (err: Error | null, accounts: any) => void; export const idManagement = { getAccounts(callback: Callback) { @@ -15,7 +15,7 @@ export const idManagement = { }, signTransaction(txData: object, callback: Callback) { const tx = new EthereumTx(txData); - const privateKeyBuffer = new Buffer(configs.DISPENSER_PRIVATE_KEY, 'hex'); + const privateKeyBuffer = new Buffer(configs.DISPENSER_PRIVATE_KEY as string, 'hex'); tx.sign(privateKeyBuffer); const rawTx = `0x${tx.serialize().toString('hex')}`; callback(null, rawTx); diff --git a/packages/kovan-faucets/src/ts/request_queue.ts b/packages/kovan-faucets/src/ts/request_queue.ts index ea3eee18e..2b42ca4bf 100644 --- a/packages/kovan-faucets/src/ts/request_queue.ts +++ b/packages/kovan-faucets/src/ts/request_queue.ts @@ -38,10 +38,10 @@ export class RequestQueue { } protected start() { this.queueIntervalId = timers.setInterval(() => { - if (this.queue.length === 0) { + const recipientAddress = this.queue.shift(); + if (_.isUndefined(recipientAddress)) { return; } - const recipientAddress = this.queue.shift(); // tslint:disable-next-line:no-floating-promises this.processNextRequestFireAndForgetAsync(recipientAddress); }, this.queueIntervalMs); |