diff options
author | Jacob Evans <jacob@dekz.net> | 2018-03-08 04:20:06 +0800 |
---|---|---|
committer | Jacob Evans <jacob@dekz.net> | 2018-03-08 04:20:06 +0800 |
commit | 1a6c2e2baca33ce377b86f30abe0c16619a3577c (patch) | |
tree | fe09f231189e018fb6eab4966101d886117650e9 /packages/subproviders | |
parent | e2e6ae937d2d38210442f493c24d492e3b477907 (diff) | |
download | dexon-sol-tools-1a6c2e2baca33ce377b86f30abe0c16619a3577c.tar dexon-sol-tools-1a6c2e2baca33ce377b86f30abe0c16619a3577c.tar.gz dexon-sol-tools-1a6c2e2baca33ce377b86f30abe0c16619a3577c.tar.bz2 dexon-sol-tools-1a6c2e2baca33ce377b86f30abe0c16619a3577c.tar.lz dexon-sol-tools-1a6c2e2baca33ce377b86f30abe0c16619a3577c.tar.xz dexon-sol-tools-1a6c2e2baca33ce377b86f30abe0c16619a3577c.tar.zst dexon-sol-tools-1a6c2e2baca33ce377b86f30abe0c16619a3577c.zip |
Feedback
Diffstat (limited to 'packages/subproviders')
-rw-r--r-- | packages/subproviders/CHANGELOG.md | 4 | ||||
-rw-r--r-- | packages/subproviders/README.md | 4 | ||||
-rw-r--r-- | packages/subproviders/src/globals.d.ts | 4 | ||||
-rw-r--r-- | 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<LedgerTransport>; public close(): Promise<void>; } } declare module '@ledgerhq/hw-transport-node-hid' { - export default class TransportNodeHid { + export default class TransportNodeHid implements LedgerTransport { public static create(): Promise<LedgerTransport>; public close(): Promise<void>; } 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<LedgerEthereumC return ledgerEthClient; } -const DEFAULT_DERIVATION_PATH = `m/44'/60'/0'/0`; +const TESTRPC_DERIVATION_PATH = `m/44'/60'/0'/0`; const TEST_RPC_ACCOUNT_0 = '0x5409ed021d9299bf6814279a6a1411a7e866a631'; describe('LedgerSubprovider', () => { @@ -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); }); |