mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
Fix pubkey test
This commit is contained in:
parent
70e9c1532a
commit
8410f41a40
@ -1,5 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { encodeBech32Pubkey } from "../pubkey";
|
||||
import {
|
||||
faucet,
|
||||
makeRandomAddress,
|
||||
@ -43,13 +42,13 @@ describe("AuthExtension", () => {
|
||||
});
|
||||
|
||||
// This fails in the first test run if you forget to run `./scripts/wasmd/init.sh`
|
||||
xit("has correct pubkey for faucet", async () => {
|
||||
it("has correct pubkey for faucet", async () => {
|
||||
pendingWithoutWasmd();
|
||||
const client = makeAuthClient(wasmd.endpoint);
|
||||
const { result } = await client.auth.account(faucet.address);
|
||||
expect(result.value).toEqual(
|
||||
jasmine.objectContaining({
|
||||
public_key: encodeBech32Pubkey(faucet.pubkey, "cosmospub"),
|
||||
public_key: faucet.pubkey,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
@ -10,12 +10,20 @@ echo "Okay, thank you for your patience."
|
||||
|
||||
SCRIPT_DIR="$(realpath "$(dirname "$0")")"
|
||||
|
||||
|
||||
#
|
||||
# Cosmos SDK init
|
||||
#
|
||||
"$SCRIPT_DIR/send_first.js"
|
||||
|
||||
#
|
||||
# CosmWasm init
|
||||
#
|
||||
(
|
||||
echo "Ensuring contracts' checksums are correct ..."
|
||||
cd "$SCRIPT_DIR/contracts"
|
||||
sha256sum --check checksums.sha256
|
||||
)
|
||||
|
||||
"$SCRIPT_DIR/deploy_erc20.js"
|
||||
"$SCRIPT_DIR/deploy_nameservice.js"
|
||||
"$SCRIPT_DIR/deploy_staking.js"
|
||||
|
31
scripts/wasmd/send_first.js
Executable file
31
scripts/wasmd/send_first.js
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
const { Random } = require("@cosmjs/crypto");
|
||||
const { Bech32 } = require("@cosmjs/encoding");
|
||||
const { coins, Secp256k1Wallet, SigningCosmosClient, assertIsPostTxSuccess } = require("@cosmjs/sdk38");
|
||||
|
||||
const httpUrl = "http://localhost:1317";
|
||||
const faucet = {
|
||||
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",
|
||||
address0: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const wallet = await Secp256k1Wallet.fromMnemonic(faucet.mnemonic);
|
||||
const client = new SigningCosmosClient(httpUrl, faucet.address0, wallet);
|
||||
const recipient = Bech32.encode("cosmos", Random.getBytes(20));
|
||||
const amount = coins(226644, "ucosm");
|
||||
const memo = "Ensure chain has my pubkey";
|
||||
const sendResult = await client.sendTokens(recipient, amount, memo);
|
||||
assertIsPostTxSuccess(sendResult);
|
||||
}
|
||||
|
||||
main().then(
|
||||
() => process.exit(0),
|
||||
(error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
},
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user