@polkadot/util-keyring
Advanced tools
Comparing version 0.22.2 to 0.22.3
@@ -27,8 +27,12 @@ "use strict"; | ||
const decoded = bufferToU8a(bs58.decode(encoded)); | ||
assert(decoded[0] === 42, 'Invalid decoded address prefix'); | ||
assert(decoded.length === 32 + 1 + 2, 'Invalid decoded address length'); | ||
const str = encoded; | ||
const decoded = bufferToU8a(bs58.decode(str)); | ||
const error = message => `Decoding ${str}: ${message}`; | ||
assert(decoded[0] === 42, error('Invalid decoded address prefix')); | ||
assert(decoded.length === 32 + 1 + 2, error('Invalid decoded address length')); | ||
const hash = blake2b(decoded.subarray(0, 33), 512); | ||
assert(decoded[33] === hash[0] && decoded[34] === hash[1], 'Invalid decoded address checksum'); | ||
assert(decoded[33] === hash[0] && decoded[34] === hash[1], error(' Invalid decoded address checksum')); | ||
return decoded.slice(1, 33); | ||
}; |
{ | ||
"name": "@polkadot/util-keyring", | ||
"version": "0.22.2", | ||
"version": "0.22.3", | ||
"description": "Keyring management", | ||
@@ -35,6 +35,6 @@ "main": "index.js", | ||
"@babel/runtime": "^7.0.0-beta.47", | ||
"@polkadot/util": "^0.22.2", | ||
"@polkadot/util-crypto": "^0.22.2", | ||
"@polkadot/util": "^0.22.3", | ||
"@polkadot/util-crypto": "^0.22.3", | ||
"bs58": "^4.0.1" | ||
} | ||
} |
@@ -8,2 +8,4 @@ "use strict"; | ||
const everybody = require('./pair/everybody')(); | ||
module.exports = function testKeyringPairs() { | ||
@@ -19,4 +21,5 @@ const keyring = createKeyring(); | ||
}, { | ||
_keyring: keyring | ||
_keyring: keyring, | ||
everybody | ||
}); | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35376
37
339
Updated@polkadot/util@^0.22.3