From 03f01f54d682e1f71fd90df04f06c024b76c07ad Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 17 Feb 2020 12:31:41 +0100 Subject: [PATCH] Test empty address in RestClient.authAccounts --- packages/sdk/src/restclient.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/sdk/src/restclient.spec.ts b/packages/sdk/src/restclient.spec.ts index 09ca66b5..1e45b8e9 100644 --- a/packages/sdk/src/restclient.spec.ts +++ b/packages/sdk/src/restclient.spec.ts @@ -290,6 +290,18 @@ describe("RestClient", () => { }), ); }); + + // This property is used by CosmWasmClient.getAccount + it("returns empty address for non-existent account", async () => { + pendingWithoutCosmos(); + const client = new RestClient(httpUrl); + const nonExistentAccount = makeRandomAddress(); + const { result } = await client.authAccounts(nonExistentAccount); + expect(result).toEqual({ + type: "cosmos-sdk/Account", + value: jasmine.objectContaining({ address: "" }), + }); + }); }); describe("encodeTx", () => {