aboutsummaryrefslogtreecommitdiffstats
path: root/packages/testnet-faucets
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-04-05 13:25:26 +0800
committerJacob Evans <jacob@dekz.net>2018-04-05 13:33:04 +0800
commitea47613d901cb0e8d9543f37d7f591c91ef986c4 (patch)
treea92ea829f259f078558d927e47b71d185552f0eb /packages/testnet-faucets
parent9d18f751c8822910391e55c29fc2b1912a1ee108 (diff)
downloaddexon-sol-tools-ea47613d901cb0e8d9543f37d7f591c91ef986c4.tar
dexon-sol-tools-ea47613d901cb0e8d9543f37d7f591c91ef986c4.tar.gz
dexon-sol-tools-ea47613d901cb0e8d9543f37d7f591c91ef986c4.tar.bz2
dexon-sol-tools-ea47613d901cb0e8d9543f37d7f591c91ef986c4.tar.lz
dexon-sol-tools-ea47613d901cb0e8d9543f37d7f591c91ef986c4.tar.xz
dexon-sol-tools-ea47613d901cb0e8d9543f37d7f591c91ef986c4.tar.zst
dexon-sol-tools-ea47613d901cb0e8d9543f37d7f591c91ef986c4.zip
Use PKWalletSubprovider in testnet faucet
Diffstat (limited to 'packages/testnet-faucets')
-rw-r--r--packages/testnet-faucets/src/ts/handler.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts
index f9ac484de..9c8e59248 100644
--- a/packages/testnet-faucets/src/ts/handler.ts
+++ b/packages/testnet-faucets/src/ts/handler.ts
@@ -9,7 +9,7 @@ import * as Web3 from 'web3';
// we are not running in a browser env.
// Filed issue: https://github.com/ethereum/web3.js/issues/844
(global as any).XMLHttpRequest = undefined;
-import { NonceTrackerSubprovider } from '@0xproject/subproviders';
+import { NonceTrackerSubprovider, PKWalletSubprovider } from '@0xproject/subproviders';
import ProviderEngine = require('web3-provider-engine');
import HookedWalletSubprovider = require('web3-provider-engine/subproviders/hooked-wallet');
import RpcSubprovider = require('web3-provider-engine/subproviders/rpc');
@@ -41,9 +41,12 @@ const FIVE_DAYS_IN_MS = 4.32e8; // TODO: make this configurable
export class Handler {
private _networkConfigByNetworkId: ItemByNetworkId<NetworkConfig> = {};
private static _createProviderEngine(rpcUrl: string) {
+ if (_.isUndefined(configs.DISPENSER_PRIVATE_KEY)) {
+ throw new Error('Dispenser Private key not found');
+ }
const engine = new ProviderEngine();
engine.addProvider(new NonceTrackerSubprovider());
- engine.addProvider(new HookedWalletSubprovider(idManagement));
+ engine.addProvider(new PKWalletSubprovider(configs.DISPENSER_PRIVATE_KEY));
engine.addProvider(
new RpcSubprovider({
rpcUrl,