Skip to content

Commit

Permalink
fix: derive default serde on the memo fields of token transfer types (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Farhad-Shabani authored Jul 31, 2023
1 parent e8b6d0e commit dfebf30
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
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 modified src/prost/proto_descriptor.bin
Binary file not shown.
8 changes: 8 additions & 0 deletions tools/proto-compiler/src/cmd/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,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 dfebf30

Please sign in to comment.