scripts: Update for hd wallet change

This commit is contained in:
willclarktech 2021-04-06 17:12:43 +02:00
parent 9496fc2540
commit 798c801525
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
5 changed files with 8 additions and 5 deletions

View File

@ -21,7 +21,7 @@ const codeMeta = {
};
async function main() {
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, undefined, "wasm");
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: "wasm" });
const client = await SigningCosmWasmClient.connectWithSigner(endpoint, wallet);
const wasm = fs.readFileSync(__dirname + "/contracts/cw1_subkeys.wasm");

View File

@ -63,7 +63,7 @@ const initData = [
];
async function main() {
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, undefined, "wasm");
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: "wasm" });
const client = await SigningCosmWasmClient.connectWithSigner(endpoint, wallet);
const wasm = fs.readFileSync(__dirname + "/contracts/cw3_fixed_multisig.wasm");

View File

@ -48,7 +48,7 @@ const inits = [
];
async function main() {
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, undefined, "wasm");
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: "wasm" });
const client = await SigningCosmWasmClient.connectWithSigner(endpoint, wallet);
const wasm = fs.readFileSync(__dirname + "/contracts/hackatom.wasm");

View File

@ -37,7 +37,10 @@ async function main() {
for (const { mnemonic, accountNumbers } of accountsToCreate) {
const wallets = await Promise.all(
accountNumbers.map((accountNumber) =>
Secp256k1HdWallet.fromMnemonic(mnemonic, makeCosmoshubPath(accountNumber), prefix),
Secp256k1HdWallet.fromMnemonic(mnemonic, {
hdPath: makeCosmoshubPath(accountNumber),
prefix: prefix,
}),
),
);
const accounts = (await Promise.all(wallets.map((wallet) => wallet.getAccounts()))).map(

View File

@ -16,7 +16,7 @@ const faucet = {
};
async function main() {
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic, undefined, prefix);
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic, { prefix: prefix });
const client = await SigningStargateClient.connectWithSigner(rpcUrl, wallet);
const recipient = Bech32.encode(prefix, Random.getBytes(20));
const amount = coins(226644, "ucosm");