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

feat: ✨ add support of stake validators #295

Merged
merged 11 commits into from
May 17, 2024
Merged

feat: ✨ add support of stake validators #295

merged 11 commits into from
May 17, 2024

Conversation

sourabhxyz
Copy link
Member

@sourabhxyz sourabhxyz commented Apr 23, 2024

Related to #294

Seeing the upcoming integration with clb, full support for plutus-simple-model is not yet implemented. We can mention this gotcha in Atlas's documentation.

…pdate of certificates and withdrawals

Related to #294.
…e to better enumerate through it

Related to #294
…equire for collateral in case of withdrawal/ceritificate script witness, improved privnet test now also including stake validator, modified api of `stakeAddressInfo` to now return `Nothing` in case key is not registered

Related to #294
…fining it's instance for `GYStakePoolId`

Related to #294
saInfos <- forM configs $ \config -> withCfgProviders config mempty $ \GYProviders {..} -> do
delayBySecond
gyGetStakeAddressInfo $ unsafeStakeAddressFromText "stake_test1upx0fuqcjqs4h5vp687d8j2cng4y5wkmelc6wzm5szq04qsm5d0l6"
assertBool "Stake address info are not all equal" $ allEqual saInfos
Copy link
Member Author

@sourabhxyz sourabhxyz Apr 28, 2024

Choose a reason for hiding this comment

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

Note that CI providers mashup test (which runs all of providers functions and checks for equality against different providers output) does not include local node - kupo provider but it was locally checked that gyGetStakeAddressInfo indeed returns same value for this test case.

@sourabhxyz sourabhxyz marked this pull request as ready for review April 28, 2024 09:49
@sourabhxyz sourabhxyz requested a review from a team as a code owner April 28, 2024 09:49
@@ -84,26 +90,31 @@ paymentCredentialToBech32 (GYPaymentCredentialByScript sh) = serialiseToBech32Wi
-- | Stake credential.
data GYStakeCredential
= GYStakeCredentialByKey !GYStakeKeyHash
| GYStakeCredentialByScript !GYValidatorHash
| GYStakeCredentialByScript !GYStakeValidatorHash
Copy link
Member Author

Choose a reason for hiding this comment

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

Though this is a breaking change but as GYStakeCredentialByScript wasn't being made use of by any external API provided by Atlas, I assume it won't have effect for end users.

@@ -43,14 +44,18 @@ newtype GYPubKeyHash = GYPubKeyHash (Api.Hash Api.PaymentKey)
deriving stock Show
deriving newtype (Eq, Ord, IsString)

class CanSignTx a where
class AsPubKeyHash a where
Copy link
Member Author

Choose a reason for hiding this comment

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

A new class AsPubKeyHash is introduced with essentially same members as earlier CanSignTx. Idea is to make AsPubKeyHash a super class of CanSignTx since AsPubKeyHash is useful for other credentials which do not have any relation with signing such as GYStakePoolId.

Copy link
Contributor

@ajuggler ajuggler left a comment

Choose a reason for hiding this comment

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

Reviewed.

@ajuggler ajuggler merged commit 3ce5a7e into main May 17, 2024
2 checks passed
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.

2 participants