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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user