Test getBalance with non-existent address

This commit is contained in:
Simon Warta 2020-08-06 15:36:26 +02:00
parent 435660cb67
commit b24a8f52f7
2 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,5 @@
import { StargateClient } from "./stargateclient";
import { pendingWithoutSimapp, simapp, unused } from "./testutils.spec";
import { nonExistentAddress, pendingWithoutSimapp, simapp, unused } from "./testutils.spec";
describe("StargateClient", () => {
describe("connect", () => {
@ -52,5 +52,15 @@ describe("StargateClient", () => {
client.disconnect();
});
it("returns null for non-existent address", async () => {
pendingWithoutSimapp();
const client = await StargateClient.connect(simapp.tendermintUrl);
const response = await client.getBalance(nonExistentAddress, simapp.denomFee);
expect(response).toBeNull();
client.disconnect();
});
});
});

View File

@ -23,3 +23,5 @@ export const unused = {
balanceStaking: "10000000", // 10 STAKE
balanceFee: "1000000000", // 1000 COSM
};
export const nonExistentAddress = "cosmos1p79apjaufyphcmsn4g07cynqf0wyjuezqu84hd";