Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
bartfrenk committed Oct 22, 2022
1 parent 1372dce commit f59ec93
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module Ouroboros.Consensus.Shelley.Ledger.Ledger (
, ShelleyLedgerConfig (..)
, mkShelleyLedgerConfig
, shelleyEraParams
, shelleyLedgerGenesis
-- TODO: Remove
, shelleyEraParamsNeverHardForks
-- * Auxiliary
, ShelleyLedgerEvent (..)
Expand Down Expand Up @@ -81,8 +83,8 @@ import Ouroboros.Consensus.Util.CBOR (decodeWithOrigin,
encodeWithOrigin)
import Ouroboros.Consensus.Util.Versioned

import qualified Cardano.Ledger.BaseTypes as SL (epochInfoPure)
import qualified Cardano.Ledger.BHeaderView as SL (BHeaderView)
import qualified Cardano.Ledger.BaseTypes as SL (epochInfoPure)
import qualified Cardano.Ledger.Core as Core
import qualified Cardano.Ledger.Shelley.API as SL
import qualified Control.State.Transition.Extended as STS
Expand Down Expand Up @@ -124,7 +126,9 @@ data ShelleyLedgerConfig era = ShelleyLedgerConfig {

deriving instance ShelleyBasedEra era => NoThunks (ShelleyLedgerConfig era)

-- shelleyLedgerGenesis :: ShelleyLedgerConfig era -> SL.ShelleyGenesis era
-- TODO: Remove
shelleyLedgerGenesis :: ShelleyLedgerConfig era -> SL.ShelleyGenesis era
shelleyLedgerGenesis = undefined
-- shelleyLedgerGenesis = getCompactGenesis . shelleyLedgerCompactGenesis

shelleyEraParams ::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ instance Crypto c => Serialise (NonMyopicMemberRewards c) where
encode = toCBOR . unNonMyopicMemberRewards
decode = NonMyopicMemberRewards <$> fromCBOR

data KESConfig = KESConfig {
}

data instance BlockQuery (ShelleyBlock proto era) :: Type -> Type where
GetLedgerTip :: BlockQuery (ShelleyBlock proto era) (Point (ShelleyBlock proto era))
GetEpochNo :: BlockQuery (ShelleyBlock proto era) EpochNo
Expand Down Expand Up @@ -161,6 +164,9 @@ data instance BlockQuery (ShelleyBlock proto era) :: Type -> Type where
-> BlockQuery (ShelleyBlock proto era)
(Delegations (EraCrypto era), SL.RewardAccounts (EraCrypto era))

GetKESConfig
:: BlockQuery (ShelleyBlock proto era) KESConfig

GetGenesisConfig
:: BlockQuery (ShelleyBlock proto era) (CompactGenesis era)

Expand Down Expand Up @@ -269,8 +275,11 @@ instance (ShelleyCompatible proto era, ProtoCrypto proto ~ crypto) => QueryLedge
answerBlockQuery cfg query' ext
GetFilteredDelegationsAndRewardAccounts creds ->
getFilteredDelegationsAndRewardAccounts st creds
GetGenesisConfig ->
shelleyLedgerCompactGenesis lcfg
GetKESConfig ->
getKESConfig cfg
-- TODO: Remove
-- GetGenesisConfig ->
-- shelleyLedgerCompactGenesis lcfg
DebugNewEpochState ->
st
DebugChainDepState ->
Expand Down Expand Up @@ -535,6 +544,9 @@ querySupportedVersion = \case
Auxiliary
-------------------------------------------------------------------------------}

getKESConfig :: ExtLedgerCfg (ShelleyBlock proto era) -> KESConfig
getKESConfig cfg = KESConfig

getProposedPPUpdates ::
ShelleyBasedEra era
=> SL.NewEpochState era -> SL.ProposedPPUpdates era
Expand Down

0 comments on commit f59ec93

Please sign in to comment.