Update expected account number of unused account to 9

This commit is contained in:
Simon Warta 2020-05-07 11:23:26 +02:00
parent e64becb7cf
commit 35898e82c7
3 changed files with 20 additions and 14 deletions

View File

@ -17,6 +17,7 @@ import {
makeRandomAddress,
pendingWithoutWasmd,
tendermintIdMatcher,
unused,
wasmd,
wasmdEnabled,
} from "./testutils.spec";
@ -24,10 +25,6 @@ import { MsgSend, StdFee } from "./types";
const { fromAscii, fromHex, fromUtf8, toAscii, toBase64 } = Encoding;
const unused = {
address: "cosmos1cjsxept9rkggzxztslae9ndgpdyt2408lk850u",
};
const guest = {
address: "cosmos17d0jcz59jf68g52vq38tuuncmwwjk42u6mcxej",
};
@ -113,8 +110,8 @@ describe("CosmWasmClient", () => {
pendingWithoutWasmd();
const client = new CosmWasmClient(wasmd.endpoint);
expect(await client.getNonce(unused.address)).toEqual({
accountNumber: 5,
sequence: 0,
accountNumber: unused.accountNumber,
sequence: unused.sequence,
});
});
@ -135,8 +132,8 @@ describe("CosmWasmClient", () => {
const client = new CosmWasmClient(wasmd.endpoint);
expect(await client.getAccount(unused.address)).toEqual({
address: unused.address,
accountNumber: 5,
sequence: 0,
accountNumber: unused.accountNumber,
sequence: unused.sequence,
pubkey: undefined,
balance: [
{ denom: "ucosm", amount: "1000000000" },

View File

@ -25,6 +25,7 @@ import {
tendermintIdMatcher,
tendermintOptionalIdMatcher,
tendermintShortHashMatcher,
unused,
wasmd,
wasmdEnabled,
} from "./testutils.spec";
@ -45,9 +46,6 @@ import {
const { fromAscii, fromBase64, fromHex, toAscii, toBase64, toHex } = Encoding;
const emptyAddress = "cosmos1ltkhnmdcqemmd2tkhnx7qx66tq7e0wykw2j85k";
const unusedAccount = {
address: "cosmos1cjsxept9rkggzxztslae9ndgpdyt2408lk850u",
};
function makeSignedTx(firstMsg: Msg, fee: StdFee, memo: string, firstSignature: StdSignature): StdTx {
return {
@ -176,12 +174,12 @@ describe("RestClient", () => {
it("works for unused account without pubkey", async () => {
pendingWithoutWasmd();
const client = new RestClient(wasmd.endpoint);
const { height, result } = await client.authAccounts(unusedAccount.address);
const { height, result } = await client.authAccounts(unused.address);
expect(height).toMatch(nonNegativeIntegerMatcher);
expect(result).toEqual({
type: "cosmos-sdk/Account",
value: {
address: unusedAccount.address,
address: unused.address,
public_key: "", // not known to the chain
coins: [
{
@ -193,7 +191,7 @@ describe("RestClient", () => {
denom: "ustake",
},
],
account_number: 5,
account_number: unused.accountNumber,
sequence: 0,
},
});

View File

@ -49,6 +49,17 @@ export const faucet = {
address: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
};
/** Unused account */
export const unused = {
pubkey: {
type: "tendermint/PubKeySecp256k1",
value: "ArkCaFUJ/IH+vKBmNRCdUVl3mCAhbopk9jjW4Ko4OfRQ",
},
address: "cosmos1cjsxept9rkggzxztslae9ndgpdyt2408lk850u",
accountNumber: 9,
sequence: 0,
};
export function wasmdEnabled(): boolean {
return !!process.env.WASMD_ENABLED;
}