Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing (general) instances for the LegacyBlock #472

Merged
merged 3 commits into from
Nov 2, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ["8.10.7", "9.2.8", "9.6.2"]
ghc: ["8.10.7", "9.2.8", "9.6.3"]
cabal: ["3.10.1.0"]
os: [ubuntu-latest]
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ library
Legacy.Cardano.CanonicalTxIn
Legacy.Cardano.Ledger
Legacy.Convert
Legacy.LegacyBlock
Legacy.Shelley.Ledger
Ouroboros.Consensus.HardFork.Trans
Ouroboros.Consensus.Legacy.Block
Ouroboros.Consensus.Legacy.Util

build-depends:
, base >=4.14 && <4.19
Expand All @@ -71,12 +72,14 @@ library
, cardano-prelude
, cardano-protocol-tpraos >=1.0.1 && <1.1
, cardano-slotting
, cborg
, containers >=0.5 && <0.7
, mtl >=2.2 && <2.4
, nothunks
, ouroboros-consensus
, ouroboros-consensus-cardano
, ouroboros-consensus-protocol
, ouroboros-network-api
, serialise
, small-steps
, sop-core
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
module Legacy.Byron.Ledger () where

import Control.Monad.Except
import Data.Coerce (coerce)
import GHC.Stack (HasCallStack)
import Legacy.LegacyBlock
import Ouroboros.Consensus.Byron.Ledger
import Ouroboros.Consensus.HeaderValidation
import Ouroboros.Consensus.Config (castTopLevelConfig)
import Ouroboros.Consensus.Ledger.Abstract
import Ouroboros.Consensus.Ledger.Extended
import Ouroboros.Consensus.Ledger.Query
import Ouroboros.Consensus.Ledger.Tables.Utils
import Ouroboros.Consensus.Util.DepPair
import Ouroboros.Consensus.Legacy.Block
import Ouroboros.Consensus.Legacy.Util

{-------------------------------------------------------------------------------
Ticking
Expand Down Expand Up @@ -128,18 +128,8 @@ instance ApplyBlock (LedgerState ByronBlock) ByronBlock
Queries
-------------------------------------------------------------------------------}

castExtLedgerState ::
ExtLedgerState (LegacyBlock ByronBlock) mk
-> ExtLedgerState ByronBlock mk
castExtLedgerState (ExtLedgerState st chaindep) =
ExtLedgerState (convertMapKind $ getLegacyLedgerState st) (castHeaderState chaindep)

instance BlockSupportsLedgerQuery (LegacyBlock ByronBlock) where
answerPureBlockQuery cfg (LegacyBlockQuery GetUpdateInterfaceState) ext =
answerPureBlockQuery (castExtLedgerCfg cfg) GetUpdateInterfaceState $ castExtLedgerState ext
answerPureBlockQuery (castExtLedgerCfg castTopLevelConfig cfg) GetUpdateInterfaceState $ castExtLedgerState coerce ext
answerBlockQueryLookup _cfg q _dlv = case q of {}
answerBlockQueryTraverse _cfg q _dlv = case q of {}

instance SameDepIndex2 (BlockQuery (LegacyBlock ByronBlock)) where
sameDepIndex2 (LegacyBlockQuery GetUpdateInterfaceState) (LegacyBlockQuery GetUpdateInterfaceState)
= Just Refl
jasagredo marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ module Legacy.Cardano.Block (
) where

import Data.Kind
import Legacy.LegacyBlock
import Ouroboros.Consensus.Byron.Ledger.Block
import Ouroboros.Consensus.Cardano.Block
import Ouroboros.Consensus.Legacy.Block
import Ouroboros.Consensus.Protocol.Praos
import Ouroboros.Consensus.Protocol.TPraos
import Ouroboros.Consensus.Shelley.Ledger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import qualified Data.SOP.Tails as Tails
import Data.Void (absurd)
import Legacy.Byron.Ledger ()
import Legacy.Cardano.Block
import Legacy.LegacyBlock
import Legacy.Shelley.Ledger ()
import Ouroboros.Consensus.Block
import Ouroboros.Consensus.Byron.Ledger
Expand All @@ -60,6 +59,7 @@ import Ouroboros.Consensus.HardFork.History (Bound (boundSlot),
import Ouroboros.Consensus.Ledger.Abstract
import Ouroboros.Consensus.Ledger.SupportsProtocol
import Ouroboros.Consensus.Ledger.Tables.Utils
import Ouroboros.Consensus.Legacy.Block
import Ouroboros.Consensus.Protocol.Abstract
import Ouroboros.Consensus.Protocol.PBFT.State (PBftState)
import qualified Ouroboros.Consensus.Protocol.PBFT.State as PBftState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import GHC.Stack (HasCallStack)
import Legacy.Cardano.Block
import Legacy.Cardano.CanHardFork (LegacyCardanoHardForkConstraints)
import Legacy.Cardano.CanonicalTxIn ()
import Legacy.LegacyBlock
import Ouroboros.Consensus.Block
import Ouroboros.Consensus.Cardano ()
import Ouroboros.Consensus.Cardano.Block
import Ouroboros.Consensus.Ledger.Abstract
import Ouroboros.Consensus.Ledger.Tables.Utils
import Ouroboros.Consensus.Legacy.Block

{-------------------------------------------------------------------------------
Ticking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import Data.SOP.Counting
import Data.SOP.Functors
import Data.SOP.Strict
import Legacy.Cardano
import Legacy.LegacyBlock
import Ouroboros.Consensus.Block.Abstract
import Ouroboros.Consensus.Cardano.Block
import Ouroboros.Consensus.Config
Expand All @@ -75,6 +74,7 @@ import Ouroboros.Consensus.HardFork.History.Summary
import Ouroboros.Consensus.HeaderValidation
import Ouroboros.Consensus.Ledger.Abstract
import Ouroboros.Consensus.Ledger.Extended
import Ouroboros.Consensus.Legacy.Block
import Ouroboros.Consensus.Protocol.Abstract
import Ouroboros.Consensus.TypeFamilyWrappers

Expand Down
Loading