Make timeout_height non-optional

This commit is contained in:
Simon Warta 2021-07-26 12:43:25 +02:00
parent ce4202c3c3
commit 4e3cc9edf4
2 changed files with 6 additions and 4 deletions

View File

@ -357,10 +357,12 @@ export interface AminoMsgTransfer extends AminoMsg {
/** Bech32 account address */
readonly receiver: string;
/**
* It is unclear if this is really optional. The Amino encoding expects unset values to be
* encoded as {}.
* The timeout as a (revision_number, revision_height) pair.
*
* This fied is is non-optional (https://github.com/cosmos/cosmos-sdk/blob/v0.42.7/x/ibc/applications/transfer/types/tx.pb.go#L49).
* In order to not set the timeout height, set it to {}.
*/
readonly timeout_height?: AminoHeight;
readonly timeout_height: AminoHeight;
/**
* Timeout timestamp (in nanoseconds). The timeout is disabled when set to 0.
*

View File

@ -410,7 +410,7 @@ describe("AminoTypes", () => {
token: coin(1234, "utest"),
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
receiver: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
timeout_height: {}, // 🤷‍♂️
timeout_height: {},
timeout_timestamp: undefined,
},
};