Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline Msg trait definition #993

Closed
1 task done
Farhad-Shabani opened this issue Nov 28, 2023 · 0 comments · Fixed by #995
Closed
1 task done

Streamline Msg trait definition #993

Farhad-Shabani opened this issue Nov 28, 2023 · 0 comments · Fixed by #995
Assignees
Labels
O: maintainability Objective: cause to ease modification, fault corrections and improve code understanding
Milestone

Comments

@Farhad-Shabani
Copy link
Member

Farhad-Shabani commented Nov 28, 2023

Context

The Msg trait definition within the ibc-primitives can be streamlined because:

  • With the release of ibc-proto-rs v0.38.0, the Protobuf trait is now re-exported from tendermint-proto. This Protobuf is not object-safe, and it is no longer necessary to satisfy earlier conditions that was limiting us to use Protobuf as a trait bound for other traits, thereby we now can discard the get_sign_bytes method.

  • Another update comes from prost v0.12.3, introduced as of ibc-proto-rs v0.39.1. With this version, we gain access to the auto prost::Name derive, which implements a similar method to the type_url method. Therefore, with the proper type restriction, the type_url method becomes obsolete too.

  • Additionally, the Msg trait's naming should be more reflective of its broader use case. It can now be implemented on other types beyond IBC messages, such as ClientState. In general, this trait defines the interaction/conversion between a domain type and its associated proto types.

Prerequisites

@Farhad-Shabani Farhad-Shabani added the O: maintainability Objective: cause to ease modification, fault corrections and improve code understanding label Nov 28, 2023
@seanchen1991 seanchen1991 self-assigned this Nov 28, 2023
@Farhad-Shabani Farhad-Shabani added this to the v0.49.0 milestone Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O: maintainability Objective: cause to ease modification, fault corrections and improve code understanding
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants