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 serde to most streamable types #901

Merged
merged 4 commits into from
Jan 24, 2025
Merged

Add serde to most streamable types #901

merged 4 commits into from
Jan 24, 2025

Conversation

Rigidity
Copy link
Contributor

@Rigidity Rigidity commented Jan 23, 2025

For byte values, in human readable serializers, it will serialize as hex. In binary serializers, the bytes will be encoded verbatim.

For deserialization 0x is always allowed, but for serialization it can be decided by each type (currently Bytes32, PublicKey, and Signature use 0x whereas Bytes and Program do not).

All #[streamable] types automatically derive Serialize and Deserialize, but both #[streamable(message)] and #[streamable(no_serde)] disable it.

@Rigidity Rigidity requested a review from arvidn January 23, 2025 20:21
@Yakuhito
Copy link

many thanks

Copy link

coveralls-official bot commented Jan 23, 2025

Pull Request Test Coverage Report for Build 12955601346

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 137 of 195 (70.26%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 84.431%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/chia-bls/src/signature.rs 6 12 50.0%
crates/chia-bls/src/public_key.rs 0 12 0.0%
crates/chia-protocol/src/bytes.rs 12 24 50.0%
crates/chia-serde/src/lib.rs 75 103 72.82%
Totals Coverage Status
Change from base Build 12936439223: -0.2%
Covered Lines: 13530
Relevant Lines: 16025

💛 - Coveralls

@xearl4
Copy link
Contributor

xearl4 commented Jan 24, 2025

looks good, thanks! works fine for my use-cases :)

crates/chia-serde/Cargo.toml Outdated Show resolved Hide resolved
crates/chia-protocol/src/program.rs Show resolved Hide resolved
crates/chia-protocol/src/lib.rs Show resolved Hide resolved
@Rigidity Rigidity merged commit fb9b95d into main Jan 24, 2025
52 checks passed
@Rigidity Rigidity deleted the serde-2025 branch January 24, 2025 19:38
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.

4 participants