Simplify @polkadot/keyring KeyringPair (#419)

* Simplify @polkadot/keyring KeyringPair

* Fix keypair.address not taking prefix changes into account

* Merge master, update CHANGELOG

* Use getter for keypair.publicKey

* Fix import

* Fix isLocked; add test
This commit is contained in:
Axel Chalon
2019-06-13 07:56:24 +02:00
committed by Jaco Greeff
parent fc27388089
commit 3c253ec2c4
15 changed files with 75 additions and 46 deletions
@@ -13,7 +13,7 @@ async function main () {
const pairAlice = keyring.addFromSeed(stringToU8a(ALICE_SEED));
console.log(`Created keyring pair for Alice with address: ` +
`${keyring.getPair(pairAlice.address()).address()}`);
`${keyring.getPair(pairAlice.address).address}`);
}
main().catch(console.error).finally(_ => process.exit());
@@ -21,7 +21,7 @@ async function main () {
keyring
.getPairs()
.forEach((pair, index) => {
const address = pair.address();
const { address } = pair;
console.log(`\nAccount with index #${index} has json: `,
JSON.stringify(keyring.toJson(address), null, 2));