Schnorrkel support (#297)

* Initial schnorrkel support

* Start conversion of actual keyring

* Wrap encoding/decoding (needs another check)

* Manage encoding version & types with passthrough

* Update to version with working sign

* Cleanup pair interface (with seed)

* Fix failing tests

* Align naclSign signature

* Update tests for nacl (with TS conversion)

* Bump version with CHANGELOG

* Remove unneeded dep

* Use KeyringOptions instead of PairType

* Do isNumber check on addressPrefix
This commit is contained in:
Jaco Greeff
2019-02-13 16:46:33 +01:00
committed by GitHub
parent 0f53f0ebf0
commit 2aba82e569
60 changed files with 693 additions and 293 deletions
+3 -18
View File
@@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { KeyringInstance } from './types';
import { KeyringInstance, KeyringOptions } from './types';
import { stringToU8a } from '@polkadot/util/index';
@@ -38,24 +38,9 @@ const SEEDS: { [index: string ]: Uint8Array } = {
* @summary Create an instance of Keyring pre-populated with locked test accounts
* @description The test accounts (i.e. alice, bob, dave, eve, ferdie)
* are available on the dev chain and each test account is initialised with DOT funds.
* @example
* <BR>
*
* ```javascript
* import testKeyring from '@polkadot/keyring/testing';
*
* // Create an instance of Keyring that includes test accounts
* const keyring = testingPairs();
*
* // Retrieve the address of one of the test accounts
* const addressAlice = keyring.alice.address();
*
* // Retrieve the public key of one of the test accounts
* const publicKeyAlice = keyring.alice.publicKey();
* ```
*/
export default function testKeyring (): KeyringInstance {
const keyring = new Keyring();
export default function testKeyring (options: KeyringOptions): KeyringInstance {
const keyring = new Keyring(options);
Object
.keys(SEEDS)