cosmwasm-stargate: Update for removed coinFromProto

This commit is contained in:
willclarktech 2021-03-30 10:44:42 +02:00
parent c6bbd5b60d
commit 08647312ba
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
2 changed files with 4 additions and 6 deletions

View File

@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { fromBase64, fromUtf8, toBase64, toUtf8 } from "@cosmjs/encoding";
import { AminoConverter, Coin, coinFromProto } from "@cosmjs/stargate";
import { AminoConverter, Coin } from "@cosmjs/stargate";
import { assertDefinedAndNotNull } from "@cosmjs/utils";
import Long from "long";
@ -167,7 +167,7 @@ export const cosmWasmTypes: Record<string, AminoConverter> = {
code_id: codeId.toString(),
label: label,
init_msg: JSON.parse(fromUtf8(initMsg)),
funds: funds.map(coinFromProto),
funds: funds,
admin: admin ?? undefined,
};
},
@ -231,7 +231,7 @@ export const cosmWasmTypes: Record<string, AminoConverter> = {
sender: sender,
contract: contract,
msg: JSON.parse(fromUtf8(msg)),
funds: funds.map(coinFromProto),
funds: funds,
};
},
fromAmino: ({ sender, contract, msg, funds }: AminoMsgExecuteContract["value"]): MsgExecuteContract => ({

View File

@ -16,7 +16,6 @@ import {
Block,
BroadcastTxResponse,
Coin,
coinFromProto,
IndexedTx,
isSearchByHeightQuery,
isSearchBySentFromOrToQuery,
@ -144,8 +143,7 @@ export class CosmWasmClient {
}
public async getBalance(address: string, searchDenom: string): Promise<Coin | null> {
const balance = await this.forceGetQueryClient().bank.balance(address, searchDenom);
return balance ? coinFromProto(balance) : null;
return this.forceGetQueryClient().bank.balance(address, searchDenom);
}
public async getTx(id: string): Promise<IndexedTx | null> {