diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-15 20:58:30 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-15 20:58:30 +0800 |
commit | 126048bac9f52871b841d9898cabe7cfd265ebb6 (patch) | |
tree | bcb2d17aeeaa4a99482bdf8e8a41758f02fd4ee4 /packages/subproviders/src | |
parent | 274aa50d740e4f3af9e3d50468843ed19b555aa3 (diff) | |
download | dexon-0x-contracts-126048bac9f52871b841d9898cabe7cfd265ebb6.tar.gz dexon-0x-contracts-126048bac9f52871b841d9898cabe7cfd265ebb6.tar.zst dexon-0x-contracts-126048bac9f52871b841d9898cabe7cfd265ebb6.zip |
Fix connect unused vars
Diffstat (limited to 'packages/subproviders/src')
-rw-r--r-- | packages/subproviders/src/subproviders/ledger.ts | 15 | ||||
-rw-r--r-- | packages/subproviders/src/subproviders/subprovider.ts | 4 | ||||
-rw-r--r-- | packages/subproviders/src/types.ts | 1 |
3 files changed, 0 insertions, 20 deletions
diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts index 578f6ff6f..9ffc105a4 100644 --- a/packages/subproviders/src/subproviders/ledger.ts +++ b/packages/subproviders/src/subproviders/ledger.ts @@ -1,9 +1,7 @@ import {assert} from '@0xproject/assert'; import {addressUtils} from '@0xproject/utils'; -import promisify = require('es6-promisify'); import EthereumTx = require('ethereumjs-tx'); import ethUtil = require('ethereumjs-util'); -import * as ledger from 'ledgerco'; import * as _ from 'lodash'; import Semaphore from 'semaphore-async-await'; import Web3 = require('web3'); @@ -23,7 +21,6 @@ const DEFAULT_DERIVATION_PATH = `44'/60'/0'`; const NUM_ADDRESSES_TO_FETCH = 10; const ASK_FOR_ON_DEVICE_CONFIRMATION = false; const SHOULD_GET_CHAIN_CODE = false; -const HEX_REGEX = /^[0-9A-Fa-f]+$/g; export class LedgerSubprovider extends Subprovider { private _nonceLock: Semaphore; @@ -34,18 +31,6 @@ export class LedgerSubprovider extends Subprovider { private _ledgerEthereumClientFactoryAsync: LedgerEthereumClientFactoryAsync; private _ledgerClientIfExists?: LedgerEthereumClient; private _shouldAlwaysAskForConfirmation: boolean; - private static isValidHex(data: string) { - if (!_.isString(data)) { - return false; - } - const isHexPrefixed = data.slice(0, 2) === '0x'; - if (!isHexPrefixed) { - return false; - } - const nonPrefixed = data.slice(2); - const isValid = nonPrefixed.match(HEX_REGEX); - return isValid; - } private static validateSender(sender: string) { if (_.isUndefined(sender) || !addressUtils.isAddress(sender)) { throw new Error(LedgerSubproviderErrors.SenderInvalidOrNotSupplied); diff --git a/packages/subproviders/src/subproviders/subprovider.ts b/packages/subproviders/src/subproviders/subprovider.ts index 64d97b958..41dde4238 100644 --- a/packages/subproviders/src/subproviders/subprovider.ts +++ b/packages/subproviders/src/subproviders/subprovider.ts @@ -11,7 +11,6 @@ import { */ export class Subprovider { private engine: any; - private currentBlock: any; // Ported from: https://github.com/MetaMask/provider-engine/blob/master/util/random-id.js private static getRandomId() { const extraDigits = 3; @@ -34,9 +33,6 @@ export class Subprovider { } public setEngine(engine: any): void { this.engine = engine; - engine.on('block', (block: any) => { - this.currentBlock = block; - }); } public async emitPayloadAsync(payload: JSONRPCPayload): Promise<any> { const finalPayload = Subprovider.createFinalPayload(payload); diff --git a/packages/subproviders/src/types.ts b/packages/subproviders/src/types.ts index 38dc1e67e..1e7d3eab0 100644 --- a/packages/subproviders/src/types.ts +++ b/packages/subproviders/src/types.ts @@ -1,5 +1,4 @@ import * as _ from 'lodash'; -import * as Web3 from 'web3'; export interface LedgerCommunicationClient { close_async: () => Promise<void>; |