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

Support registration certificates #19

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sjoerdvisscher
Copy link
Collaborator

Fixes #18

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense and have useful messages
    • Important changes are reflected in changelog.d of the affected packages
    • Relevant tickets are mentioned in commit messages
  • PR
    • (For external contributions) Corresponding issue exists and is linked in the description
    • Targeting main unless this is a cherry-pick backport
    • Self-reviewed the diff
    • Useful pull request description
    • If relevant, reference the ADR in the PR and reference the PR in the ADR
    • Reviewer requested

(C.StakeAddrRegistrationPreConway C.ShelleyToBabbageEraBabbage stakeCred)
tx =
E.emptyTxBodyContent
{ C.txCertificates = C.TxCertificates C.shelleyBasedEra [stakeCert] (C.BuildTxWith mempty)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@james-iohk It feels weird that this validates: an empty BuildTxWith and no extra witnesses needed?

Choose a reason for hiding this comment

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

Seems to be the case pre cardano-node-8.8. It appears to be fixed from 8.8.

@fallen-icarus
Copy link

I appreciate you spending the time on this! I tried using this PR's code to see if I could now execute a staking script but I could not. While the registration transaction now successfully goes through, I now get the following error when I withdraw 0 ADA:

[WARNING] TxnValidation af8148a03e0bf6dccf5fe746c6c93559b3ba27ca5a7a80651d2ff53589d8ae1b
          Validation failed in phase 1: CardanoLedgerValidationError "ApplyTxError [DelegsFailure (WithdrawalsNotInRewardsDELEGS (fromList [(RewardAcnt {getRwdNetwork = Testnet, getRwdCred = ScriptHashObj (ScriptHash \"47cec2a1404ed91fc31124f29db15dc1aae77e0617868bcef351b8fd\")},Coin 0)]))]"

I get this error even if the staking script is not registered. Were you able to execute a staking script?

@sjoerdvisscher
Copy link
Collaborator Author

@fallen-icarus No. A quick look at what this errors means suggests that the emulator would have to maintain delegation state to get this to work. Unfortunately I no longer work on the emulator (nor anyone else), so this looks like a dead end for now.

@sjoerdvisscher sjoerdvisscher force-pushed the GH-18-support-registration-deposits branch from 7344c78 to 8923ffd Compare March 19, 2024 10:22
@sjoerdvisscher
Copy link
Collaborator Author

@fallen-icarus I'm getting the chance to work a bit longer on the emulator! And maintaining the delegation state didn't seem too hard to do. If you want you can try your scripts again!

@fallen-icarus
Copy link

It seems to be working now! Thank you!

@sjoerdvisscher
Copy link
Collaborator Author

@fallen-icarus Thanks for verifying so quickly, that's really helpful!

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.

Emulator does not account for registration deposits when balancing transactions
3 participants