aboutsummaryrefslogtreecommitdiffstats
path: root/packages/testnet-faucets/src
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-02-07 07:36:00 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-02-07 07:36:00 +0800
commit36a49966eb4d5b78192cb5fa76c98755ef092f8b (patch)
tree7100b22aa1c4ac824bd054fefdae53e9df0aab9a /packages/testnet-faucets/src
parentf818d06b43ae9279c4ee022685e3bcb9f27ba2fd (diff)
parent548246c05f128d23d701d9b738ce53deaf783f63 (diff)
downloaddexon-sol-tools-36a49966eb4d5b78192cb5fa76c98755ef092f8b.tar
dexon-sol-tools-36a49966eb4d5b78192cb5fa76c98755ef092f8b.tar.gz
dexon-sol-tools-36a49966eb4d5b78192cb5fa76c98755ef092f8b.tar.bz2
dexon-sol-tools-36a49966eb4d5b78192cb5fa76c98755ef092f8b.tar.lz
dexon-sol-tools-36a49966eb4d5b78192cb5fa76c98755ef092f8b.tar.xz
dexon-sol-tools-36a49966eb4d5b78192cb5fa76c98755ef092f8b.tar.zst
dexon-sol-tools-36a49966eb4d5b78192cb5fa76c98755ef092f8b.zip
Merge branch 'development' into feature/testnet-faucets/order-dispenser
* development: Attribute the origins of NonceTracker Move BlockParamLiteral to shared types package Fixes Move BlockParam and BlockParamLiteral to shared types Rename called to something more readable Newline prettier/lint Yarn.lock Refactor tests for reuse of the fixture subprovider Remove re-fetch of transaction count on error Disable linter for multiple class declarations Remove double declaration Enable CIRCLECI and declare web3 Test faucets to use new NonceTracker Update changelog Readability and prettier Prettify Nonce tracker subprovider Caches the nonce when a request to getTransactionCount is made and increments the pending nonce after successful transactions
Diffstat (limited to 'packages/testnet-faucets/src')
-rw-r--r--packages/testnet-faucets/src/ts/global.d.ts15
-rw-r--r--packages/testnet-faucets/src/ts/handler.ts4
2 files changed, 16 insertions, 3 deletions
diff --git a/packages/testnet-faucets/src/ts/global.d.ts b/packages/testnet-faucets/src/ts/global.d.ts
index 97cd35680..41a2f3a8a 100644
--- a/packages/testnet-faucets/src/ts/global.d.ts
+++ b/packages/testnet-faucets/src/ts/global.d.ts
@@ -1,5 +1,4 @@
declare module 'rollbar';
-declare module 'web3-provider-engine';
declare module 'web3-provider-engine/subproviders/rpc';
declare module 'web3-provider-engine/subproviders/nonce-tracker';
declare module 'web3-provider-engine/subproviders/hooked-wallet';
@@ -24,3 +23,17 @@ declare module 'ethereumjs-tx' {
}
export = EthereumTx;
}
+
+/* tslint:disable */
+declare module 'web3-provider-engine' {
+ class Web3ProviderEngine {
+ public on(event: string, handler: () => void): void;
+ public send(payload: any): void;
+ public sendAsync(payload: any, callback: (error: any, response: any) => void): void;
+ public addProvider(provider: any): void;
+ public start(): void;
+ public stop(): void;
+ }
+ export = Web3ProviderEngine;
+}
+/* tslint:enable */
diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts
index e9ced3437..d96b90802 100644
--- a/packages/testnet-faucets/src/ts/handler.ts
+++ b/packages/testnet-faucets/src/ts/handler.ts
@@ -1,4 +1,5 @@
import { Order, SignedOrder, ZeroEx } from '0x.js';
+import { NonceTrackerSubprovider } from '@0xproject/subproviders';
import { BigNumber } from '@0xproject/utils';
import * as express from 'express';
import * as _ from 'lodash';
@@ -11,7 +12,6 @@ import * as Web3 from 'web3';
(global as any).XMLHttpRequest = undefined;
import ProviderEngine = require('web3-provider-engine');
import HookedWalletSubprovider = require('web3-provider-engine/subproviders/hooked-wallet');
-import NonceSubprovider = require('web3-provider-engine/subproviders/nonce-tracker');
import RpcSubprovider = require('web3-provider-engine/subproviders/rpc');
import { configs } from './configs';
@@ -61,7 +61,7 @@ export class Handler {
}
private static _createProviderEngine(rpcUrl: string) {
const engine = new ProviderEngine();
- engine.addProvider(new NonceSubprovider());
+ engine.addProvider(new NonceTrackerSubprovider());
engine.addProvider(new HookedWalletSubprovider(idManagement));
engine.addProvider(
new RpcSubprovider({