From 6017892ffc33cf14dfc0dde7643b806f54a52421 Mon Sep 17 00:00:00 2001 From: Shane Vitarana Date: Tue, 1 Aug 2023 12:38:28 +0100 Subject: [PATCH 1/2] 0.31.x backport: Add memo field to AminoMsgTransfer --- CHANGELOG.md | 7 +++++++ packages/stargate/src/modules/ibc/aminomessages.spec.ts | 3 +++ packages/stargate/src/modules/ibc/aminomessages.ts | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 351861b0..44896e5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to ## [Unreleased] +### Fixed + +- @cosmjs/stargate: Add missing memo field to Amino JSON representation of + `MsgTransfer` and adapt converters. ([#1456]) + +[#1456]: https://github.com/cosmos/cosmjs/pull/1456 + ## [0.31.1] - 2023-08-21 ### Fixed diff --git a/packages/stargate/src/modules/ibc/aminomessages.spec.ts b/packages/stargate/src/modules/ibc/aminomessages.spec.ts index 3eda0649..420690cd 100644 --- a/packages/stargate/src/modules/ibc/aminomessages.spec.ts +++ b/packages/stargate/src/modules/ibc/aminomessages.spec.ts @@ -40,6 +40,7 @@ describe("AminoTypes", () => { revision_number: "456", }, timeout_timestamp: "789", + memo: undefined, }, }; expect(aminoMsg).toEqual(expected); @@ -77,6 +78,7 @@ describe("AminoTypes", () => { revision_number: undefined, }, timeout_timestamp: undefined, + memo: undefined, }, }; expect(aminoMsg).toEqual(expected); @@ -107,6 +109,7 @@ describe("AminoTypes", () => { receiver: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5", timeout_height: {}, timeout_timestamp: undefined, + memo: undefined, }, }; expect(aminoMsg).toEqual(expected); diff --git a/packages/stargate/src/modules/ibc/aminomessages.ts b/packages/stargate/src/modules/ibc/aminomessages.ts index 951e2f9e..4073c521 100644 --- a/packages/stargate/src/modules/ibc/aminomessages.ts +++ b/packages/stargate/src/modules/ibc/aminomessages.ts @@ -13,7 +13,7 @@ interface AminoHeight { readonly revision_height?: string; } -// https://github.com/cosmos/ibc-go/blob/07b6a97b67d17fd214a83764cbdb2c2c3daef445/modules/apps/transfer/types/tx.pb.go#L33-L53 +// https://github.com/cosmos/ibc-go/blob/a4ca39c59f770a0b6948947d5178d5f0914c3a17/modules/apps/transfer/types/tx.pb.go#L37-L56 /** Transfers fungible tokens (i.e Coins) between ICS20 enabled chains */ export interface AminoMsgTransfer extends AminoMsg { readonly type: "cosmos-sdk/MsgTransfer"; @@ -38,6 +38,7 @@ export interface AminoMsgTransfer extends AminoMsg { * 0 values must be omitted (https://github.com/cosmos/cosmos-sdk/blob/v0.42.7/x/ibc/applications/transfer/types/tx.pb.go#L52). */ readonly timeout_timestamp?: string; + readonly memo?: string; }; } @@ -73,6 +74,7 @@ export function createIbcAminoConverters(): AminoConverters { receiver, timeoutHeight, timeoutTimestamp, + memo, }: MsgTransfer): AminoMsgTransfer["value"] => ({ source_port: sourcePort, source_channel: sourceChannel, @@ -86,6 +88,7 @@ export function createIbcAminoConverters(): AminoConverters { } : {}, timeout_timestamp: omitDefault(timeoutTimestamp)?.toString(), + memo: omitDefault(memo)?.toString(), }), fromAmino: ({ source_port, From 550a9fc1b55ec5b3896dc6c0798fa9d6e7382900 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 24 Oct 2023 17:35:02 +0200 Subject: [PATCH 2/2] Set version 0.31.2 --- CHANGELOG.md | 5 ++++- packages/amino/package.json | 2 +- packages/cli/package.json | 2 +- packages/cosmwasm-stargate/package.json | 2 +- packages/crypto/package.json | 2 +- packages/encoding/package.json | 2 +- packages/faucet-client/package.json | 2 +- packages/faucet/package.json | 2 +- packages/json-rpc/package.json | 2 +- packages/ledger-amino/package.json | 2 +- packages/math/package.json | 2 +- packages/proto-signing/package.json | 2 +- packages/socket/package.json | 2 +- packages/stargate/package.json | 2 +- packages/stream/package.json | 2 +- packages/tendermint-rpc/package.json | 2 +- packages/utils/package.json | 2 +- 17 files changed, 20 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44896e5a..8e632cda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to ## [Unreleased] +## [0.31.2] - 2023-10-24 + ### Fixed - @cosmjs/stargate: Add missing memo field to Amino JSON representation of @@ -1302,7 +1304,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.1...HEAD +[unreleased]: https://github.com/cosmos/cosmjs/compare/v0.31.2...HEAD +[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 [0.30.1]: https://github.com/cosmos/cosmjs/compare/v0.30.0...v0.30.1 diff --git a/packages/amino/package.json b/packages/amino/package.json index cc25b61d..175ac366 100644 --- a/packages/amino/package.json +++ b/packages/amino/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/amino", - "version": "0.31.1", + "version": "0.31.2", "description": "Helpers for Amino based signing.", "contributors": [ "Simon Warta " diff --git a/packages/cli/package.json b/packages/cli/package.json index b577d19e..ba534c54 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/cli", - "version": "0.31.1", + "version": "0.31.2", "description": "Command line interface", "contributors": [ "IOV SAS ", diff --git a/packages/cosmwasm-stargate/package.json b/packages/cosmwasm-stargate/package.json index 9836f113..97127715 100644 --- a/packages/cosmwasm-stargate/package.json +++ b/packages/cosmwasm-stargate/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/cosmwasm-stargate", - "version": "0.31.1", + "version": "0.31.2", "description": "CosmWasm SDK", "contributors": [ "Will Clark " diff --git a/packages/crypto/package.json b/packages/crypto/package.json index a69fceb7..32320e5d 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/crypto", - "version": "0.31.1", + "version": "0.31.2", "description": "Cryptography resources for blockchain projects", "contributors": [ "IOV SAS ", diff --git a/packages/encoding/package.json b/packages/encoding/package.json index ca792ffa..a641b3c6 100644 --- a/packages/encoding/package.json +++ b/packages/encoding/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/encoding", - "version": "0.31.1", + "version": "0.31.2", "description": "Encoding helpers for blockchain projects", "contributors": [ "IOV SAS " diff --git a/packages/faucet-client/package.json b/packages/faucet-client/package.json index 52a32b34..ce0fb40d 100644 --- a/packages/faucet-client/package.json +++ b/packages/faucet-client/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/faucet-client", - "version": "0.31.1", + "version": "0.31.2", "description": "The faucet client", "contributors": [ "Will Clark " diff --git a/packages/faucet/package.json b/packages/faucet/package.json index 24be6040..852cedde 100644 --- a/packages/faucet/package.json +++ b/packages/faucet/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/faucet", - "version": "0.31.1", + "version": "0.31.2", "description": "The faucet", "contributors": [ "Ethan Frey ", diff --git a/packages/json-rpc/package.json b/packages/json-rpc/package.json index 974ec85e..b7644aa8 100644 --- a/packages/json-rpc/package.json +++ b/packages/json-rpc/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/json-rpc", - "version": "0.31.1", + "version": "0.31.2", "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 6d24b388..b44acab4 100644 --- a/packages/ledger-amino/package.json +++ b/packages/ledger-amino/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/ledger-amino", - "version": "0.31.1", + "version": "0.31.2", "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 128f547a..203c6d1b 100644 --- a/packages/math/package.json +++ b/packages/math/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/math", - "version": "0.31.1", + "version": "0.31.2", "description": "Math helpers for blockchain projects", "contributors": [ "IOV SAS " diff --git a/packages/proto-signing/package.json b/packages/proto-signing/package.json index cfa46efa..442ef8ae 100644 --- a/packages/proto-signing/package.json +++ b/packages/proto-signing/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/proto-signing", - "version": "0.31.1", + "version": "0.31.2", "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 62ec1ae0..2038947a 100644 --- a/packages/socket/package.json +++ b/packages/socket/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/socket", - "version": "0.31.1", + "version": "0.31.2", "description": "Utility functions for working with WebSockets", "contributors": [ "IOV SAS ", diff --git a/packages/stargate/package.json b/packages/stargate/package.json index e817b4e0..97af37de 100644 --- a/packages/stargate/package.json +++ b/packages/stargate/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/stargate", - "version": "0.31.1", + "version": "0.31.2", "description": "Utilities for Cosmos SDK 0.40", "contributors": [ "Simon Warta " diff --git a/packages/stream/package.json b/packages/stream/package.json index aef7e185..0105a815 100644 --- a/packages/stream/package.json +++ b/packages/stream/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/stream", - "version": "0.31.1", + "version": "0.31.2", "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 a2d4a3cd..2c214c3d 100644 --- a/packages/tendermint-rpc/package.json +++ b/packages/tendermint-rpc/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/tendermint-rpc", - "version": "0.31.1", + "version": "0.31.2", "description": "Tendermint RPC clients", "contributors": [ "IOV SAS ", diff --git a/packages/utils/package.json b/packages/utils/package.json index 42f167bc..e9524027 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@cosmjs/utils", - "version": "0.31.1", + "version": "0.31.2", "description": "Utility tools, primarily for testing code", "contributors": [ "IOV SAS "