From 1a6c2e2baca33ce377b86f30abe0c16619a3577c Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Wed, 7 Mar 2018 15:20:06 -0500 Subject: Feedback --- packages/subproviders/CHANGELOG.md | 4 ++-- packages/subproviders/README.md | 4 ++-- packages/subproviders/src/globals.d.ts | 4 ++-- packages/subproviders/test/integration/ledger_subprovider_test.ts | 7 ++++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/subproviders/CHANGELOG.md b/packages/subproviders/CHANGELOG.md index b7247748e..8e7321d4a 100644 --- a/packages/subproviders/CHANGELOG.md +++ b/packages/subproviders/CHANGELOG.md @@ -1,8 +1,8 @@ # CHANGELOG -## v0.7.0 - _March 6, 2018_ +## v0.7.0 - _TBD_ - * Updated legerco packages. Removed node-hid packages as a dependency. (#437) + * Updated legerco packages. Removed node-hid package as a dependency and make it an optional dependency. It is still used in integration tests but is causing problems for users on Linux distros. (#437) ## v0.6.0 - _March 4, 2018_ diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md index f3e3bd0ae..53fbb2348 100644 --- a/packages/subproviders/README.md +++ b/packages/subproviders/README.md @@ -67,8 +67,8 @@ ledgerSubprovider = new LedgerSubprovider({ ##### Testing Subprovider + Ledger integration To run our integration tests you need a ledger configured with our development mnemonic seed. -This is available in the top level package.json under `mnemonic`. -Configure your ledger and run the integration tests. We assume a derivation path of `m/44'/60'/0'/0` and this is configured in the tests. To this setup and derivation path, your first account should be `0x5409ed021d9299bf6814279a6a1411a7e866a631`, exactly like TestRPC. +Our development mnemonic is `concert load couple harbor equip island argue ramp clarify fence smart topic`. +Configure your ledger and run the integration tests. We assume a derivation path of `m/44'/60'/0'/0` and this is configured in the tests. With this setup and derivation path, your first account should be `0x5409ed021d9299bf6814279a6a1411a7e866a631`, exactly like TestRPC. #### Redundant RPC subprovider diff --git a/packages/subproviders/src/globals.d.ts b/packages/subproviders/src/globals.d.ts index e258ef947..d59ee9e67 100644 --- a/packages/subproviders/src/globals.d.ts +++ b/packages/subproviders/src/globals.d.ts @@ -54,14 +54,14 @@ declare module '@ledgerhq/hw-app-eth' { } declare module '@ledgerhq/hw-transport-u2f' { - export default class TransportU2F { + export default class TransportU2F implements LedgerTransport { public static create(): Promise; public close(): Promise; } } declare module '@ledgerhq/hw-transport-node-hid' { - export default class TransportNodeHid { + export default class TransportNodeHid implements LedgerTransport { public static create(): Promise; public close(): Promise; } diff --git a/packages/subproviders/test/integration/ledger_subprovider_test.ts b/packages/subproviders/test/integration/ledger_subprovider_test.ts index 8ed69edaf..a94cfbe3a 100644 --- a/packages/subproviders/test/integration/ledger_subprovider_test.ts +++ b/packages/subproviders/test/integration/ledger_subprovider_test.ts @@ -1,4 +1,5 @@ import Eth from '@ledgerhq/hw-app-eth'; +// HACK: This depdency is optional and tslint skips optional depdencies // tslint:disable-next-line:no-implicit-dependencies import TransportNodeHid from '@ledgerhq/hw-transport-node-hid'; import * as chai from 'chai'; @@ -23,7 +24,7 @@ async function ledgerEthereumNodeJsClientFactoryAsync(): Promise { @@ -33,7 +34,7 @@ describe('LedgerSubprovider', () => { ledgerSubprovider = new LedgerSubprovider({ networkId, ledgerEthereumClientFactoryAsync: ledgerEthereumNodeJsClientFactoryAsync, - derivationPath: DEFAULT_DERIVATION_PATH, + derivationPath: TESTRPC_DERIVATION_PATH, }); }); describe('direct method calls', () => { @@ -42,7 +43,7 @@ describe('LedgerSubprovider', () => { expect(accounts[0]).to.not.be.an('undefined'); expect(accounts.length).to.be.equal(10); }); - it('returns the expected account', async () => { + it('returns the expected first account from a ledger set up with the test mnemonic', async () => { const accounts = await ledgerSubprovider.getAccountsAsync(); expect(accounts[0]).to.be.equal(TEST_RPC_ACCOUNT_0); }); -- cgit v1.2.3