Add and test AuthAccountsResponse.height

This commit is contained in:
Simon Warta 2020-03-07 17:23:58 +01:00
parent 28460cfc0f
commit 2d85ecc840
4 changed files with 6 additions and 1 deletions

View File

@ -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: {

View File

@ -70,6 +70,7 @@ export interface BlockResponse {
}
interface AuthAccountsResponse {
readonly height: string;
readonly result: {
readonly type: "cosmos-sdk/Account";
readonly value: CosmosSdkAccount;

View File

@ -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}$/;

View File

@ -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;