cli: Update for hd wallet change

This commit is contained in:
willclarktech 2021-04-06 17:27:46 +02:00
parent ae0d1a98a7
commit 6ace51decd
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ const mnemonic =
"economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone"; "economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone";
for (let i of [0, 1, 2, 3, 4]) { for (let i of [0, 1, 2, 3, 4]) {
const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic, makeCosmoshubPath(i), "cosmos"); const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic, { hdPath: makeCosmoshubPath(i) });
const [{ address, pubkey }] = await wallet.getAccounts(); const [{ address, pubkey }] = await wallet.getAccounts();
console.info(`Address ${i}: ${address}`); console.info(`Address ${i}: ${address}`);
console.info(`Pubkey ${i}: ${toBase64(pubkey)}`); console.info(`Pubkey ${i}: ${toBase64(pubkey)}`);

View File

@ -111,7 +111,7 @@ export async function main(originalArgs: readonly string[]): Promise<void> {
assert(accounts[0].address == "cosmos1kxt5x5q2l57ma2d434pqpafxdm0mgeg9c8cvtx"); assert(accounts[0].address == "cosmos1kxt5x5q2l57ma2d434pqpafxdm0mgeg9c8cvtx");
const mnemonic = Bip39.encode(Random.getBytes(16)).toString(); const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic, makeCosmoshubPath(0)); const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic, { hdPath: makeCosmoshubPath(0) });
const [{ address }] = await wallet.getAccounts(); const [{ address }] = await wallet.getAccounts();
const data = toAscii("foo bar"); const data = toAscii("foo bar");
const fee: StdFee = { const fee: StdFee = {