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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user