Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Nov 20, 2024
1 parent 3535d8a commit c1ead6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
9 changes: 2 additions & 7 deletions cardano-api/internal/Cardano/Api/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
--
Expand Down
25 changes: 5 additions & 20 deletions cardano-api/internal/Cardano/Api/Query/Expr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
:: ()
Expand Down Expand Up @@ -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
Expand All @@ -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


0 comments on commit c1ead6e

Please sign in to comment.