From c1ead6e0996eb8246e8fcc77996b75567ef59514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hurlin?= Date: Wed, 20 Nov 2024 11:15:55 +0100 Subject: [PATCH] Cleanup --- cardano-api/internal/Cardano/Api/Query.hs | 9 ++----- .../internal/Cardano/Api/Query/Expr.hs | 25 ++++--------------- 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/cardano-api/internal/Cardano/Api/Query.hs b/cardano-api/internal/Cardano/Api/Query.hs index ff2bb8aa9..4ff06b636 100644 --- a/cardano-api/internal/Cardano/Api/Query.hs +++ b/cardano-api/internal/Cardano/Api/Query.hs @@ -125,6 +125,7 @@ import Data.Either.Combinators (rightToMaybe) import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Data.Maybe (mapMaybe) +import Data.Sequence (Seq) import Data.Set (Set) import qualified Data.Set as Set import Data.SOP.Constraint (SListI) @@ -133,7 +134,6 @@ import qualified Data.Text as Text import Data.Word (Word64) import GHC.Exts (IsList (..)) import GHC.Stack -import Data.Sequence (Seq) -- ---------------------------------------------------------------------------- -- Queries @@ -299,7 +299,7 @@ data QueryInShelleyBasedEra era result where -> QueryInShelleyBasedEra era (Map StakeCredential (Ledger.DRep StandardCrypto)) QueryProposals :: Set (L.GovActionId StandardCrypto) - -> QueryInShelleyBasedEra era (Seq (L.GovActionState (ShelleyLedgerEra era)){-StandardCrypto-}) + -> QueryInShelleyBasedEra era (Seq (L.GovActionState (ShelleyLedgerEra era {-StandardCrypto-}))) -- | Mapping for queries in Shelley-based eras returning minimal node-to-client protocol versions. More -- information about queries versioning can be found: @@ -1005,11 +1005,6 @@ fromConsensusQueryResultShelleyBased sbe sbeQuery q' r' = r' _ -> fromConsensusQueryResultMismatch --- QueryProposals :: forall era. --- Set (GovActionId StandardCrypto) --- -> QueryInShelleyBasedEra era (Seq (GovActionState era)) - - -- | This should /only/ happen if we messed up the mapping in 'toConsensusQuery' -- and 'fromConsensusQueryResult' so they are inconsistent with each other. -- diff --git a/cardano-api/internal/Cardano/Api/Query/Expr.hs b/cardano-api/internal/Cardano/Api/Query/Expr.hs index 9e01d541e..32112673e 100644 --- a/cardano-api/internal/Cardano/Api/Query/Expr.hs +++ b/cardano-api/internal/Cardano/Api/Query/Expr.hs @@ -68,9 +68,9 @@ import Cardano.Slotting.Slot import Ouroboros.Consensus.HardFork.Combinator.AcrossEras as Consensus import Data.Map (Map) +import Data.Sequence (Seq) import Data.Set (Set) import qualified Data.Set as S -import Data.Sequence (Seq) queryChainBlockNo :: () @@ -493,22 +493,6 @@ queryAccountState cOnwards = QueryInEra . QueryInShelleyBasedEra (inject cOnwards :: ShelleyBasedEra era) $ QueryAccountState --- queryDRepState --- :: forall era block point r --- . ConwayEraOnwards era --- -> Set (L.Credential L.DRepRole L.StandardCrypto) --- -- ^ An empty credentials set means that states for all DReps will be returned --- -> LocalStateQueryExpr --- block --- point --- QueryInMode --- r --- IO --- ( Either --- UnsupportedNtcVersionError --- (Either EraMismatch (Map (L.Credential L.DRepRole L.StandardCrypto) (L.DRepState L.StandardCrypto))) --- ) - queryProposals :: forall era block point r . ConwayEraOnwards era @@ -519,11 +503,12 @@ queryProposals QueryInMode r IO - (Either UnsupportedNtcVersionError (Either EraMismatch (Seq (L.GovActionState (ShelleyLedgerEra era))))) + ( Either + UnsupportedNtcVersionError + (Either EraMismatch (Seq (L.GovActionState (ShelleyLedgerEra era)))) + ) queryProposals cOnwards govActionIds = do let sbe :: ShelleyBasedEra era = inject cOnwards queryExpr $ QueryInEra . QueryInShelleyBasedEra sbe $ QueryProposals govActionIds - - \ No newline at end of file