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

CHIA-1169: Serde support for common types #668

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

CHIA-1169: Serde support for common types #668

wants to merge 1 commit into from

Conversation

Rigidity
Copy link
Contributor

No description provided.

@Rigidity Rigidity requested a review from arvidn August 17, 2024 03:10
@Rigidity Rigidity changed the title Serde support for common types CHIA-1169: Serde support for common types Aug 17, 2024
#[derive(Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
pub struct Bytes(Vec<u8>);

#[cfg(feature = "serde")]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not a fan of duplicating the definition of Bytes and BytesImpl. It might be better to get rid of serde_with entirely and just use the manual implementation like I did for PublicKey

@@ -49,6 +49,7 @@ cast_possible_wrap = "allow"
cast_lossless = "allow"
similar_names = "allow"
implicit_hasher = "allow"
unsafe_derive_deserialize = "allow"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why it was giving this warning when deriving on types like Coin. Maybe the Python bindings are tripping it up

Copy link

Pull Request Test Coverage Report for Build 10429084212

Details

  • 204 of 314 (64.97%) changed or added relevant lines in 12 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 83.496%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/chia-protocol/src/coin.rs 0 1 0.0%
crates/chia-protocol/src/coin_spend.rs 0 1 0.0%
crates/chia-protocol/src/coin_state.rs 0 1 0.0%
crates/chia-protocol/src/program.rs 0 1 0.0%
crates/chia-protocol/src/spend_bundle.rs 41 42 97.62%
crates/clvm-utils/src/tree_hash.rs 0 1 0.0%
crates/chia-protocol/src/bytes.rs 2 4 50.0%
crates/chia-bls/src/signature.rs 10 20 50.0%
crates/chia-bls/src/gtelement.rs 0 20 0.0%
crates/chia-bls/src/public_key.rs 0 20 0.0%
Totals Coverage Status
Change from base Build 10422144649: -0.4%
Covered Lines: 12506
Relevant Lines: 14978

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant