Skip to content

Commit

Permalink
Merge pull request #248 from input-output-hk/newhoggy/support-more-co…
Browse files Browse the repository at this point in the history
…nstraints

Support more ledger constraints
  • Loading branch information
newhoggy authored Sep 18, 2023
2 parents 5bddb49 + 756309f commit a73d27f
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ jobs:
f+${{ matrix.os }}
g+${{ (startsWith(github.ref, 'refs/heads/gh-readonly-queue/') && github.run_id) || github.event.pull_request.number || github.ref }}
- name: Apt update
if: matrix.os == 'ubuntu-latest'
run: sudo apt update

- name: Install Haskell
uses: input-output-hk/actions/haskell@latest
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- name: Install system dependencies
uses: input-output-hk/actions/base@latest
with:
Expand Down
1 change: 1 addition & 0 deletions cardano-api/internal/Cardano/Api/Eras/Constraints.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type ShelleyBasedEraConstraints era =
, L.EraTxBody (ShelleyLedgerEra era)
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto
, L.ShelleyEraTxBody (ShelleyLedgerEra era)
, L.ShelleyEraTxCert (ShelleyLedgerEra era)
, FromCBOR (Consensus.ChainDepState (ConsensusProtocol era))
, FromCBOR (DebugLedgerState era)
, IsCardanoEra era
Expand Down
7 changes: 7 additions & 0 deletions cardano-api/internal/Cardano/Api/Feature/AlonzoEraOnly.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
Expand Down Expand Up @@ -75,6 +76,10 @@ type AlonzoEraOnlyConstraints era =
, Consensus.ShelleyCompatible (ConsensusProtocol era) (ShelleyLedgerEra era)
, L.ADDRHASH (Consensus.PraosProtocolSupportsNodeCrypto (ConsensusProtocol era)) ~ Blake2b.Blake2b_224
, L.AlonzoEraPParams (ShelleyLedgerEra era)
, L.AlonzoEraTx (ShelleyLedgerEra era)
, L.AlonzoEraTxBody (ShelleyLedgerEra era)
, L.AlonzoEraTxOut (ShelleyLedgerEra era)
, L.AlonzoEraTxWits (ShelleyLedgerEra era)
, L.Crypto (L.EraCrypto (ShelleyLedgerEra era))
, L.Era (ShelleyLedgerEra era)
, L.EraCrypto (ShelleyLedgerEra era) ~ L.StandardCrypto
Expand All @@ -83,6 +88,8 @@ type AlonzoEraOnlyConstraints era =
, L.EraTxBody (ShelleyLedgerEra era)
, L.ExactEra L.AlonzoEra (ShelleyLedgerEra era)
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto
, L.ProtVerAtMost (ShelleyLedgerEra era) 6
, L.ProtVerAtMost (ShelleyLedgerEra era) 8
, L.ShelleyEraTxBody (ShelleyLedgerEra era)
, L.ShelleyEraTxCert (ShelleyLedgerEra era)

Expand Down
5 changes: 5 additions & 0 deletions cardano-api/internal/Cardano/Api/Feature/AlonzoEraOnwards.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
Expand Down Expand Up @@ -85,6 +86,10 @@ type AlonzoEraOnwardsConstraints era =
, Consensus.ShelleyCompatible (ConsensusProtocol era) (ShelleyLedgerEra era)
, L.ADDRHASH (Consensus.PraosProtocolSupportsNodeCrypto (ConsensusProtocol era)) ~ Blake2b.Blake2b_224
, L.AlonzoEraPParams (ShelleyLedgerEra era)
, L.AlonzoEraTx (ShelleyLedgerEra era)
, L.AlonzoEraTxBody (ShelleyLedgerEra era)
, L.AlonzoEraTxOut (ShelleyLedgerEra era)
, L.AlonzoEraTxWits (ShelleyLedgerEra era)
, L.Crypto (L.EraCrypto (ShelleyLedgerEra era))
, L.Era (ShelleyLedgerEra era)
, L.EraCrypto (ShelleyLedgerEra era) ~ L.StandardCrypto
Expand Down
3 changes: 3 additions & 0 deletions cardano-api/internal/Cardano/Api/Feature/BabbageEraOnwards.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
Expand Down Expand Up @@ -80,6 +81,8 @@ type BabbageEraOnwardsConstraints era =
, Consensus.ShelleyCompatible (ConsensusProtocol era) (ShelleyLedgerEra era)
, L.ADDRHASH (Consensus.PraosProtocolSupportsNodeCrypto (ConsensusProtocol era)) ~ Blake2b.Blake2b_224
, L.BabbageEraPParams (ShelleyLedgerEra era)
, L.BabbageEraTxBody (ShelleyLedgerEra era)
, L.BabbageEraTxOut (ShelleyLedgerEra era)
, L.Crypto (L.EraCrypto (ShelleyLedgerEra era))
, L.Era (ShelleyLedgerEra era)
, L.EraCrypto (ShelleyLedgerEra era) ~ L.StandardCrypto
Expand Down
8 changes: 7 additions & 1 deletion cardano-api/internal/Cardano/Api/Feature/ConwayEraOnwards.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
Expand Down Expand Up @@ -28,8 +29,9 @@ import qualified Cardano.Crypto.Hash.Class as C
import qualified Cardano.Crypto.VRF as C
import qualified Cardano.Ledger.Api as L
import qualified Cardano.Ledger.BaseTypes as L
import qualified Cardano.Ledger.Conway.Core as L
import qualified Cardano.Ledger.Conway.Governance as L
import qualified Cardano.Ledger.Conway.TxCert as L
import qualified Cardano.Ledger.Core as L
import qualified Cardano.Ledger.SafeHash as L
import qualified Ouroboros.Consensus.Protocol.Abstract as Consensus
import qualified Ouroboros.Consensus.Protocol.Praos.Common as Consensus
Expand Down Expand Up @@ -75,6 +77,8 @@ type ConwayEraOnwardsConstraints era =
, Consensus.PraosProtocolSupportsNode (ConsensusProtocol era)
, Consensus.ShelleyCompatible (ConsensusProtocol era) (ShelleyLedgerEra era)
, L.ADDRHASH (Consensus.PraosProtocolSupportsNodeCrypto (ConsensusProtocol era)) ~ Blake2b.Blake2b_224
, L.ConwayEraGov (ShelleyLedgerEra era)
, L.ConwayEraPParams (ShelleyLedgerEra era)
, L.ConwayEraTxBody (ShelleyLedgerEra era)
, L.ConwayEraTxCert (ShelleyLedgerEra era)
, L.Crypto (L.EraCrypto (ShelleyLedgerEra era))
Expand All @@ -86,7 +90,9 @@ type ConwayEraOnwardsConstraints era =
, L.EraTxBody (ShelleyLedgerEra era)
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto
, L.ShelleyEraTxBody (ShelleyLedgerEra era)
, L.ShelleyEraTxCert (ShelleyLedgerEra era)
, L.TxCert (ShelleyLedgerEra era) ~ L.ConwayTxCert (ShelleyLedgerEra era)

