Add keyring default to ed25519 (#314)
This commit is contained in:
@@ -31,7 +31,7 @@ export default class Keyring implements KeyringInstance {
|
||||
private _pairs: Pairs;
|
||||
private _type: KeyringPairType;
|
||||
|
||||
constructor (options: KeyringOptions) {
|
||||
constructor (options: KeyringOptions = { type: 'ed25519' }) {
|
||||
assert(options && ['ed25519', 'sr25519'].includes(options.type || 'undefined'), `Expected a keyring type of either 'ed25519' or 'sr25519', found '${options.type}`);
|
||||
|
||||
this._pairs = new Pairs();
|
||||
|
||||
@@ -38,7 +38,7 @@ const SEEDS: { [index: string ]: Uint8Array } = {
|
||||
* @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.
|
||||
*/
|
||||
export default function testKeyring (options: KeyringOptions): KeyringInstance {
|
||||
export default function testKeyring (options?: KeyringOptions): KeyringInstance {
|
||||
const keyring = new Keyring(options);
|
||||
|
||||
Object
|
||||
|
||||
@@ -11,7 +11,7 @@ type TestKeyringMap = {
|
||||
[index: string]: KeyringPair
|
||||
};
|
||||
|
||||
export default function testKeyringPairs (options: KeyringOptions): TestKeyringMap {
|
||||
export default function testKeyringPairs (options?: KeyringOptions): TestKeyringMap {
|
||||
const keyring = createKeyring(options);
|
||||
const pairs = keyring.getPairs();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user