cosmwasm-stargate: Update for bank extension change

This commit is contained in:
willclarktech 2021-03-30 18:04:52 +02:00
parent c414aad304
commit 253494d29d
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
2 changed files with 9 additions and 3 deletions

View File

@ -150,7 +150,7 @@ export class CosmWasmClient {
};
}
public async getBalance(address: string, searchDenom: string): Promise<Coin | null> {
public async getBalance(address: string, searchDenom: string): Promise<Coin> {
return this.forceGetQueryClient().bank.balance(address, searchDenom);
}

View File

@ -498,7 +498,10 @@ describe("SigningCosmWasmClient", () => {
// no tokens here
const before = await client.getBalance(beneficiaryAddress, "ucosm");
expect(before).toBeNull();
expect(before).toEqual({
denom: "ucosm",
amount: "0",
});
// send
const result = await client.sendTokens(alice.address0, beneficiaryAddress, transferAmount, memo);
@ -523,7 +526,10 @@ describe("SigningCosmWasmClient", () => {
// no tokens here
const before = await client.getBalance(beneficiaryAddress, "ucosm");
expect(before).toBeNull();
expect(before).toEqual({
denom: "ucosm",
amount: "0",
});
// send
const result = await client.sendTokens(alice.address0, beneficiaryAddress, transferAmount, memo);