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

Add serialization for various structs and enums #653

Merged
merged 4 commits into from
May 5, 2023

Conversation

DaviRain-Su
Copy link
Contributor

Closes: #652

Description


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests.
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@codecov
Copy link

codecov bot commented Apr 28, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.51 ⚠️

Comparison is base (dc54640) 72.97% compared to head (48cd392) 72.47%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #653      +/-   ##
==========================================
- Coverage   72.97%   72.47%   -0.51%     
==========================================
  Files         127      127              
  Lines       15696    15805     +109     
==========================================
  Hits        11454    11454              
- Misses       4242     4351     +109     
Impacted Files Coverage Δ
crates/ibc/src/core/ics24_host/path.rs 80.07% <0.00%> (-12.14%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines +47 to +68
#[cfg_attr(
feature = "parity-scale-codec",
derive(
parity_scale_codec::Encode,
parity_scale_codec::Decode,
scale_info::TypeInfo
)
)]
#[cfg_attr(
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Display)]
#[display(fmt = "clients/{_0}/clientType")]
pub struct ClientTypePath(pub ClientId);

impl ClientTypePath {
pub fn new(client_id: &ClientId) -> ClientTypePath {
ClientTypePath(client_id.clone())
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ClientTypePath should be dropped. Check here please.
Otherwise looks good to me 🙏

@Farhad-Shabani Farhad-Shabani merged commit b026551 into cosmos:main May 5, 2023
plafer pushed a commit that referenced this pull request May 5, 2023
* Add serialization for various structs and enums

* Create 652-codec-borsh-serde.md

---------

Signed-off-by: Davirain <[email protected]>
plafer added a commit that referenced this pull request May 5, 2023
* some docstrings updated

* Remove dynamic_typing module

* move some utils to tendermint client

* Make `crate::utils` private

* docs

* Remove unused struct

* move events under core

* move timestamp under core

* Move tx_msg under core

* Make naming convention comment not module-level

* Make core::handler private

* Re-export all core::context

* make tx_msg private and re-export Msg

* core module docs

* many docs improvements

* Release v0.39.0 (#657)

* unclog release

* bump version

* Correct issue 621 description

---------

Co-authored-by: Farhad Shabani <[email protected]>

* fix doc test

* `Validation/ExecutionContext` method docs

* more docs improvements

* remove unused function

* client docs improvements

* move trust_threshold to tendermint

* connection

* finish ics-20 docs

* finish docs for the tendermint light client

* core docs

* move `ModuleExtras` out of channel

* Make all `TYPE_URL` private

* Move `Acknowledgement `

* remove superfluous channel message modules

* finish channel docs

* Remove `ics05_port` module

* ValidationError -> IdentifierError

* remove error module

* cleanup ics24_host path

* move host validate module under identifier

* move RouterError

* move msgs under core

* remove tx_msg

* router module

* remove arbitrary restrictions on `ModuleId`

* router

* finish ics23

* mock

* fmt

* Add serialization for various structs and enums (#653)

* Add serialization for various structs and enums

* Create 652-codec-borsh-serde.md

---------

Signed-off-by: Davirain <[email protected]>

* changelog

* remove `ClientTypePath`

---------

Signed-off-by: Davirain <[email protected]>
Co-authored-by: Farhad Shabani <[email protected]>
Co-authored-by: Davirain <[email protected]>
Farhad-Shabani pushed a commit that referenced this pull request Sep 9, 2024
* Add serialization for various structs and enums

* Create 652-codec-borsh-serde.md

---------

Signed-off-by: Davirain <[email protected]>
Farhad-Shabani added a commit that referenced this pull request Sep 9, 2024
* some docstrings updated

* Remove dynamic_typing module

* move some utils to tendermint client

* Make `crate::utils` private

* docs

* Remove unused struct

* move events under core

* move timestamp under core

* Move tx_msg under core

* Make naming convention comment not module-level

* Make core::handler private

* Re-export all core::context

* make tx_msg private and re-export Msg

* core module docs

* many docs improvements

* Release v0.39.0 (#657)

* unclog release

* bump version

* Correct issue 621 description

---------

Co-authored-by: Farhad Shabani <[email protected]>

* fix doc test

* `Validation/ExecutionContext` method docs

* more docs improvements

* remove unused function

* client docs improvements

* move trust_threshold to tendermint

* connection

* finish ics-20 docs

* finish docs for the tendermint light client

* core docs

* move `ModuleExtras` out of channel

* Make all `TYPE_URL` private

* Move `Acknowledgement `

* remove superfluous channel message modules

* finish channel docs

* Remove `ics05_port` module

* ValidationError -> IdentifierError

* remove error module

* cleanup ics24_host path

* move host validate module under identifier

* move RouterError

* move msgs under core

* remove tx_msg

* router module

* remove arbitrary restrictions on `ModuleId`

* router

* finish ics23

* mock

* fmt

* Add serialization for various structs and enums (#653)

* Add serialization for various structs and enums

* Create 652-codec-borsh-serde.md

---------

Signed-off-by: Davirain <[email protected]>

* changelog

* remove `ClientTypePath`

---------

Signed-off-by: Davirain <[email protected]>
Co-authored-by: Farhad Shabani <[email protected]>
Co-authored-by: Davirain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add parity-scale-codec, borsh, serde feature for *Path
2 participants