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

Cardano cli chain context #274

Merged
merged 15 commits into from
Feb 6, 2024
Merged

Cardano cli chain context #274

merged 15 commits into from
Feb 6, 2024

Conversation

KINGH242
Copy link
Contributor

@KINGH242 KINGH242 commented Oct 8, 2023

No description provided.

@cffls
Copy link
Collaborator

cffls commented Oct 14, 2023

Thanks, this is great! Looks good overall. I think it needs some integration test with cardano-cli, we can add the tests to here.

Copy link
Contributor

@nielstron nielstron left a comment

Choose a reason for hiding this comment

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

I did some formatting - make sure to run make qa to ensure that QA tests pass for your code. Formatting can be simply done with black .

pycardano/backend/cardano_cli.py Outdated Show resolved Hide resolved
pycardano/backend/cardano_cli.py Outdated Show resolved Hide resolved
@KINGH242
Copy link
Contributor Author

KINGH242 commented Nov 1, 2023

Thanks for the review and feedback. I will work on the fixes over the coming week.

@KINGH242
Copy link
Contributor Author

KINGH242 commented Nov 2, 2023

Thanks, this is great! Looks good overall. I think it needs some integration test with cardano-cli, we can add the tests to here.

I will work on adding integration tests for the cardano-cli chain context next. But to do so, I will need to add the Docker SDK for Python package. This will be an improvement to the cardano-cli chain context that would allow the user to use PyCardano with the cardano-cli in a Docker container.

@nielstron
Copy link
Contributor

@KINGH242 the PyCardano already contains integrations tests, which are run in a docker container with Ogmios (and likely also the cardano CLI accessible) - I think the Ogmios endpoint is also tested there.

Just pointing you in case you were not aware :)
https://github.com/Python-Cardano/pycardano/tree/main/integration-test

@cffls
Copy link
Collaborator

cffls commented Nov 3, 2023

likely also the cardano CLI accessible

This is correct. cardano-cli is runnable in the docker container. This is an example where a transaction is created from cardano-cli.

@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2023

Codecov Report

Attention: 87 lines in your changes are missing coverage. Please review.

Comparison is base (df5ba28) 84.51% compared to head (753e630) 83.17%.
Report is 1 commits behind head on main.

Files Patch % Lines
pycardano/backend/cardano_cli.py 65.32% 64 Missing and 22 partials ⚠️
pycardano/backend/base.py 0.00% 0 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     #274      +/-   ##
==========================================
- Coverage   84.51%   83.17%   -1.34%     
==========================================
  Files          27       28       +1     
  Lines        3093     3412     +319     
  Branches      758      835      +77     
==========================================
+ Hits         2614     2838     +224     
- Misses        358      424      +66     
- Partials      121      150      +29     

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

@KINGH242 KINGH242 requested a review from nielstron December 2, 2023 13:05
@cffls
Copy link
Collaborator

cffls commented Jan 1, 2024

Looks good to me. Added more integration tests. I noticed that evaluate_tx_cbor is not implemented in CardanoCliChainContext. Is it because cardano-cli is not able to evaluate a tx?

@KINGH242
Copy link
Contributor Author

KINGH242 commented Jan 1, 2024

I just realized that this can be done using ‘transaction build ... --calculate-plutus-script-cost’. Never saw or used it before. I will implement it this week.

@nielstron
Copy link
Contributor

I just realized that this can be done using ‘transaction build ... --calculate-plutus-script-cost’. Never saw or used it before. I will implement it this week.

I just realized that going through the calculate-plutus-script-cost is quite painful because we would need to essentially disassemble the transaction for the cli to re-build it. I think this is fine to be merged as-is and a cost estimation can be added later based on a per-demand basis.

Moreover, uplc 1.0.0 could be used to estimate script cost now entirely without the need of any backend so the estimation based on cli or ogmios or blockfrost might become unneccessary.

@nielstron nielstron merged commit 54ec756 into Python-Cardano:main Feb 6, 2024
11 checks passed
@cffls
Copy link
Collaborator

cffls commented Feb 6, 2024

Awesome! It would be great if we can get rid of the dependency on chain context for fee estimation.

@KINGH242 KINGH242 deleted the cardano-cli-chain-context branch February 8, 2024 15:03
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