Skip to content

Commit

Permalink
Add state query for RatifyState
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucsanszky authored and lehins committed Aug 1, 2024
1 parent 99f8d49 commit 5941afe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions libs/cardano-ledger-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1.9.3.0

* Add `queryRatifyState` state query
* Add `queryProposals` state query

## 1.9.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module Cardano.Ledger.Api.State.Query (
-- * @GetProposals@
queryProposals,

-- * @GetRatifyState@
queryRatifyState,

-- * For testing
getNextEpochCommitteeMembers,
) where
Expand Down Expand Up @@ -301,7 +304,7 @@ getNextEpochCommitteeMembers ::
NewEpochState era ->
Map (Credential 'ColdCommitteeRole (EraCrypto era)) EpochNo
getNextEpochCommitteeMembers nes =
let ratifyState = snd $ finishedPulserState nes
let ratifyState = queryRatifyState nes
committee = ratifyState ^. rsEnactStateL . ensCommitteeL
in foldMap' committeeMembers committee

Expand Down Expand Up @@ -339,6 +342,10 @@ queryProposals nes gids
DRComplete snap _rs -> snap ^. psProposalsL
DRPulsing DRepPulser {..} -> dpProposals

-- | Query ratification state.
queryRatifyState :: ConwayEraGov era => NewEpochState era -> RatifyState era
queryRatifyState = snd . finishedPulserState

finishedPulserState ::
ConwayEraGov era =>
NewEpochState era ->
Expand Down

0 comments on commit 5941afe

Please sign in to comment.