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 all member functions to Program #291

Merged
merged 2 commits into from
Nov 30, 2023
Merged

add all member functions to Program #291

merged 2 commits into from
Nov 30, 2023

Conversation

arvidn
Copy link
Contributor

@arvidn arvidn commented Oct 25, 2023

matching chia.types.blockchain_format.SerializedProgram.

The main challenge in this PR is to mimic the Program.to() of the python version. This converts arbitrary python objects into a CLVM structure, to be passed as arguments to programs. The rust implementation of this is clvm_convert().
The python implementation can be found here:
https://github.com/Chia-Network/clvm/blob/main/clvm/SExp.py#L59-L115
and here:
https://github.com/Chia-Network/clvm/blob/main/clvm/SExp.py#L38-L55

There are tests for all types supported in this conversion on the rust side, as well as some testing to make sure the rust implementation behaves the same as the python one (test_program_fidelity.py)

@arvidn arvidn force-pushed the progran-py-binding branch 3 times, most recently from 9777627 to 8c5d881 Compare October 25, 2023 12:36
@coveralls-official
Copy link

coveralls-official bot commented Oct 25, 2023

Pull Request Test Coverage Report for Build 7020997868

  • 125 of 186 (67.2%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 85.601%

Changes Missing Coverage Covered Lines Changed/Added Lines %
clvm-traits/src/error.rs 0 6 0.0%
chia-protocol/src/program.rs 125 180 69.44%
Totals Coverage Status
Change from base Build 7020975872: -0.2%
Covered Lines: 10213
Relevant Lines: 11931

💛 - Coveralls

@arvidn arvidn force-pushed the progran-py-binding branch 6 times, most recently from 0048778 to ae30aa8 Compare October 26, 2023 00:18
@arvidn arvidn marked this pull request as ready for review October 26, 2023 11:50
chia-protocol/src/program.rs Outdated Show resolved Hide resolved
@arvidn arvidn force-pushed the progran-py-binding branch 3 times, most recently from 3b35143 to 2119e3c Compare October 31, 2023 10:50
@arvidn arvidn force-pushed the progran-py-binding branch 3 times, most recently from 3cf032d to 3f4bf12 Compare November 4, 2023 11:19
@arvidn arvidn force-pushed the progran-py-binding branch 6 times, most recently from f8afe9c to 5775fd2 Compare November 28, 2023 14:11
@arvidn arvidn merged commit e4a4512 into main Nov 30, 2023
54 checks passed
@arvidn arvidn deleted the progran-py-binding branch November 30, 2023 13:32
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