Skip to content

Commit

Permalink
Merge pull request #181 from input-output-hk/newhoggy/queryGenesisPar…
Browse files Browse the repository at this point in the history
…ameters-in-shelley-era-only

Modify `queryGenesisParameters` so that its type advertises it only returns genesis parameters for the Shelley era
  • Loading branch information
newhoggy authored Aug 10, 2023
2 parents 3e3222c + f3d3b46 commit 7f6d56d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cardano-api/internal/Cardano/Api/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ data QueryInShelleyBasedEra era result where
:: QueryInShelleyBasedEra era EpochNo

QueryGenesisParameters
:: QueryInShelleyBasedEra era GenesisParameters
:: QueryInShelleyBasedEra ShelleyEra GenesisParameters

QueryProtocolParameters
:: QueryInShelleyBasedEra era ProtocolParameters
Expand Down
8 changes: 4 additions & 4 deletions cardano-api/internal/Cardano/Api/Query/Expr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import Cardano.Api.ProtocolParameters
import Cardano.Api.Query
import Cardano.Api.Value

import Cardano.Ledger.Api
import qualified Cardano.Ledger.Api as L
import Cardano.Ledger.SafeHash
import Cardano.Slotting.Slot
import Ouroboros.Consensus.HardFork.Combinator.AcrossEras as Consensus
Expand Down Expand Up @@ -93,8 +93,8 @@ queryEraHistory =
queryExpr $ QueryEraHistory CardanoModeIsMultiEra

queryGenesisParameters :: ()
=> EraInMode era mode
-> ShelleyBasedEra era
=> EraInMode ShelleyEra mode
-> ShelleyBasedEra ShelleyEra
-> LocalStateQueryExpr block point (QueryInMode mode) r IO (Either UnsupportedNtcVersionError (Either EraMismatch GenesisParameters))
queryGenesisParameters eraInMode sbe =
queryExpr $ QueryInEra eraInMode $ QueryInShelleyBasedEra sbe QueryGenesisParameters
Expand Down Expand Up @@ -133,7 +133,7 @@ queryProtocolParameters eraInMode sbe =
queryConstitutionHash :: ()
=> EraInMode era mode
-> ShelleyBasedEra era
-> LocalStateQueryExpr block point (QueryInMode mode) r IO (Either UnsupportedNtcVersionError (Either EraMismatch (Maybe (SafeHash (EraCrypto (ShelleyLedgerEra era)) ByteString))))
-> LocalStateQueryExpr block point (QueryInMode mode) r IO (Either UnsupportedNtcVersionError (Either EraMismatch (Maybe (SafeHash (L.EraCrypto (ShelleyLedgerEra era)) ByteString))))
queryConstitutionHash eraInMode sbe =
queryExpr $ QueryInEra eraInMode $ QueryInShelleyBasedEra sbe QueryConstitutionHash

Expand Down

0 comments on commit 7f6d56d

Please sign in to comment.