@polkadot/keyring
Advanced tools
Comparing version 0.38.0-beta.3 to 0.38.0-beta.4
{ | ||
"name": "@polkadot/keyring", | ||
"version": "0.38.0-beta.3", | ||
"version": "0.38.0-beta.4", | ||
"description": "Keyring management", | ||
@@ -34,4 +34,4 @@ "main": "index.js", | ||
"@babel/runtime": "^7.3.4", | ||
"@polkadot/util": "^0.38.0-beta.3", | ||
"@polkadot/util-crypto": "^0.38.0-beta.3", | ||
"@polkadot/util": "^0.38.0-beta.4", | ||
"@polkadot/util-crypto": "^0.38.0-beta.4", | ||
"@types/bs58": "^4.0.0", | ||
@@ -38,0 +38,0 @@ "bs58": "^4.0.1" |
@@ -10,2 +10,6 @@ "use strict"; | ||
var _util = require("@polkadot/util"); | ||
var _pair = _interopRequireDefault(require("./pair")); | ||
var _ = _interopRequireDefault(require(".")); | ||
@@ -19,4 +23,8 @@ | ||
// created from the above | ||
const DEV_SEED = '0xfac7959dbfe72f052e5a0c3c8d6530f202b02fd8f9f5ca3580ec8deb7797479e'; | ||
const SEEDS = ['Alice', 'Bob', 'Charlie', 'Dave', 'Eve', 'Ferdie']; | ||
// const DEV_SEED = '0xfac7959dbfe72f052e5a0c3c8d6530f202b02fd8f9f5ca3580ec8deb7797479e'; | ||
const SEEDS = ['Alice', 'Bob', 'Charlie', 'Dave', 'Eve', 'Ferdie']; // NOTE This is not great, but a testing keyring is for testing - what happens is that in most cases | ||
// the keyring is initialises before anythign else. Since the sr25519 crypto is async, this creates | ||
// problems with adding the keys | ||
const PAIRS = [[(0, _util.hexToU8a)('0x98319d4ff8a9508c4bb0cf0b5a78d760a0b2082c02775e6e82370816fedfff48925a225d97aa00682d6a59b95b18780c10d7032336e88f3442b42361f4a66011'), (0, _util.hexToU8a)('0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d')], [(0, _util.hexToU8a)('0x081ff694633e255136bdb456c20a5fc8fed21f8b964c11bb17ff534ce80ebd5941ae88f85d0c1bfc37be41c904e1dfc01de8c8067b0d6d5df25dd1ac0894a325'), (0, _util.hexToU8a)('0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48')], [(0, _util.hexToU8a)('0xa8f2d83016052e5d6d77b2f6fd5d59418922a09024cda701b3c34369ec43a7668faf12ff39cd4e5d92bb773972f41a7a5279ebc2ed92264bed8f47d344f8f18c'), (0, _util.hexToU8a)('0x90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22')], [(0, _util.hexToU8a)('0x20e05482ca4677e0edbc58ae9a3a59f6ed3b1a9484ba17e64d6fe8688b2b7b5d108c4487b9323b98b11fe36cb301b084e920f7b7895536809a6d62a451b25568'), (0, _util.hexToU8a)('0x306721211d5404bd9da88e0204360a1a9ab8b87c66c1bc2fcdd37f3c2222cc20')], [(0, _util.hexToU8a)('0x683576abfd5dc35273e4264c23095a1bf21c14517bece57c7f0cc5c0ed4ce06a3dbf386b7828f348abe15d76973a72009e6ef86a5c91db2990cb36bb657c6587'), (0, _util.hexToU8a)('0xe659a7a1628cdd93febc04a4e0646ea20e9f5f0ce097d9a05290d4a9e054df4e')], [(0, _util.hexToU8a)('0xb835c20f450079cf4f513900ae9faf8df06ad86c681884122c752a4b2bf74d4303e4f21bc6cc62bb4eeed5a9cce642c25e2d2ac1464093b50f6196d78e3a7426'), (0, _util.hexToU8a)('0x1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c')]]; | ||
/** | ||
@@ -34,8 +42,11 @@ * @name testKeyring | ||
const keyring = new _.default(options); | ||
SEEDS.forEach(entry => { | ||
const phrase = isDerived ? `${DEV_SEED}//${entry}` : entry; | ||
const pair = keyring.addFromUri(phrase, { | ||
SEEDS.forEach((entry, index) => { | ||
const meta = { | ||
isTesting: true, | ||
name: entry.toLowerCase() | ||
}, isDerived ? 'sr25519' : options.type); | ||
}; | ||
const pair = !isDerived ? keyring.addFromUri(entry, meta, options.type) : keyring.addPair((0, _pair.default)('sr25519', { | ||
publicKey: PAIRS[index][1], | ||
secretKey: PAIRS[index][0] | ||
}, meta)); | ||
@@ -42,0 +53,0 @@ pair.lock = () => {// we don't have lock/unlock functionality here |
79445
1358