diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-09 01:23:44 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-12-09 01:23:44 +0800 |
commit | d5757499bc0f828fbf86ffea2da8ad3941f1c33e (patch) | |
tree | 6f429e6f2b3050de6dd7ce16e42c7f387bd5018a /packages/subproviders | |
parent | 139c8c2e783ffbbf22473604419fe3e5b299be0e (diff) | |
parent | af8d24d0eb5af781f4731b5559979f2b02579785 (diff) | |
download | dexon-sol-tools-d5757499bc0f828fbf86ffea2da8ad3941f1c33e.tar dexon-sol-tools-d5757499bc0f828fbf86ffea2da8ad3941f1c33e.tar.gz dexon-sol-tools-d5757499bc0f828fbf86ffea2da8ad3941f1c33e.tar.bz2 dexon-sol-tools-d5757499bc0f828fbf86ffea2da8ad3941f1c33e.tar.lz dexon-sol-tools-d5757499bc0f828fbf86ffea2da8ad3941f1c33e.tar.xz dexon-sol-tools-d5757499bc0f828fbf86ffea2da8ad3941f1c33e.tar.zst dexon-sol-tools-d5757499bc0f828fbf86ffea2da8ad3941f1c33e.zip |
Merge branch 'feature/addSubproviders' into feature/portal-ledger-support
* feature/addSubproviders:
remove console.log
Update README.md
Fix unit test
Add missing params
Debug CircleCi failure
Update yarn.lock
Inline network module
Add todo
Stop supporting different file extensions in abi-gen
Refactor networkId out of web3Wrapper
Update connect types in preperation for publishing
Add link to random id generator
Remove `prebuild` command and add `test:circleci`
Fix CI command
Address feedback
Refactor web3Wrapper to a separate package
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(); }); |