Test getBalance with non-existent address
This commit is contained in:
parent
435660cb67
commit
b24a8f52f7
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -23,3 +23,5 @@ export const unused = {
|
||||
balanceStaking: "10000000", // 10 STAKE
|
||||
balanceFee: "1000000000", // 1000 COSM
|
||||
};
|
||||
|
||||
export const nonExistentAddress = "cosmos1p79apjaufyphcmsn4g07cynqf0wyjuezqu84hd";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user