@@ -125,6 +125,7 @@ import Data.Either.Combinators (rightToMaybe)
125125import Data.Map.Strict (Map )
126126import qualified Data.Map.Strict as Map
127127import Data.Maybe (mapMaybe )
128+ import Data.Sequence (Seq )
128129import Data.Set (Set )
129130import qualified Data.Set as Set
130131import Data.SOP.Constraint (SListI )
@@ -296,6 +297,9 @@ data QueryInShelleyBasedEra era result where
296297 QueryStakeVoteDelegatees
297298 :: Set StakeCredential
298299 -> QueryInShelleyBasedEra era (Map StakeCredential (Ledger. DRep StandardCrypto ))
300+ QueryProposals
301+ :: Set (L. GovActionId StandardCrypto )
302+ -> QueryInShelleyBasedEra era (Seq (L. GovActionState (ShelleyLedgerEra era )))
299303
300304-- | Mapping for queries in Shelley-based eras returning minimal node-to-client protocol versions. More
301305-- information about queries versioning can be found:
@@ -328,6 +332,7 @@ instance NodeToClientVersionOf (QueryInShelleyBasedEra era result) where
328332 nodeToClientVersionOf QuerySPOStakeDistr {} = NodeToClientV_16
329333 nodeToClientVersionOf QueryCommitteeMembersState {} = NodeToClientV_16
330334 nodeToClientVersionOf QueryStakeVoteDelegatees {} = NodeToClientV_16
335+ nodeToClientVersionOf QueryProposals {} = NodeToClientV_17
331336
332337deriving instance Show (QueryInShelleyBasedEra era result )
333338
@@ -703,6 +708,16 @@ toConsensusQueryShelleyBased sbe = \case
703708 where
704709 creds' :: Set (Shelley. Credential Shelley. Staking StandardCrypto )
705710 creds' = Set. map toShelleyStakeCredential creds
711+ QueryProposals govActs ->
712+ caseShelleyToBabbageOrConwayEraOnwards
713+ ( const $
714+ error " toConsensusQueryShelleyBased: QueryProposals is only available in the Conway era"
715+ )
716+ ( const $
717+ Some
718+ (consensusQueryInEraInMode era (Consensus. GetProposals govActs))
719+ )
720+ sbe
706721 where
707722 era = toCardanoEra sbe
708723
@@ -984,6 +999,11 @@ fromConsensusQueryResultShelleyBased sbe sbeQuery q' r' =
984999 Consensus. GetFilteredVoteDelegatees {} ->
9851000 Map. mapKeys fromShelleyStakeCredential r'
9861001 _ -> fromConsensusQueryResultMismatch
1002+ QueryProposals {} ->
1003+ case q' of
1004+ Consensus. GetProposals {} ->
1005+ r'
1006+ _ -> fromConsensusQueryResultMismatch
9871007
9881008-- | This should /only/ happen if we messed up the mapping in 'toConsensusQuery'
9891009-- and 'fromConsensusQueryResult' so they are inconsistent with each other.
0 commit comments