@@ -149,6 +149,8 @@ data QueryInMode result where
149149 :: QueryInMode (WithOrigin BlockNo )
150150 QueryChainPoint
151151 :: QueryInMode ChainPoint
152+ QueryLedgerConfig
153+ :: QueryInMode (Consensus. CardanoLedgerConfig StandardCrypto )
152154
153155instance NodeToClientVersionOf (QueryInMode result ) where
154156 nodeToClientVersionOf = \ case
@@ -158,6 +160,7 @@ instance NodeToClientVersionOf (QueryInMode result) where
158160 QuerySystemStart -> NodeToClientV_16
159161 QueryChainBlockNo -> NodeToClientV_16
160162 QueryChainPoint -> NodeToClientV_16
163+ QueryLedgerConfig -> NodeToClientV_20
161164
162165data EraHistory where
163166 EraHistory
@@ -298,6 +301,9 @@ data QueryInShelleyBasedEra era result where
298301 -> QueryInShelleyBasedEra era (Seq (L. GovActionState (ShelleyLedgerEra era )))
299302 QueryLedgerPeerSnapshot
300303 :: QueryInShelleyBasedEra era (Serialised LedgerPeerSnapshot )
304+ QueryStakePoolDefaultVote
305+ :: Ledger. KeyHash 'Ledger.StakePool
306+ -> QueryInShelleyBasedEra era L. DefaultVote
301307
302308-- | Mapping for queries in Shelley-based eras returning minimal node-to-client protocol versions. More
303309-- information about queries versioning can be found:
@@ -333,6 +339,7 @@ instance NodeToClientVersionOf (QueryInShelleyBasedEra era result) where
333339 nodeToClientVersionOf QueryRatifyState {} = NodeToClientV_17
334340 nodeToClientVersionOf QueryFuturePParams {} = NodeToClientV_18
335341 nodeToClientVersionOf QueryLedgerPeerSnapshot = NodeToClientV_19
342+ nodeToClientVersionOf QueryStakePoolDefaultVote {} = NodeToClientV_20
336343
337344deriving instance Show (QueryInShelleyBasedEra era result )
338345
@@ -557,6 +564,7 @@ toConsensusQuery (QueryInEra QueryByronUpdateState) =
557564 Consensus. GetUpdateInterfaceState
558565toConsensusQuery (QueryInEra (QueryInShelleyBasedEra sbe q)) =
559566 shelleyBasedEraConstraints sbe $ toConsensusQueryShelleyBased sbe q
567+ toConsensusQuery QueryLedgerConfig = Some Consensus. GetLedgerConfig
560568
561569toConsensusQueryShelleyBased
562570 :: forall era protocol block result
@@ -709,6 +717,16 @@ toConsensusQueryShelleyBased sbe = \case
709717 sbe
710718 QueryLedgerPeerSnapshot ->
711719 Some (consensusQueryInEraInMode era (Consensus. GetCBOR Consensus. GetBigLedgerPeerSnapshot ))
720+ QueryStakePoolDefaultVote govActs ->
721+ caseShelleyToBabbageOrConwayEraOnwards
722+ ( const $
723+ error " toConsensusQueryShelleyBased: QueryStakePoolDefaultVote is only available in the Conway era"
724+ )
725+ ( const $
726+ Some
727+ (consensusQueryInEraInMode era (Consensus. QueryStakePoolDefaultVote govActs))
728+ )
729+ sbe
712730 where
713731 era = toCardanoEra sbe
714732
@@ -770,6 +788,11 @@ fromConsensusQueryResult QueryCurrentEra q' r' =
770788 Consensus. BlockQuery (Consensus. QueryHardFork Consensus. GetCurrentEra ) ->
771789 fromConsensusEraIndex r'
772790 _ -> fromConsensusQueryResultMismatch
791+ fromConsensusQueryResult QueryLedgerConfig q' r' =
792+ case q' of
793+ Consensus. GetLedgerConfig ->
794+ r'
795+ _ -> fromConsensusQueryResultMismatch
773796fromConsensusQueryResult (QueryInEra QueryByronUpdateState ) q' r' =
774797 case q' of
775798 Consensus. BlockQuery
@@ -1006,6 +1029,11 @@ fromConsensusQueryResultShelleyBased sbe sbeQuery q' r' =
10061029 Consensus. GetCBOR Consensus. GetBigLedgerPeerSnapshot ->
10071030 r'
10081031 _ -> fromConsensusQueryResultMismatch
1032+ QueryStakePoolDefaultVote {} ->
1033+ case q' of
1034+ Consensus. QueryStakePoolDefaultVote {} ->
1035+ r'
1036+ _ -> fromConsensusQueryResultMismatch
10091037
10101038-- | This should /only/ happen if we messed up the mapping in 'toConsensusQuery'
10111039-- and 'fromConsensusQueryResult' so they are inconsistent with each other.
0 commit comments