Skip to content

Commit

Permalink
Use correct pattern for stake deregistration certs in Conway
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer committed Oct 21, 2024
1 parent 07ca594 commit 698a69c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
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

0 comments on commit 698a69c

Please sign in to comment.