diff --git a/CHANGELOG.md b/CHANGELOG.md index 733aec2956..7c2f7832ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,15 @@ and this project adheres to - @cosmjs/tendermint-rpc: `CometClient` should be used instead of `TendermintClient`. +## [0.31.3] - 2023-10-25 + +### Fixed + +- @cosmjs/stargate: Add missing memo field to `fromAmino` implementation for + `MsgTransfer`. ([#1493]) + +[#1493]: https://github.com/cosmos/cosmjs/issues/1493 + ## [0.31.2] - 2023-10-24 ### Fixed @@ -1325,7 +1334,8 @@ CHANGELOG entries missing. Please see [the diff][0.24.1]. `FeeTable`. @cosmjs/cosmwasm has its own `FeeTable` with those properties. - @cosmjs/sdk38: Rename package to @cosmjs/launchpad. -[unreleased]: https://github.com/cosmos/cosmjs/compare/v0.31.2...HEAD +[unreleased]: https://github.com/cosmos/cosmjs/compare/v0.31.3...HEAD +[0.31.3]: https://github.com/cosmos/cosmjs/compare/v0.31.2...v0.31.3 [0.31.2]: https://github.com/cosmos/cosmjs/compare/v0.31.1...v0.31.2 [0.31.1]: https://github.com/cosmos/cosmjs/compare/v0.31.0...v0.31.1 [0.31.0]: https://github.com/cosmos/cosmjs/compare/v0.30.1...v0.31.0 diff --git a/packages/amino/package.json b/packages/amino/package.json index 175ac366fd..b82edf7945 100644 --- a/packages/amino/package.json +++ b/packages/amino/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/amino", - "version": "0.31.2", + "version": "0.31.3", "description": "Helpers for Amino based signing.", "contributors": [ "Simon Warta " diff --git a/packages/cli/package.json b/packages/cli/package.json index 649fadd6e1..17d820b537 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/cli", - "version": "0.31.2", + "version": "0.31.3", "description": "Command line interface", "contributors": [ "IOV SAS ", diff --git a/packages/cosmwasm-stargate/package.json b/packages/cosmwasm-stargate/package.json index 9e0f412fa4..99743e4346 100644 --- a/packages/cosmwasm-stargate/package.json +++ b/packages/cosmwasm-stargate/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/cosmwasm-stargate", - "version": "0.31.2", + "version": "0.31.3", "description": "CosmWasm SDK", "contributors": [ "Will Clark " diff --git a/packages/crypto/package.json b/packages/crypto/package.json index 32320e5d84..3be693be32 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/crypto", - "version": "0.31.2", + "version": "0.31.3", "description": "Cryptography resources for blockchain projects", "contributors": [ "IOV SAS ", diff --git a/packages/encoding/package.json b/packages/encoding/package.json index a641b3c61b..681000bde8 100644 --- a/packages/encoding/package.json +++ b/packages/encoding/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/encoding", - "version": "0.31.2", + "version": "0.31.3", "description": "Encoding helpers for blockchain projects", "contributors": [ "IOV SAS " diff --git a/packages/faucet-client/package.json b/packages/faucet-client/package.json index ce0fb40daf..77801e4814 100644 --- a/packages/faucet-client/package.json +++ b/packages/faucet-client/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/faucet-client", - "version": "0.31.2", + "version": "0.31.3", "description": "The faucet client", "contributors": [ "Will Clark " diff --git a/packages/faucet/package.json b/packages/faucet/package.json index 852ceddeb7..5900b96bdd 100644 --- a/packages/faucet/package.json +++ b/packages/faucet/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/faucet", - "version": "0.31.2", + "version": "0.31.3", "description": "The faucet", "contributors": [ "Ethan Frey ", diff --git a/packages/json-rpc/package.json b/packages/json-rpc/package.json index b7644aa8bd..2cbb813572 100644 --- a/packages/json-rpc/package.json +++ b/packages/json-rpc/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/json-rpc", - "version": "0.31.2", + "version": "0.31.3", "description": "Framework for implementing a JSON-RPC 2.0 API", "contributors": [ "IOV SAS ", diff --git a/packages/ledger-amino/package.json b/packages/ledger-amino/package.json index b44acab46b..74fb7ac5b9 100644 --- a/packages/ledger-amino/package.json +++ b/packages/ledger-amino/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/ledger-amino", - "version": "0.31.2", + "version": "0.31.3", "description": "A library for signing Amino-encoded transactions using Ledger devices", "contributors": [ "Will Clark " diff --git a/packages/math/package.json b/packages/math/package.json index 203c6d1bd7..e9bab109c8 100644 --- a/packages/math/package.json +++ b/packages/math/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/math", - "version": "0.31.2", + "version": "0.31.3", "description": "Math helpers for blockchain projects", "contributors": [ "IOV SAS " diff --git a/packages/proto-signing/package.json b/packages/proto-signing/package.json index 6a5aecc104..62ff5aeb93 100644 --- a/packages/proto-signing/package.json +++ b/packages/proto-signing/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/proto-signing", - "version": "0.31.2", + "version": "0.31.3", "description": "Utilities for protobuf based signing (Cosmos SDK 0.40+)", "contributors": [ "Will Clark ", diff --git a/packages/socket/package.json b/packages/socket/package.json index 2038947a90..10519cba46 100644 --- a/packages/socket/package.json +++ b/packages/socket/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/socket", - "version": "0.31.2", + "version": "0.31.3", "description": "Utility functions for working with WebSockets", "contributors": [ "IOV SAS ", diff --git a/packages/stargate/package.json b/packages/stargate/package.json index e9b85e0076..095a7ed08a 100644 --- a/packages/stargate/package.json +++ b/packages/stargate/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/stargate", - "version": "0.31.2", + "version": "0.31.3", "description": "Utilities for Cosmos SDK 0.40", "contributors": [ "Simon Warta " diff --git a/packages/stargate/src/modules/ibc/aminomessages.spec.ts b/packages/stargate/src/modules/ibc/aminomessages.spec.ts index 9cc62f2cbc..7035a27d94 100644 --- a/packages/stargate/src/modules/ibc/aminomessages.spec.ts +++ b/packages/stargate/src/modules/ibc/aminomessages.spec.ts @@ -155,6 +155,43 @@ describe("AminoTypes", () => { }); }); + it("works for MsgTransfer with memo", () => { + const aminoMsg: AminoMsgTransfer = { + type: "cosmos-sdk/MsgTransfer", + value: { + source_port: "testport", + source_channel: "testchannel", + token: coin(1234, "utest"), + sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6", + receiver: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5", + timeout_height: { + revision_height: "123", + revision_number: "456", + }, + timeout_timestamp: "789", + memo: "Hack me", + }, + }; + const msg = new AminoTypes(createIbcAminoConverters()).fromAmino(aminoMsg); + const expectedValue: MsgTransfer = { + sourcePort: "testport", + sourceChannel: "testchannel", + token: coin(1234, "utest"), + sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6", + receiver: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5", + timeoutHeight: { + revisionHeight: BigInt("123"), + revisionNumber: BigInt("456"), + }, + timeoutTimestamp: BigInt("789"), + memo: "Hack me", + }; + expect(msg).toEqual({ + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: expectedValue, + }); + }); + it("works for MsgTransfer with default values", () => { const aminoMsg: AminoMsgTransfer = { type: "cosmos-sdk/MsgTransfer", @@ -169,6 +206,7 @@ describe("AminoTypes", () => { // revision_number omitted }, // timeout_timestamp omitted + // memo omitted }, }; const msg = new AminoTypes(createIbcAminoConverters()).fromAmino(aminoMsg); diff --git a/packages/stargate/src/modules/ibc/aminomessages.ts b/packages/stargate/src/modules/ibc/aminomessages.ts index f3e4e87702..731e926887 100644 --- a/packages/stargate/src/modules/ibc/aminomessages.ts +++ b/packages/stargate/src/modules/ibc/aminomessages.ts @@ -97,6 +97,7 @@ export function createIbcAminoConverters(): AminoConverters { receiver, timeout_height, timeout_timestamp, + memo, }: AminoMsgTransfer["value"]): MsgTransfer => MsgTransfer.fromPartial({ sourcePort: source_port, @@ -111,6 +112,7 @@ export function createIbcAminoConverters(): AminoConverters { } : undefined, timeoutTimestamp: BigInt(timeout_timestamp || "0"), + memo: memo ?? "", }), }, }; diff --git a/packages/stream/package.json b/packages/stream/package.json index 0105a815c6..56cd791e68 100644 --- a/packages/stream/package.json +++ b/packages/stream/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/stream", - "version": "0.31.2", + "version": "0.31.3", "description": "Utility functions for producing and consuming streams", "contributors": [ "IOV SAS ", diff --git a/packages/tendermint-rpc/package.json b/packages/tendermint-rpc/package.json index 2c214c3dc3..a4195c3960 100644 --- a/packages/tendermint-rpc/package.json +++ b/packages/tendermint-rpc/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/tendermint-rpc", - "version": "0.31.2", + "version": "0.31.3", "description": "Tendermint RPC clients", "contributors": [ "IOV SAS ", diff --git a/packages/utils/package.json b/packages/utils/package.json index e95240275f..e3c7a8d0c7 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/utils", - "version": "0.31.2", + "version": "0.31.3", "description": "Utility tools, primarily for testing code", "contributors": [ "IOV SAS "