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:
Jaco Greeff
2019-02-14 22:04:12 +01:00
committed by GitHub
parent 97cee907e4
commit c3fafbeab7
14 changed files with 183 additions and 105 deletions
+2 -2
View File
@@ -4,6 +4,7 @@
import { assert, stringToU8a, u8aFixLength } from '@polkadot/util/index';
import { naclDecrypt } from '@polkadot/util-crypto/index';
import { PairInfo } from './types';
import { KEY_LENGTH, NONCE_LENGTH, PKCS8_DIVIDER, PKCS8_HEADER } from './defaults';
@@ -11,8 +12,7 @@ const SEED_OFFSET = PKCS8_HEADER.length;
const DIV_OFFSET = SEED_OFFSET + KEY_LENGTH;
const PUBLIC_OFFSET = DIV_OFFSET + PKCS8_DIVIDER.length;
type DecodeResult = {
publicKey: Uint8Array,
type DecodeResult = PairInfo & {
seed: Uint8Array
};