aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders/src
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-06-18 19:50:35 +0800
committerGitHub <noreply@github.com>2018-06-18 19:50:35 +0800
commit190eafc30e2e444ed15b76217a6162ec04b33f73 (patch)
treeb20cbad73ff7a069dc0f0ef43ebc0373c714ad02 /packages/subproviders/src
parentd4ee0e862297c16f8ee62efccd31f1193052c64e (diff)
parent0c238448fda99c4d7997901d0fe4d72cb06b79cc (diff)
downloaddexon-sol-tools-190eafc30e2e444ed15b76217a6162ec04b33f73.tar
dexon-sol-tools-190eafc30e2e444ed15b76217a6162ec04b33f73.tar.gz
dexon-sol-tools-190eafc30e2e444ed15b76217a6162ec04b33f73.tar.bz2
dexon-sol-tools-190eafc30e2e444ed15b76217a6162ec04b33f73.tar.lz
dexon-sol-tools-190eafc30e2e444ed15b76217a6162ec04b33f73.tar.xz
dexon-sol-tools-190eafc30e2e444ed15b76217a6162ec04b33f73.tar.zst
dexon-sol-tools-190eafc30e2e444ed15b76217a6162ec04b33f73.zip
Merge branch 'v2-prototype' into bug/contracts/eip712-191-prefix
Diffstat (limited to 'packages/subproviders/src')
-rw-r--r--packages/subproviders/src/subproviders/base_wallet_subprovider.ts2
-rw-r--r--packages/subproviders/src/subproviders/ganache.ts2
-rw-r--r--packages/subproviders/src/subproviders/injected_web3.ts1
-rw-r--r--packages/subproviders/src/subproviders/ledger.ts3
-rw-r--r--packages/subproviders/src/subproviders/mnemonic_wallet.ts1
-rw-r--r--packages/subproviders/src/subproviders/nonce_tracker.ts2
-rw-r--r--packages/subproviders/src/subproviders/subprovider.ts7
-rw-r--r--packages/subproviders/src/types.ts1
-rw-r--r--packages/subproviders/src/utils/wallet_utils.ts3
9 files changed, 8 insertions, 14 deletions
diff --git a/packages/subproviders/src/subproviders/base_wallet_subprovider.ts b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts
index c4b344e3b..4342e47e9 100644
--- a/packages/subproviders/src/subproviders/base_wallet_subprovider.ts
+++ b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts
@@ -3,7 +3,7 @@ import { addressUtils } from '@0xproject/utils';
import { JSONRPCRequestPayload, JSONRPCResponsePayload } from 'ethereum-types';
import * as _ from 'lodash';
-import { Callback, ErrorCallback, PartialTxParams, ResponseWithTxParams, WalletSubproviderErrors } from '../types';
+import { Callback, ErrorCallback, PartialTxParams, WalletSubproviderErrors } from '../types';
import { Subprovider } from './subprovider';
diff --git a/packages/subproviders/src/subproviders/ganache.ts b/packages/subproviders/src/subproviders/ganache.ts
index 73d0513cc..61b6bb5e9 100644
--- a/packages/subproviders/src/subproviders/ganache.ts
+++ b/packages/subproviders/src/subproviders/ganache.ts
@@ -28,7 +28,7 @@ export class GanacheSubprovider extends Subprovider {
* @param end Callback to call if subprovider handled the request and wants to pass back the request.
*/
// tslint:disable-next-line:prefer-function-over-method async-suffix
- public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback): Promise<void> {
+ public async handleRequest(payload: JSONRPCRequestPayload, _next: Callback, end: ErrorCallback): Promise<void> {
this._ganacheProvider.sendAsync(payload, (err: Error | null, result: any) => {
end(err, result && result.result);
});
diff --git a/packages/subproviders/src/subproviders/injected_web3.ts b/packages/subproviders/src/subproviders/injected_web3.ts
index 165c66d62..2691dec53 100644
--- a/packages/subproviders/src/subproviders/injected_web3.ts
+++ b/packages/subproviders/src/subproviders/injected_web3.ts
@@ -1,5 +1,4 @@
import { JSONRPCRequestPayload, Provider } from 'ethereum-types';
-import * as _ from 'lodash';
import * as Web3 from 'web3';
import { Callback, ErrorCallback } from '../types';
diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts
index 467299db0..8345be33c 100644
--- a/packages/subproviders/src/subproviders/ledger.ts
+++ b/packages/subproviders/src/subproviders/ledger.ts
@@ -7,14 +7,12 @@ import * as _ from 'lodash';
import { Lock } from 'semaphore-async-await';
import {
- Callback,
DerivedHDKeyInfo,
LedgerEthereumClient,
LedgerEthereumClientFactoryAsync,
LedgerSubproviderConfigs,
LedgerSubproviderErrors,
PartialTxParams,
- ResponseWithTxParams,
WalletSubproviderErrors,
} from '../types';
import { walletUtils } from '../utils/wallet_utils';
@@ -33,6 +31,7 @@ const DEFAULT_ADDRESS_SEARCH_LIMIT = 1000;
* re-routes them to a Ledger device plugged into the users computer.
*/
export class LedgerSubprovider extends BaseWalletSubprovider {
+ // tslint:disable-next-line:no-unused-variable
private _nonceLock = new Lock();
private _connectionLock = new Lock();
private _networkId: number;
diff --git a/packages/subproviders/src/subproviders/mnemonic_wallet.ts b/packages/subproviders/src/subproviders/mnemonic_wallet.ts
index f29864a74..596300425 100644
--- a/packages/subproviders/src/subproviders/mnemonic_wallet.ts
+++ b/packages/subproviders/src/subproviders/mnemonic_wallet.ts
@@ -1,7 +1,6 @@
import { assert } from '@0xproject/assert';
import { addressUtils } from '@0xproject/utils';
import * as bip39 from 'bip39';
-import ethUtil = require('ethereumjs-util');
import HDNode = require('hdkey');
import * as _ from 'lodash';
diff --git a/packages/subproviders/src/subproviders/nonce_tracker.ts b/packages/subproviders/src/subproviders/nonce_tracker.ts
index 98773e79c..dcc421574 100644
--- a/packages/subproviders/src/subproviders/nonce_tracker.ts
+++ b/packages/subproviders/src/subproviders/nonce_tracker.ts
@@ -75,7 +75,7 @@ export class NonceTrackerSubprovider extends Subprovider {
return next();
}
case 'eth_sendRawTransaction':
- return next((sendTransactionError: Error | null, txResult: any, cb: Callback) => {
+ return next((sendTransactionError: Error | null, _txResult: any, cb: Callback) => {
if (_.isNull(sendTransactionError)) {
this._handleSuccessfulTransaction(payload);
} else {
diff --git a/packages/subproviders/src/subproviders/subprovider.ts b/packages/subproviders/src/subproviders/subprovider.ts
index f9491707e..ff8378c4e 100644
--- a/packages/subproviders/src/subproviders/subprovider.ts
+++ b/packages/subproviders/src/subproviders/subprovider.ts
@@ -1,6 +1,5 @@
import { promisify } from '@0xproject/utils';
-import { JSONRPCRequestPayload, JSONRPCResponsePayload } from 'ethereum-types';
-import * as Web3 from 'web3';
+import { JSONRPCRequestPayload, JSONRPCResponsePayload, Provider } from 'ethereum-types';
import { Callback, ErrorCallback, JSONRPCRequestPayloadWithMethod } from '../types';
/**
@@ -9,7 +8,7 @@ import { Callback, ErrorCallback, JSONRPCRequestPayloadWithMethod } from '../typ
*/
export abstract class Subprovider {
// tslint:disable-next-line:underscore-private-and-protected
- private engine: any;
+ private engine!: Provider;
// Ported from: https://github.com/MetaMask/provider-engine/blob/master/util/random-id.js
private static _getRandomId(): number {
const extraDigits = 3;
@@ -57,7 +56,7 @@ export abstract class Subprovider {
* This is only called within the ProviderEngine source code, do not call
* directly.
*/
- public setEngine(engine: any): void {
+ public setEngine(engine: Provider): void {
this.engine = engine;
}
}
diff --git a/packages/subproviders/src/types.ts b/packages/subproviders/src/types.ts
index 7a8413305..fe58bffa5 100644
--- a/packages/subproviders/src/types.ts
+++ b/packages/subproviders/src/types.ts
@@ -1,7 +1,6 @@
import { ECSignature } from '@0xproject/types';
import { JSONRPCRequestPayload } from 'ethereum-types';
import HDNode = require('hdkey');
-import * as _ from 'lodash';
export interface LedgerCommunicationClient {
close: () => Promise<void>;
diff --git a/packages/subproviders/src/utils/wallet_utils.ts b/packages/subproviders/src/utils/wallet_utils.ts
index c36fdb9fc..3748077ef 100644
--- a/packages/subproviders/src/utils/wallet_utils.ts
+++ b/packages/subproviders/src/utils/wallet_utils.ts
@@ -1,8 +1,7 @@
import ethUtil = require('ethereumjs-util');
import HDNode = require('hdkey');
-import * as _ from 'lodash';
-import { DerivedHDKeyInfo, WalletSubproviderErrors } from '../types';
+import { DerivedHDKeyInfo } from '../types';
const DEFAULT_ADDRESS_SEARCH_LIMIT = 1000;