Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@ constraints:
source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-api
tag: 076f7e966ec1d6457b1b9ec5ceee0f9e598fed12
--sha256: sha256-XmuQTZdD/ZdCNlRuD+V5cNslEM05xwTACmMunzuCCJY=
tag: 79b751a77ef2a4ecda563b6ec1855c7ef4653046
--sha256: sha256-pb6eF52jUXvCCdY6hg80Z16E8FpNVfDR1eQMKeZxH4E=
subdir:
cardano-api



source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus
Expand Down Expand Up @@ -127,4 +126,4 @@ source-repository-package
libs/non-integral
libs/set-algebra
libs/small-steps
libs/vector-map
libs/vector-map
2 changes: 0 additions & 2 deletions cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,11 @@ library
network,
network-uri,
optparse-applicative-fork,
ouroboros-consensus,
ouroboros-consensus-cardano,
prettyprinter,
prettyprinter-ansi-terminal,
random,
rio,
sop-extras,
split,
io-classes:strict-stm,
text,
Expand Down
35 changes: 2 additions & 33 deletions cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ import Cardano.Ledger.Conway.State (ChainAccountState (..))
import Cardano.Slotting.EpochInfo (EpochInfo (..), epochInfoSlotToUTCTime, hoistEpochInfo)
import Cardano.Slotting.Time (RelativeTime (..), toRelativeTime)
import Ouroboros.Consensus.Cardano.Block as Consensus
import Ouroboros.Consensus.HardFork.Combinator.NetworkVersion
import Ouroboros.Consensus.Node.NetworkProtocolVersion
import Ouroboros.Consensus.Shelley.Ledger.NetworkProtocolVersion

import RIO hiding (toList)

Expand All @@ -82,7 +79,6 @@ import Data.ByteString.Lazy.Char8 qualified as LBS
import Data.Coerce (coerce)
import Data.List qualified as List
import Data.Map.Strict qualified as Map
import Data.SOP.Index
import Data.Sequence qualified as Seq
import Data.Set qualified as Set
import Data.Text qualified as Text
Expand Down Expand Up @@ -878,7 +874,7 @@ runQueryLedgerPeerSnapshot
} = do
result <-
fromEitherIOCli
( executeLocalStateQueryExprWithVersion nodeConnInfo target $ \globalNtcVersion -> runExceptT $ do
( executeLocalStateQueryExpr nodeConnInfo target $ runExceptT $ do
AnyCardanoEra cEra <-
lift queryCurrentEra
& onLeft (left . QueryCmdUnsupportedNtcVersion)
Expand All @@ -888,13 +884,8 @@ runQueryLedgerPeerSnapshot

result <- easyRunQuery (queryLedgerPeerSnapshot sbe)

shelleyNtcVersion <- hoistEither $ getShelleyNodeToClientVersion era globalNtcVersion
pure $ Right result

hoist liftIO $
obtainCommonConstraints era $
case decodeBigLedgerPeerSnapshot shelleyNtcVersion result of
Left (bs, _decoderError) -> pure $ Left bs
Right snapshot -> pure $ Right snapshot
)
& fromEitherCIOCli

Expand Down Expand Up @@ -1065,28 +1056,6 @@ getQueryStakeAddressInfo

-- -------------------------------------------------------------------------------------------------

getShelleyNodeToClientVersion
:: Exp.Era era -> NodeToClientVersion -> Either QueryCmdError ShelleyNodeToClientVersion
getShelleyNodeToClientVersion era globalNtcVersion =
case supportedNodeToClientVersions (Proxy @(CardanoBlock StandardCrypto)) Map.! globalNtcVersion of
HardForkNodeToClientEnabled _ np ->
case era of
Exp.ConwayEra ->
case projectNP conwayIndex np of
EraNodeToClientDisabled -> Left QueryCmdNodeToClientDisabled
EraNodeToClientEnabled shelleyNtcVersion -> return shelleyNtcVersion
Exp.DijkstraEra ->
case projectNP dijkstraIndex np of
EraNodeToClientDisabled -> Left QueryCmdNodeToClientDisabled
EraNodeToClientEnabled shelleyNtcVersion -> return shelleyNtcVersion
HardForkNodeToClientDisabled _ -> Left QueryCmdNodeToClientDisabled

conwayIndex :: Index (x'1 : x'2 : x'3 : x'4 : x'5 : x'6 : x : xs1) x
conwayIndex = (IS (IS (IS (IS (IS (IS IZ))))))

dijkstraIndex :: Index (x'1 : x'2 : x'3 : x'4 : x'5 : x'6 : x'7 : x : xs1) x
dijkstraIndex = (IS (IS (IS (IS (IS (IS (IS IZ)))))))

writeStakeAddressInfo
:: StakeAddressInfoData
-> Vary [FormatJson, FormatYaml]
Expand Down
Loading