Make ERC20s non-optional in parseMsg

This commit is contained in:
Simon Warta 2020-02-17 14:53:09 +01:00
parent 5495828a6c
commit 318dc6f32c
3 changed files with 5 additions and 3 deletions

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", () => {

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) {

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(