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

Use correct pattern for stake deregistration certs in Conway #657

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions cardano-api/internal/Cardano/Api/Certificate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -526,28 +526,28 @@ filterUnRegCreds =
Ledger.GenesisDelegTxCert{} -> Nothing
ConwayCertificate cEra conwayCert -> conwayEraOnwardsConstraints cEra $
case conwayCert of
Ledger.RegTxCert _ -> Nothing
Ledger.UnRegTxCert cred -> Just cred
Ledger.RegPoolTxCert _ -> Nothing
Ledger.RetirePoolTxCert _ _ -> Nothing
Ledger.RegDepositTxCert _ _ -> Nothing
Ledger.UnRegDepositTxCert _ _ -> Nothing
Ledger.UnRegDepositTxCert cred _ -> Just cred
Ledger.DelegTxCert _ _ -> Nothing
Ledger.RegDepositDelegTxCert{} -> Nothing
Ledger.AuthCommitteeHotKeyTxCert{} -> Nothing
Ledger.ResignCommitteeColdTxCert{} -> Nothing
Ledger.RegDRepTxCert{} -> Nothing
Ledger.UnRegDRepTxCert{} -> Nothing
Ledger.UpdateDRepTxCert{} -> Nothing
-- those are old shelley patterns
Ledger.RegTxCert _ -> Nothing
-- stake cred deregistration w/o deposit
Ledger.UnRegTxCert cred -> Just cred

filterUnRegDRepCreds
:: Certificate era -> Maybe (Ledger.Credential Ledger.DRepRole Ledger.StandardCrypto)
filterUnRegDRepCreds = \case
ShelleyRelatedCertificate _ _ -> Nothing
ConwayCertificate cEra conwayCert -> conwayEraOnwardsConstraints cEra $
case conwayCert of
Ledger.RegTxCert _ -> Nothing
Ledger.UnRegTxCert _ -> Nothing
Ledger.RegPoolTxCert _ -> Nothing
Ledger.RetirePoolTxCert _ _ -> Nothing
Ledger.RegDepositTxCert _ _ -> Nothing
Expand All @@ -559,6 +559,10 @@ filterUnRegDRepCreds = \case
Ledger.RegDRepTxCert{} -> Nothing
Ledger.UnRegDRepTxCert cred _ -> Just cred
Ledger.UpdateDRepTxCert{} -> Nothing
-- those are old shelley patterns
Ledger.RegTxCert _ -> Nothing
-- stake cred deregistration w/o deposit
Ledger.UnRegTxCert _ -> Nothing

-- ----------------------------------------------------------------------------
-- Internal conversion functions
Expand Down
1 change: 1 addition & 0 deletions cardano-api/internal/Cardano/Api/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ shelleyGenesisDefaults =
-- pot = tx_fees + ρ * remaining_reserves
& ppRhoL .~ unsafeBR (1 % 10) -- How much of reserves goes into pot
& ppTauL .~ unsafeBR (1 % 10) -- τ * remaining_reserves is sent to treasury every epoch
& ppKeyDepositL .~ 400000 -- require a non-zero deposit when registering keys
, -- genesis keys and initial funds
sgGenDelegs = M.empty
, sgStaking = emptyGenesisStaking
Expand Down
Loading