, FromCBOR (Consensus.ChainDepState (ConsensusProtocol era))
, FromCBOR (DebugLedgerState era)
, IsCardanoEra era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ type ShelleyToAllegraEraConstraints era =
, L.EraTxBody (ShelleyLedgerEra era)
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto
, L.ProtVerAtMost (ShelleyLedgerEra era) 4
, L.ProtVerAtMost (ShelleyLedgerEra era) 6
, L.ProtVerAtMost (ShelleyLedgerEra era) 8
, L.ShelleyEraTxBody (ShelleyLedgerEra era)
, L.ShelleyEraTxCert (ShelleyLedgerEra era)
, L.TxCert (ShelleyLedgerEra era) ~ L.ShelleyTxCert (ShelleyLedgerEra era)

, FromCBOR (Consensus.ChainDepState (ConsensusProtocol era))
, FromCBOR (DebugLedgerState era)
, IsCardanoEra era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ type ShelleyToAlonzoEraConstraints era =
, L.EraTxBody (ShelleyLedgerEra era)
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto
, L.ProtVerAtMost (ShelleyLedgerEra era) 6
, L.ProtVerAtMost (ShelleyLedgerEra era) 8
, L.ShelleyEraTxBody (ShelleyLedgerEra era)
, L.ShelleyEraTxCert (ShelleyLedgerEra era)
, L.TxCert (ShelleyLedgerEra era) ~ L.ShelleyTxCert (ShelleyLedgerEra era)

, FromCBOR (Consensus.ChainDepState (ConsensusProtocol era))
, FromCBOR (DebugLedgerState era)
, IsCardanoEra era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ type ShelleyToBabbageEraConstraints era =
, L.EraTx (ShelleyLedgerEra era)
, L.EraTxBody (ShelleyLedgerEra era)
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto
, L.ProtVerAtMost (ShelleyLedgerEra era) 7
, L.ProtVerAtMost (ShelleyLedgerEra era) 8
, L.ShelleyEraTxBody (ShelleyLedgerEra era)
, L.ShelleyEraTxCert (ShelleyLedgerEra era)
, L.TxCert (ShelleyLedgerEra era) ~ L.ShelleyTxCert (ShelleyLedgerEra era)

, FromCBOR (Consensus.ChainDepState (ConsensusProtocol era))
, FromCBOR (DebugLedgerState era)
, IsCardanoEra era
Expand Down
5 changes: 4 additions & 1 deletion cardano-api/internal/Cardano/Api/Feature/ShelleyToMaryEra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,13 @@ type ShelleyToMaryEraConstraints era =
, L.EraTx (ShelleyLedgerEra era)
, L.EraTxBody (ShelleyLedgerEra era)
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto
, L.ProtVerAtMost (ShelleyLedgerEra era) 5
, L.ProtVerAtMost (ShelleyLedgerEra era) 4
, L.ProtVerAtMost (ShelleyLedgerEra era) 6
, L.ProtVerAtMost (ShelleyLedgerEra era) 8
, L.ShelleyEraTxBody (ShelleyLedgerEra era)
, L.ShelleyEraTxCert (ShelleyLedgerEra era)
, L.TxCert (ShelleyLedgerEra era) ~ L.ShelleyTxCert (ShelleyLedgerEra era)

, FromCBOR (Consensus.ChainDepState (ConsensusProtocol era))
, FromCBOR (DebugLedgerState era)
, IsCardanoEra era
Expand Down

0 comments on commit a73d27f

Please sign in to comment.