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-886: Redesign ToClvm and FromClvm to be generic over Encoder and Decoder #592

Merged
merged 8 commits into from
Jul 29, 2024

Conversation

Rigidity
Copy link
Contributor

@Rigidity Rigidity commented Jul 2, 2024

Makes a few changes:

  • ToClvm is generic over Encoder rather than Node.
  • FromClvm is generic over Decoder rather than Node.
  • ToNodePtr and FromNodePtr have been removed since they are no longer needed.
  • Program can now implement ToClvm<Allocator> and FromClvm<Allocator> directly.
  • Encoder now has a method for encode_bigint and encode_atom takes a clvmr::Atom instead of &[u8].

@Rigidity Rigidity changed the title ToClvm/FromClvm use Encoder/Decoder traits, rather than Node CHIA-886: Redesign ToClvm and FromClvm to be generic over Encoder and Decoder Jul 2, 2024
Copy link

coveralls-official bot commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9755162032

Details

  • 171 of 182 (93.96%) changed or added relevant lines in 18 files are covered.
  • 288 unchanged lines in 11 files lost coverage.
  • Overall coverage increased (+2.1%) to 80.801%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/chia-puzzles/src/puzzles/nft.rs 0 2 0.0%
crates/clvm-traits/src/match_byte.rs 1 3 33.33%
crates/clvm-traits/src/wrappers.rs 0 2 0.0%
crates/clvm-traits/src/clvm_encoder.rs 13 18 72.22%
Files with Coverage Reduction New Missed Lines %
crates/clvm-traits/src/match_byte.rs 1 45.45%
crates/chia-protocol/src/classgroup.rs 1 0.0%
crates/chia-bls/src/error.rs 4 0.0%
crates/chia-traits/src/streamable.rs 9 92.54%
crates/chia-bls/src/secret_key.rs 11 89.95%
crates/chia-bls/src/signature.rs 19 93.94%
crates/chia-bls/src/public_key.rs 19 90.45%
wheel/src/api.rs 43 66.67%
crates/chia-bls/src/gtelement.rs 47 9.47%
crates/chia-bls/src/bls_cache.rs 51 73.16%
Totals Coverage Status
Change from base Build 9645397669: 2.1%
Covered Lines: 11422
Relevant Lines: 14136

💛 - Coveralls

Copy link

coveralls-official bot commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9767103062

Details

  • 171 of 182 (93.96%) changed or added relevant lines in 18 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+4.1%) to 82.831%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/chia-puzzles/src/puzzles/nft.rs 0 2 0.0%
crates/clvm-traits/src/match_byte.rs 1 3 33.33%
crates/clvm-traits/src/wrappers.rs 0 2 0.0%
crates/clvm-traits/src/clvm_encoder.rs 13 18 72.22%
Files with Coverage Reduction New Missed Lines %
crates/clvm-traits/src/match_byte.rs 1 45.45%
Totals Coverage Status
Change from base Build 9767098610: 4.1%
Covered Lines: 11709
Relevant Lines: 14136

💛 - Coveralls

@Rigidity Rigidity requested a review from arvidn July 3, 2024 02:53
Copy link
Contributor

@arvidn arvidn left a comment

Choose a reason for hiding this comment

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

I really like this direction. There were some details that looked fishy

crates/clvm-traits/src/clvm_encoder.rs Show resolved Hide resolved
crates/clvm-traits/src/match_byte.rs Show resolved Hide resolved
crates/clvm-traits/src/match_byte.rs Outdated Show resolved Hide resolved
Copy link

coveralls-official bot commented Jul 15, 2024

Pull Request Test Coverage Report for Build 10134254330

Details

  • 260 of 291 (89.35%) changed or added relevant lines in 19 files are covered.
  • 289 unchanged lines in 12 files lost coverage.
  • Overall coverage decreased (-2.0%) to 80.63%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/chia-puzzles/src/puzzles/nft.rs 0 2 0.0%
crates/clvm-traits/src/wrappers.rs 0 2 0.0%
crates/clvm-traits/src/from_clvm.rs 21 24 87.5%
crates/clvm-traits/src/to_clvm.rs 26 29 89.66%
crates/clvm-traits/src/clvm_decoder.rs 1 9 11.11%
crates/clvm-traits/src/clvm_encoder.rs 5 18 27.78%
Files with Coverage Reduction New Missed Lines %
crates/clvm-traits/src/clvm_encoder.rs 1 57.5%
crates/clvm-traits/src/clvm_decoder.rs 1 75.0%
crates/chia-protocol/src/classgroup.rs 1 0.0%
crates/chia-bls/src/error.rs 4 0.0%
crates/chia-traits/src/streamable.rs 9 92.54%
crates/chia-bls/src/secret_key.rs 11 88.22%
crates/chia-bls/src/signature.rs 19 93.94%
crates/chia-bls/src/public_key.rs 19 89.9%
wheel/src/api.rs 43 66.41%
crates/chia-bls/src/gtelement.rs 47 9.47%
Totals Coverage Status
Change from base Build 10066449910: -2.0%
Covered Lines: 11372
Relevant Lines: 14104

💛 - Coveralls

crates/clvm-traits/src/clvm_encoder.rs Outdated Show resolved Hide resolved
crates/clvm-traits/src/match_byte.rs Outdated Show resolved Hide resolved
@Rigidity Rigidity requested a review from arvidn July 28, 2024 19:36
@Rigidity Rigidity merged commit 30b23f4 into main Jul 29, 2024
66 checks passed
@Rigidity Rigidity deleted the traits-encoder branch July 29, 2024 12:56
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.

2 participants