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 wrap constructor to V1/V2 StakeCredential #1023

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

solidsnakedev
Copy link
Contributor

I'm not entirely sure if this is the right approach, but I wanted to suggest a potential solution to the missing constructor when a V1/V2 validator Purpose is of the Rewarding type. In such cases, the StakingCredential type must be wrapped in a StakingHash constructor as per the Plutus Ledger API for V1/V2:
Previous Aiken versions used to encode the StakeCredential as follows:
121([_ 122([_ h\'524A8B6C686BF0C225C8BC8EB63100BDF1047A35599626878EDF3BFE\'])])

For V3, however, this extra constructor in the Rewarding Purpose is not required , which seems to be correctly reflected in the latest Aiken version:

I'd also suggest renaming StakeCredential to Credential, as the current name can be misleading.

pub enum StakeCredential {
    AddrKeyhash(AddrKeyhash),
    Scripthash(Scripthash),
}

@solidsnakedev solidsnakedev requested a review from a team as a code owner September 18, 2024 14:27
@KtorZ
Copy link
Member

KtorZ commented Sep 18, 2024

Duh, that's an oversight as you can see it's being done in every other places. And since we got rid of the acceptance tests for V2 recently, this has slipped through the cracks 😬 ...

Thanks.

@KtorZ KtorZ merged commit 7155b4e into aiken-lang:main Sep 20, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ In Next Release
Development

Successfully merging this pull request may close these issues.

2 participants