-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Methods to add certificate scripts for smart staking #388
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #388 +/- ##
==========================================
+ Coverage 85.30% 85.76% +0.46%
==========================================
Files 32 32
Lines 4213 4202 -11
Branches 1060 1052 -8
==========================================
+ Hits 3594 3604 +10
+ Misses 434 421 -13
+ Partials 185 177 -8 ☔ View full report in Codecov by Sentry. |
There are some QA issues, make sure to run
|
Apologies, I should have read the development section more thoroughly. |
No worries, I did the exact same in my first (few) PRs |
We seem to have run into a docker limitation with the CI. @cffls do you know anything about this? Maybe just need to wait a day and retry |
Coverage should be 100% for the changes made now if someone wants to approve the CI |
@@ -879,6 +930,8 @@ def _dfs(script: NativeScript): | |||
def _set_redeemer_index(self): | |||
# Set redeemers' index according to section 4.1 in | |||
# https://hydra.iohk.io/build/13099856/download/1/alonzo-changes.pdf | |||
# | |||
# There is no way to determine certificate index here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand correctly that the redeemer index is supposed to be directly set by the user according to the order in which they add certificates? (this is the way that it is currently implemented here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's how cardano-cli does it. I was thinking that if this causes confusion then the best alternative would be to create an add_certificate
method with optional arguments to add a script and redeemer. I assumed that would be a more major change that might be out of scope for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there script-less certificates?
Either way we can add this upon request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The majority of delegation seems to be done with certificates built from stake keys rather than scripts. I think smart staking is relatively niche at the moment.
Only thing that is missing would be a test that actually submits a transaction that requires spending a SC certificate. Given I neither added this in #308 and no one has complained that it doesn't work I would proceed and approve this. |
I presume you are referring to the tests in |
Yes |
I can't find a way to test withdrawing from a stake script based delegation as you get this error when trying to withdraw 0 ada:
Obviously there isn't time to allow rewards to accrue during a test. |
Ok. This sounds funny since a major hack of saving memory in recent SC development was using 0 withdrawals - but maybe this refers to another script type. |
Now you are also not a first-time contributor anymore and new PRs should have the CI run automatically :) |
Following on from #387 and #378, this should add support for staking with staking scripts.