aboutsummaryrefslogtreecommitdiffstats
path: root/packages/kovan-faucets/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-01-05 01:56:30 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-10 18:24:31 +0800
commit27d9fba785a5a53550be53b12baf9069bda8d160 (patch)
treebde34d668e53832dd03dd279992721d56291124b /packages/kovan-faucets/src
parente6a783aff803c276392efec93571d24fc96feb6e (diff)
downloaddexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar.gz
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar.bz2
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar.lz
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar.xz
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar.zst
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.zip
Include web3 types via typeRoots and factor out common parts of tsconfig.json
Diffstat (limited to 'packages/kovan-faucets/src')
-rw-r--r--packages/kovan-faucets/src/ts/configs.ts2
-rw-r--r--packages/kovan-faucets/src/ts/id_management.ts4
-rw-r--r--packages/kovan-faucets/src/ts/request_queue.ts4
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);