Expand keyring tests for sr25519 (#302)
* Expand keyring tests for sr25519 * Update index.spec.ts * Update index.spec.ts * Support type conversion, type per pair * toType tests
This commit is contained in:
@@ -2,12 +2,14 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { PairInfo } from './types';
|
||||
|
||||
import { stringToU8a, u8aConcat, u8aFixLength, assert } from '@polkadot/util/index';
|
||||
import { naclEncrypt } from '@polkadot/util-crypto/index';
|
||||
|
||||
import { PKCS8_DIVIDER, PKCS8_HEADER } from './defaults';
|
||||
|
||||
export default function encode (publicKey: Uint8Array, seed?: Uint8Array | null, passphrase?: string): Uint8Array {
|
||||
export default function encode ({ publicKey, seed }: PairInfo, passphrase?: string): Uint8Array {
|
||||
assert(seed, 'Expected a valid seed to be passed to encode');
|
||||
|
||||
const encoded = u8aConcat(
|
||||
|
||||
Reference in New Issue
Block a user