Skip to content

Commit

Permalink
wip - review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
crocodile-dentist committed May 23, 2024
1 parent 12e01d7 commit fef7482
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cardano-api/internal/Cardano/Api/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ import Data.Text (Text)
import qualified Data.Text as Text
import Data.Word (Word64)
import GHC.Stack
import qualified Ouroboros.Consensus.Shelley.Ledger.Query as Consensus

Check warning

Code scanning / HLint

Use fewer imports Warning

cardano-api/internal/Cardano/Api/Query.hs:149:1-70: Warning: Use fewer imports
  
Found:
  import qualified Ouroboros.Consensus.Shelley.Ledger.Query as Consensus
  import qualified Ouroboros.Consensus.Shelley.Ledger.Query as Consensus
  
Perhaps:
  import qualified Ouroboros.Consensus.Shelley.Ledger.Query as Consensus
import qualified Ouroboros.Consensus.Shelley.Ledger.Query as Consensus


-- ----------------------------------------------------------------------------
Expand Down Expand Up @@ -711,7 +713,7 @@ toConsensusQueryShelleyBased sbe = \case
creds' = Set.map toShelleyStakeCredential creds

QueryLedgerPeerSnapshot ->
Some (consensusQueryInEraInMode era (Consensus.GetCBOR Consensus.GetPeerSnapshot))
Some (consensusQueryInEraInMode era (Consensus.GetCBOR Consensus.GetBigLedgerPeerSnapshot))

where
era = shelleyBasedToCardanoEra sbe
Expand Down Expand Up @@ -979,7 +981,7 @@ fromConsensusQueryResultShelleyBased _ QueryStakeVoteDelegatees{} q' delegs' =

fromConsensusQueryResultShelleyBased _ QueryLedgerPeerSnapshot q' serLedgerPeerSnapshot =
case q' of
Consensus.GetCBOR Consensus.GetPeerSnapshot -> serLedgerPeerSnapshot
Consensus.GetCBOR Consensus.GetBigLedgerPeerSnapshot -> serLedgerPeerSnapshot
_ -> fromConsensusQueryResultMismatch

-- | This should /only/ happen if we messed up the mapping in 'toConsensusQuery'
Expand Down

0 comments on commit fef7482

Please sign in to comment.