Make ERC20s non-optional in parseMsg

This commit is contained in:
Simon Warta
2020-02-17 15:43:42 +01:00
parent 5495828a6c
commit 318dc6f32c
3 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -158,7 +158,9 @@ describe("decode", () => {
],
},
};
expect(parseMsg(msg, defaultMemo, testdata.chainId, defaultTokens)).toEqual(defaultSendTransaction);
expect(parseMsg(msg, defaultMemo, testdata.chainId, defaultTokens, defaultErc20Tokens)).toEqual(
defaultSendTransaction,
);
});
it("works for ERC20 send transaction", () => {
+1 -1
View File
@@ -77,7 +77,7 @@ export function parseMsg(
memo: string | undefined,
chainId: ChainId,
tokens: BankTokens,
erc20Tokens: readonly Erc20Token[] = [],
erc20Tokens: readonly Erc20Token[],
): UnsignedTransaction {
if (types.isMsgSend(msg)) {
if (msg.value.amount.length !== 1) {
+1 -1
View File
@@ -24,7 +24,7 @@ export declare function parseMsg(
memo: string | undefined,
chainId: ChainId,
tokens: BankTokens,
erc20Tokens?: readonly Erc20Token[],
erc20Tokens: readonly Erc20Token[],
): UnsignedTransaction;
export declare function parseFee(fee: types.StdFee, tokens: BankTokens): Fee;
export declare function parseUnsignedTx(