diff options
Diffstat (limited to 'packages/subproviders')
5 files changed, 8 insertions, 3 deletions
diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index 11d116278..c3ecfd2f0 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -5,13 +5,13 @@ "types": "lib/src/index.d.ts", "license": "Apache-2.0", "scripts": { - "prebuild": "npm run clean", "clean": "shx rm -rf lib", "build": "tsc", "lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'", "run_mocha_unit": "mocha lib/test/unit/**/*_test.js --timeout 10000 --bail --exit", "run_mocha_integration": "mocha lib/test/integration/**/*_test.js --timeout 10000 --bail --exit", "test": "npm run test:unit", + "test:circleci": "npm run test:unit", "test:all": "run-s test:unit test:integration", "test:unit": "run-s clean build run_mocha_unit", "test:integration": "run-s clean build run_mocha_integration" diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts index 83c5b6867..e0a08f792 100644 --- a/packages/subproviders/src/subproviders/ledger.ts +++ b/packages/subproviders/src/subproviders/ledger.ts @@ -142,6 +142,7 @@ export class LedgerSubprovider extends Subprovider { public async getAccountsAsync(): Promise<string[]> { this._ledgerClientIfExists = await this.createLedgerClientAsync(); + // TODO: replace with generating addresses without hitting Ledger const accounts = []; for (let i = 0; i < NUM_ADDRESSES_TO_FETCH; i++) { try { diff --git a/packages/subproviders/src/subproviders/redundant_rpc.ts b/packages/subproviders/src/subproviders/redundant_rpc.ts index 6f8d0829b..80462bbfb 100644 --- a/packages/subproviders/src/subproviders/redundant_rpc.ts +++ b/packages/subproviders/src/subproviders/redundant_rpc.ts @@ -1,4 +1,4 @@ -import promisify = require('es6-promisify'); +import {promisify} from '@0xproject/utils'; import * as _ from 'lodash'; import RpcSubprovider = require('web3-provider-engine/subproviders/rpc'); diff --git a/packages/subproviders/src/subproviders/subprovider.ts b/packages/subproviders/src/subproviders/subprovider.ts index 07f4d6353..64d97b958 100644 --- a/packages/subproviders/src/subproviders/subprovider.ts +++ b/packages/subproviders/src/subproviders/subprovider.ts @@ -12,6 +12,7 @@ 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; // 13 time digits diff --git a/packages/subproviders/test/unit/ledger_subprovider_test.ts b/packages/subproviders/test/unit/ledger_subprovider_test.ts index bc9671948..964df5db9 100644 --- a/packages/subproviders/test/unit/ledger_subprovider_test.ts +++ b/packages/subproviders/test/unit/ledger_subprovider_test.ts @@ -134,6 +134,9 @@ describe('LedgerSubprovider', () => { const tx = { to: '0xafa3f8684e54059998bc3a7b0d2b0da075154d66', value: '0x00', + gasPrice: '0x00', + nonce: '0x00', + gas: '0x00', }; const payload = { jsonrpc: '2.0', @@ -143,7 +146,7 @@ describe('LedgerSubprovider', () => { }; const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { expect(err).to.be.a('null'); - expect(response.result.raw.length).to.be.equal(206); + expect(response.result.raw.length).to.be.equal(192); expect(response.result.raw.substr(0, 2)).to.be.equal('0x'); done(); }); |