Skip to content

Commit 085e120

Browse files
committed
Merge tag 'v0.32.1' into luca_joss/solomachine-lightclient-v3-from-v0.32
ibc-proto-rs v0.32.1 *July 31st, 2023* This release includes default `serde` value for token transfer memos and fixes the issue with deserialization of `MsgTransfer` and `FungibleTokenPacketData` types when no memo is present. - Fix token transfer deserialization for cases with no memo by deriving `Default` serde for the memo field in `MsgTransfer` and `FungibleTokenPacketData` types. ([#119](#119))
2 parents 8147b80 + bf7242b commit 085e120

File tree

9 files changed

+41
-1
lines changed

9 files changed

+41
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- Fix token transfer deserialization for cases with no memo by deriving
2+
`Default` serde for the memo field in `MsgTransfer` and
3+
`FungibleTokenPacketData` types.
4+
([#119](https://github.com/cosmos/ibc-proto-rs/pull/119))

.changelog/v0.32.1/summary.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*July 31st, 2023*
2+
3+
This release includes default `serde` value for token transfer memos and fixes
4+
the issue with deserialization of `MsgTransfer` and `FungibleTokenPacketData`
5+
types when no memo is present.

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# CHANGELOG
22

3+
## v0.32.1
4+
5+
*July 31st, 2023*
6+
7+
This release includes default `serde` value for token transfer memos and fixes
8+
the issue with deserialization of `MsgTransfer` and `FungibleTokenPacketData`
9+
types when no memo is present.
10+
11+
### BUG FIXES
12+
13+
- Fix token transfer deserialization for cases with no memo by deriving
14+
`Default` serde for the memo field in `MsgTransfer` and
15+
`FungibleTokenPacketData` types.
16+
([#119](https://github.com/cosmos/ibc-proto-rs/pull/119))
17+
318
## v0.32.0
419

520
*June 14th, 2023*

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ibc-proto"
3-
version = "0.32.0"
3+
version = "0.32.1"
44
authors = ["Informal Systems <[email protected]>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -61,3 +61,4 @@ json-schema = ["std", "schemars"]
6161
server = ["std", "tonic", "tonic/codegen", "tonic/transport", "tonic/prost"]
6262
parity-scale-codec = ["dep:parity-scale-codec", "dep:scale-info"]
6363
borsh = ["dep:borsh"]
64+
proto-descriptor = []

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ pub const COSMOS_SDK_COMMIT: &str = include_str!("COSMOS_SDK_COMMIT");
3131
/// The version (commit hash) of IBC Go used when generating this library.
3232
pub const IBC_GO_COMMIT: &str = include_str!("IBC_GO_COMMIT");
3333

34+
/// File descriptor set of compiled proto.
35+
#[cfg(feature = "proto-descriptor")]
36+
pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("prost/proto_descriptor.bin");
37+
3438
pub mod cosmos {
3539
pub mod auth {
3640
pub mod v1beta1 {

src/prost/ibc.applications.transfer.v1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub struct MsgTransfer {
3434
pub timeout_timestamp: u64,
3535
/// optional memo
3636
#[prost(string, tag = "8")]
37+
#[cfg_attr(feature = "std", serde(default))]
3738
pub memo: ::prost::alloc::string::String,
3839
}
3940
/// MsgTransferResponse defines the Msg/Transfer response type.

src/prost/ibc.applications.transfer.v2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ pub struct FungibleTokenPacketData {
1919
pub receiver: ::prost::alloc::string::String,
2020
/// optional memo
2121
#[prost(string, tag = "5")]
22+
#[cfg_attr(feature = "std", serde(default))]
2223
pub memo: ::prost::alloc::string::String,
2324
}

src/prost/proto_descriptor.bin

618 KB
Binary file not shown.

tools/proto-compiler/src/cmd/compile.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ impl CompileCmd {
136136
.build_server(true)
137137
.server_mod_attribute(".", r#"#[cfg(feature = "server")]"#)
138138
.out_dir(out_dir)
139+
.file_descriptor_set_path(out_dir.join("proto_descriptor.bin"))
139140
.extern_path(".tendermint", "::tendermint_proto")
140141
.extern_path(".ics23", "::ics23")
141142
.type_attribute(".google.protobuf.Any", attrs_serde)
@@ -175,7 +176,15 @@ impl CompileCmd {
175176
.type_attribute(".ibc.core.connection.v1.Version", attrs_jsonschema)
176177
.type_attribute(".ibc.core.types.v1", attrs_serde)
177178
.type_attribute(".ibc.applications.transfer.v1", attrs_serde)
179+
.field_attribute(
180+
".ibc.applications.transfer.v1.MsgTransfer.memo",
181+
attrs_serde_default,
182+
)
178183
.type_attribute(".ibc.applications.transfer.v2", attrs_serde)
184+
.field_attribute(
185+
".ibc.applications.transfer.v2.FungibleTokenPacketData.memo",
186+
attrs_serde_default,
187+
)
179188
.type_attribute(
180189
".ibc.applications.interchain_accounts.controller.v1",
181190
attrs_serde,

0 commit comments

Comments
 (0)