Add and test AuthAccountsResponse.height
This commit is contained in:
parent
28460cfc0f
commit
2d85ecc840
@ -20,6 +20,7 @@ import {
|
||||
makeRandomAddress,
|
||||
pendingWithoutWasmd,
|
||||
tendermintAddressMatcher,
|
||||
tendermintHeightMatcher,
|
||||
tendermintIdMatcher,
|
||||
tendermintOptionalIdMatcher,
|
||||
wasmdEnabled,
|
||||
@ -174,7 +175,8 @@ describe("RestClient", () => {
|
||||
it("works for unused account without pubkey", async () => {
|
||||
pendingWithoutWasmd();
|
||||
const client = new RestClient(wasmdEndpoint);
|
||||
const { result } = await client.authAccounts(unusedAccount.address);
|
||||
const { height, result } = await client.authAccounts(unusedAccount.address);
|
||||
expect(height).toMatch(tendermintHeightMatcher);
|
||||
expect(result).toEqual({
|
||||
type: "cosmos-sdk/Account",
|
||||
value: {
|
||||
|
||||
@ -70,6 +70,7 @@ export interface BlockResponse {
|
||||
}
|
||||
|
||||
interface AuthAccountsResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly type: "cosmos-sdk/Account";
|
||||
readonly value: CosmosSdkAccount;
|
||||
|
||||
@ -56,6 +56,7 @@ export function makeRandomAddress(): string {
|
||||
return Bech32.encode("cosmos", Random.getBytes(20));
|
||||
}
|
||||
|
||||
export const tendermintHeightMatcher = /^[0-9]+$/;
|
||||
export const tendermintIdMatcher = /^[0-9A-F]{64}$/;
|
||||
export const tendermintOptionalIdMatcher = /^([0-9A-F]{64}|)$/;
|
||||
export const tendermintAddressMatcher = /^[0-9A-F]{40}$/;
|
||||
|
||||
1
packages/sdk/types/restclient.d.ts
vendored
1
packages/sdk/types/restclient.d.ts
vendored
@ -52,6 +52,7 @@ export interface BlockResponse {
|
||||
readonly block: Block;
|
||||
}
|
||||
interface AuthAccountsResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly type: "cosmos-sdk/Account";
|
||||
readonly value: CosmosSdkAccount;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user