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

Pool certificates #321

Merged
merged 32 commits into from
Feb 26, 2024
Merged

Pool certificates #321

merged 32 commits into from
Feb 26, 2024

Conversation

KINGH242
Copy link
Contributor

I finally got around to cleaning up and writing some tests for the code to handle pool certificates as mentioned in #280.

This handles PoolRegistration and PoolRetirement Certificates. They can be added to transactions, and parsing transactions that contain them will now work correctly.

When registering a pool for the first time, the TransactionBuilder has a boolean value called initial_stake_pool_registration that can be set to true to add the pool deposit to the transaction.

I also added another boolean value called witness_override to the TransactionBuilder, which overrides the witness count when estimating the transaction fee. This is very useful for building transactions that multiple parties will sign and witness later.

HareemAtWave and others added 29 commits October 7, 2023 09:44
…r and network args method to use custom networks
add initial stake pool registration flag and deposit
add pool vkey hashes if certificate exists
# Conflicts:
#	pycardano/backend/cardano_cli.py
#	test/pycardano/backend/test_cardano_cli.py
@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 86.71587% with 36 lines in your changes are missing coverage. Please review.

Project coverage is 83.42%. Comparing base (d4ec506) to head (d79d8cf).

Files Patch % Lines
pycardano/certificate.py 79.71% 7 Missing and 7 partials ⚠️
pycardano/pool_params.py 93.75% 4 Missing and 4 partials ⚠️
pycardano/witness.py 70.37% 4 Missing and 4 partials ⚠️
pycardano/key.py 85.00% 2 Missing and 1 partial ⚠️
pycardano/txbuilder.py 81.25% 2 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   83.12%   83.42%   +0.30%     
==========================================
  Files          28       29       +1     
  Lines        3443     3705     +262     
  Branches      844      929      +85     
==========================================
+ Hits         2862     3091     +229     
- Misses        430      448      +18     
- Partials      151      166      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cffls
Copy link
Collaborator

cffls commented Feb 26, 2024

Thanks a ton for adding support for pool certificates! The changes look good overall. There are a few test cases failed when using python3 versions less than 3.10. I will look into it.

Syntax "Optional[type1 | type2]" is not supported in version <= 3.9
Copy link
Collaborator

@cffls cffls left a comment

Choose a reason for hiding this comment

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

Made a few places simpler. LGTM now!

@cffls cffls merged commit efbc2d2 into Python-Cardano:main Feb 26, 2024
11 checks passed
@KINGH242 KINGH242 deleted the pool-certificates branch February 26, 2024 11:35
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.

5 participants