Introduce key suri (path derivation) (#358)

* Introduce key suri (path derivation)

* Errant console.log

* let -> const

* Add seed derivation from path

* Allow new-generation derivation

* Add addFromUri to keyring

* Use addFromUri in testing keyring

* Add suri tests

* Prepare for sr25519 derivation

* CHANGELOG entry

* ed25519 is aligned with substrate

* Bump version
This commit is contained in:
Jaco Greeff
2019-03-13 14:39:10 +01:00
committed by GitHub
parent a1e56cfb81
commit f1ca4eef0e
37 changed files with 564 additions and 120 deletions
+3 -4
View File
@@ -11,16 +11,15 @@ type TestKeyringMap = {
[index: string]: KeyringPair
};
export default function testKeyringPairs (options?: KeyringOptions): TestKeyringMap {
const keyring = createKeyring(options);
export default function testKeyringPairs (options?: KeyringOptions, isHdKd: boolean = false): TestKeyringMap {
const keyring = createKeyring(options, isHdKd);
const pairs = keyring.getPairs();
return pairs.reduce((result, pair) => {
const { name } = pair.getMeta();
// @ts-ignore dunno what the complaint here is about...
result[name as string] = pair;
return result;
}, { 'nobody': nobody() });
}, { 'nobody': nobody() } as TestKeyringMap);
}