Skip to content

Commit

Permalink
Merge tag 'v0.32.1' into luca_joss/solomachine-lightclient-v3-from-v0.32
Browse files Browse the repository at this point in the history
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))
  • Loading branch information
ljoss17 committed Sep 4, 2023
2 parents 8147b80 + bf7242b commit 085e120
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Fix token transfer deserialization for cases with no memo by deriving
`Default` serde for the memo field in `MsgTransfer` and
`FungibleTokenPacketData` types.
([#119](https://github.com/cosmos/ibc-proto-rs/pull/119))
5 changes: 5 additions & 0 deletions .changelog/v0.32.1/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*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.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# CHANGELOG

## 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.

### BUG FIXES

- Fix token transfer deserialization for cases with no memo by deriving
`Default` serde for the memo field in `MsgTransfer` and
`FungibleTokenPacketData` types.
([#119](https://github.com/cosmos/ibc-proto-rs/pull/119))

## v0.32.0

*June 14th, 2023*
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-proto"
version = "0.32.0"
version = "0.32.1"
authors = ["Informal Systems <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down Expand Up @@ -61,3 +61,4 @@ json-schema = ["std", "schemars"]
server = ["std", "tonic", "tonic/codegen", "tonic/transport", "tonic/prost"]
parity-scale-codec = ["dep:parity-scale-codec", "dep:scale-info"]
borsh = ["dep:borsh"]
proto-descriptor = []
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ pub const COSMOS_SDK_COMMIT: &str = include_str!("COSMOS_SDK_COMMIT");
/// The version (commit hash) of IBC Go used when generating this library.
pub const IBC_GO_COMMIT: &str = include_str!("IBC_GO_COMMIT");

/// File descriptor set of compiled proto.
#[cfg(feature = "proto-descriptor")]
pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("prost/proto_descriptor.bin");

pub mod cosmos {
pub mod auth {
pub mod v1beta1 {
Expand Down
1 change: 1 addition & 0 deletions src/prost/ibc.applications.transfer.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub struct MsgTransfer {
pub timeout_timestamp: u64,
/// optional memo
#[prost(string, tag = "8")]
#[cfg_attr(feature = "std", serde(default))]
pub memo: ::prost::alloc::string::String,
}
/// MsgTransferResponse defines the Msg/Transfer response type.
Expand Down
1 change: 1 addition & 0 deletions src/prost/ibc.applications.transfer.v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ pub struct FungibleTokenPacketData {
pub receiver: ::prost::alloc::string::String,
/// optional memo
#[prost(string, tag = "5")]
#[cfg_attr(feature = "std", serde(default))]
pub memo: ::prost::alloc::string::String,
}
Binary file added src/prost/proto_descriptor.bin
Binary file not shown.
9 changes: 9 additions & 0 deletions tools/proto-compiler/src/cmd/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ impl CompileCmd {
.build_server(true)
.server_mod_attribute(".", r#"#[cfg(feature = "server")]"#)
.out_dir(out_dir)
.file_descriptor_set_path(out_dir.join("proto_descriptor.bin"))
.extern_path(".tendermint", "::tendermint_proto")
.extern_path(".ics23", "::ics23")
.type_attribute(".google.protobuf.Any", attrs_serde)
Expand Down Expand Up @@ -175,7 +176,15 @@ impl CompileCmd {
.type_attribute(".ibc.core.connection.v1.Version", attrs_jsonschema)
.type_attribute(".ibc.core.types.v1", attrs_serde)
.type_attribute(".ibc.applications.transfer.v1", attrs_serde)
.field_attribute(
".ibc.applications.transfer.v1.MsgTransfer.memo",
attrs_serde_default,
)
.type_attribute(".ibc.applications.transfer.v2", attrs_serde)
.field_attribute(
".ibc.applications.transfer.v2.FungibleTokenPacketData.memo",
attrs_serde_default,
)
.type_attribute(
".ibc.applications.interchain_accounts.controller.v1",
attrs_serde,
Expand Down

0 comments on commit 085e120

Please sign in to comment.