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

Switch to #[classmethod] for SpendBundle::py_aggregate #678

Merged
merged 33 commits into from
Sep 23, 2024

Conversation

matt-o-how
Copy link
Contributor

This will allow derived classes to return themselves rather than the SpendBundle parent class

Copy link

coveralls-official bot commented Aug 26, 2024

Pull Request Test Coverage Report for Build 10882840971

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

  • 120 of 169 (71.01%) changed or added relevant lines in 10 files are covered.
  • 15 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.02%) to 83.863%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/chia-bls/src/gtelement.rs 0 5 0.0%
crates/chia-bls/src/public_key.rs 8 13 61.54%
crates/chia-bls/src/secret_key.rs 8 13 61.54%
crates/chia-bls/src/signature.rs 8 13 61.54%
crates/chia-protocol/src/coin_spend.rs 0 5 0.0%
crates/chia-protocol/src/coin.rs 0 6 0.0%
crates/chia-protocol/src/program.rs 0 6 0.0%
crates/chia-consensus/src/gen/owned_conditions.rs 0 12 0.0%
Files with Coverage Reduction New Missed Lines %
crates/chia-consensus/src/gen/owned_conditions.rs 1 83.91%
crates/chia-consensus/src/spendbundle_validation.rs 1 99.71%
crates/chia-consensus/src/gen/make_aggsig_final_message.rs 1 98.59%
crates/clvm-derive/src/from_clvm.rs 2 98.78%
crates/clvm-derive/src/to_clvm.rs 3 98.1%
crates/clvm-derive/src/parser/attributes.rs 7 86.67%
Totals Coverage Status
Change from base Build 10422144649: -0.02%
Covered Lines: 12483
Relevant Lines: 14885

💛 - Coveralls

@Rigidity
Copy link
Contributor

Did you change the line endings in these files? The diff seems way too large

@matt-o-how matt-o-how requested a review from arvidn August 27, 2024 13:43
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 would have thought you'd need to use the passed-in cls type eomshow

crates/chia_py_streamable_macro/src/lib.rs Outdated Show resolved Hide resolved
crates/chia-protocol/src/spend_bundle.rs Outdated Show resolved Hide resolved
@arvidn arvidn requested a review from Rigidity August 27, 2024 14:12
@arvidn
Copy link
Contributor

arvidn commented Sep 4, 2024

we should try going back to invoking the derived class with all the fields of the class itself, as if it is a dataclass

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 think there are a few simplification opportunities in the error propagation, and I think the type stubs can be improved

crates/chia-protocol/src/coin_spend.rs Outdated Show resolved Hide resolved
crates/chia-protocol/src/spend_bundle.rs Outdated Show resolved Hide resolved
crates/chia_py_streamable_macro/src/lib.rs Outdated Show resolved Hide resolved
crates/chia_py_streamable_macro/src/lib.rs Outdated Show resolved Hide resolved
crates/chia_py_streamable_macro/src/lib.rs Outdated Show resolved Hide resolved
wheel/generate_type_stubs.py Outdated Show resolved Hide resolved
wheel/generate_type_stubs.py Outdated Show resolved Hide resolved
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.

looking good. I thought you used to have a python test as well, to ensure it works

crates/chia_py_streamable_macro/src/lib.rs Show resolved Hide resolved
crates/chia-bls/src/signature.rs Outdated Show resolved Hide resolved
crates/chia-protocol/src/spend_bundle.rs Outdated Show resolved Hide resolved
crates/chia_py_streamable_macro/src/lib.rs Outdated Show resolved Hide resolved
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.

look good, you just missed one place that sill uses with_gil()

crates/chia-protocol/src/coin_spend.rs Outdated Show resolved Hide resolved
matt-o-how and others added 2 commits September 16, 2024 11:45
@matt-o-how matt-o-how merged commit aba5895 into main Sep 23, 2024
60 checks passed
@matt-o-how matt-o-how deleted the spendbundle_classmethods branch September 23, 2024 10:07
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.

3 participants