Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Mock = C_Crypto
- type Standard = StandardCrypto
- type GoodCrypto c = (Crypto c, Signable (DSIGN c) (Hash (HASH c) EraIndependentTxBody))
- data Proof era where
- class (EraGov era, EraTx era, EraUTxO era, EraTxAuxData era, ShelleyEraTxCert era, EraCrypto era ~ StandardCrypto) ⇒ Reflect era where
- data Some (t ∷ k → Type) where
- data WitRule (s ∷ Symbol) (e ∷ Type) where
- UTXO ∷ Proof era → WitRule "UTXO" era
- UTXOW ∷ Proof era → WitRule "UTXOW" era
- LEDGER ∷ Proof era → WitRule "LEDGER" era
- BBODY ∷ Proof era → WitRule "BBODY" era
- LEDGERS ∷ Proof era → WitRule "LEDGERS" era
- MOCKCHAIN ∷ Proof era → WitRule "MOCKCHAIN" era
- RATIFY ∷ Proof era → WitRule "RATIFY" era
- ENACT ∷ Proof era → WitRule "ENACT" era
- TALLY ∷ Proof era → WitRule "TALLY" era
- EPOCH ∷ Proof era → WitRule "EPOCH" era
- NEWEPOCH ∷ Proof era → WitRule "NEWEPOCH" era
- CERT ∷ Proof era → WitRule "CERT" era
- CERTS ∷ Proof era → WitRule "CERTS" era
- DELEG ∷ Proof era → WitRule "DELEG" era
- POOL ∷ Proof era → WitRule "POOL" era
- GOVCERT ∷ Proof era → WitRule "GOVCERT" era
- GOV ∷ Proof era → WitRule "GOV" era
- ruleProof ∷ WitRule s e → Proof e
- runSTS ∷ ∀ s e ans. (BaseM (EraRule s e) ~ ShelleyBase, STS (EraRule s e)) ⇒ WitRule s e → TRC (EraRule s e) → (Either (NonEmpty (PredicateFailure (EraRule s e))) (State (EraRule s e)) → ans) → ans
- goSTS ∷ ∀ s e ans env state sig. (BaseM (EraRule s e) ~ ShelleyBase, STS (EraRule s e), env ~ Environment (EraRule s e), state ~ State (EraRule s e), sig ~ Signal (EraRule s e)) ⇒ WitRule s e → env → state → sig → (Either (NonEmpty (PredicateFailure (EraRule s e))) (State (EraRule s e)) → ans) → ans
- preShelley ∷ [Some Proof]
- preAllegra ∷ [Some Proof]
- preMary ∷ [Some Proof]
- preAlonzo ∷ [Some Proof]
- preBabbage ∷ [Some Proof]
- preConway ∷ [Some Proof]
- postShelley ∷ [Some Proof]
- postAllegra ∷ [Some Proof]
- postMary ∷ [Some Proof]
- postAlonzo ∷ [Some Proof]
- postBabbage ∷ [Some Proof]
- postConway ∷ [Some Proof]
- data ShelleyEra c
- data AllegraEra c
- data MaryEra era
- data AlonzoEra c
- data BabbageEra c
- data ConwayEra c
- data StandardCrypto
- data C_Crypto
- specialize ∷ ∀ constraint era t. (constraint (ShelleyEra (EraCrypto era)), constraint (AllegraEra (EraCrypto era)), constraint (MaryEra (EraCrypto era)), constraint (AlonzoEra (EraCrypto era)), constraint (BabbageEra (EraCrypto era)), constraint (ConwayEra (EraCrypto era))) ⇒ Proof era → (constraint era ⇒ t) → t
- unReflect ∷ (Reflect era ⇒ Proof era → a) → Proof era → a
- runSTS' ∷ ∀ s e. (BaseM (EraRule s e) ~ ShelleyBase, STS (EraRule s e)) ⇒ WitRule s e → TRC (EraRule s e) → Either (NonEmpty (PredicateFailure (EraRule s e))) (State (EraRule s e))
- data ValueWit era where
- ValueShelleyToAllegra ∷ Value era ~ Coin ⇒ ValueWit era
- ValueMaryToConway ∷ Value era ~ MaryValue (EraCrypto era) ⇒ ValueWit era
- data TxOutWit era where
- TxOutShelleyToMary ∷ (TxOut era ~ ShelleyTxOut era, EraTxOut era, ProtVerAtMost era 8) ⇒ TxOutWit era
- TxOutAlonzoToAlonzo ∷ (TxOut era ~ AlonzoTxOut era, AlonzoEraTxOut era, ProtVerAtMost era 8) ⇒ TxOutWit era
- TxOutBabbageToConway ∷ (TxOut era ~ BabbageTxOut era, BabbageEraTxOut era) ⇒ TxOutWit era
- data TxCertWit era where
- TxCertShelleyToBabbage ∷ (TxCert era ~ ShelleyTxCert era, ShelleyEraTxCert era, ProtVerAtMost era 8) ⇒ TxCertWit era
- TxCertConwayToConway ∷ (TxCert era ~ ConwayTxCert era, ConwayEraTxCert era, ConwayEraPParams era) ⇒ TxCertWit era
- data PParamsWit era where
- PParamsShelleyToMary ∷ (PParamsHKD Identity era ~ ShelleyPParams Identity era, EraPParams era) ⇒ PParamsWit era
- PParamsAlonzoToAlonzo ∷ (PParamsHKD Identity era ~ AlonzoPParams Identity era, AlonzoEraPParams era) ⇒ PParamsWit era
- PParamsBabbageToBabbage ∷ (PParamsHKD Identity era ~ BabbagePParams Identity era, BabbageEraPParams era) ⇒ PParamsWit era
- PParamsConwayToConway ∷ (PParamsHKD Identity era ~ ConwayPParams Identity era, ConwayEraPParams era) ⇒ PParamsWit era
- data UTxOWit era where
- UTxOShelleyToMary ∷ (EraUTxO era, ScriptsNeeded era ~ ShelleyScriptsNeeded era, TxWits era ~ ShelleyTxWits era) ⇒ UTxOWit era
- UTxOAlonzoToConway ∷ (EraUTxO era, AlonzoEraScript era, AlonzoEraTxBody era, AlonzoEraPParams era, AlonzoEraTxOut era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, Script era ~ AlonzoScript era, TxWits era ~ AlonzoTxWits era) ⇒ UTxOWit era
- data ScriptWit era where
- ScriptShelleyToShelley ∷ (Script era ~ MultiSig era, EraScript era) ⇒ ScriptWit era
- ScriptAllegraToMary ∷ (Script era ~ Timelock era, EraScript era) ⇒ ScriptWit era
- ScriptAlonzoToConway ∷ (Script era ~ AlonzoScript era, EraScript era) ⇒ ScriptWit era
- data GovStateWit era where
- GovStateShelleyToBabbage ∷ (EraGov era, GovState era ~ ShelleyGovState era) ⇒ GovStateWit era
- GovStateConwayToConway ∷ (ConwayEraPParams era, RunConwayRatify era, EraGov era, GovState era ~ ConwayGovState era) ⇒ GovStateWit era
- whichValue ∷ Proof era → ValueWit era
- whichTxOut ∷ Proof era → TxOutWit era
- whichTxCert ∷ Proof era → TxCertWit era
- whichPParams ∷ Proof era → PParamsWit era
- whichUTxO ∷ Proof era → UTxOWit era
- whichScript ∷ Proof era → ScriptWit era
- whichGovState ∷ Proof era → GovStateWit era
Documentation
type Standard = StandardCrypto Source #
type GoodCrypto c = (Crypto c, Signable (DSIGN c) (Hash (HASH c) EraIndependentTxBody)) Source #
Proof of a valid (predefined) era
class (EraGov era, EraTx era, EraUTxO era, EraTxAuxData era, ShelleyEraTxCert era, EraCrypto era ~ StandardCrypto) ⇒ Reflect era where Source #
Instances
Reflect (AllegraEra StandardCrypto) Source # | |
Defined in Test.Cardano.Ledger.Generic.Proof reify ∷ Proof (AllegraEra StandardCrypto) Source # lift ∷ (Proof (AllegraEra StandardCrypto) → a) → a Source # | |
Reflect (AlonzoEra StandardCrypto) Source # | |
Defined in Test.Cardano.Ledger.Generic.Proof | |
Reflect (BabbageEra StandardCrypto) Source # | |
Defined in Test.Cardano.Ledger.Generic.Proof reify ∷ Proof (BabbageEra StandardCrypto) Source # lift ∷ (Proof (BabbageEra StandardCrypto) → a) → a Source # | |
Reflect (ConwayEra StandardCrypto) Source # | |
Defined in Test.Cardano.Ledger.Generic.Proof | |
Reflect (MaryEra StandardCrypto) Source # | |
Defined in Test.Cardano.Ledger.Generic.Proof | |
Reflect (ShelleyEra StandardCrypto) Source # | |
Defined in Test.Cardano.Ledger.Generic.Proof reify ∷ Proof (ShelleyEra StandardCrypto) Source # lift ∷ (Proof (ShelleyEra StandardCrypto) → a) → a Source # |
data Some (t ∷ k → Type) where Source #
Hide the index for a singleton type t
data WitRule (s ∷ Symbol) (e ∷ Type) where Source #
UTXO ∷ Proof era → WitRule "UTXO" era | |
UTXOW ∷ Proof era → WitRule "UTXOW" era | |
LEDGER ∷ Proof era → WitRule "LEDGER" era | |
BBODY ∷ Proof era → WitRule "BBODY" era | |
LEDGERS ∷ Proof era → WitRule "LEDGERS" era | |
MOCKCHAIN ∷ Proof era → WitRule "MOCKCHAIN" era | |
RATIFY ∷ Proof era → WitRule "RATIFY" era | |
ENACT ∷ Proof era → WitRule "ENACT" era | |
TALLY ∷ Proof era → WitRule "TALLY" era | |
EPOCH ∷ Proof era → WitRule "EPOCH" era | |
NEWEPOCH ∷ Proof era → WitRule "NEWEPOCH" era | |
CERT ∷ Proof era → WitRule "CERT" era | |
CERTS ∷ Proof era → WitRule "CERTS" era | |
DELEG ∷ Proof era → WitRule "DELEG" era | |
POOL ∷ Proof era → WitRule "POOL" era | |
GOVCERT ∷ Proof era → WitRule "GOVCERT" era | |
GOV ∷ Proof era → WitRule "GOV" era |
runSTS ∷ ∀ s e ans. (BaseM (EraRule s e) ~ ShelleyBase, STS (EraRule s e)) ⇒ WitRule s e → TRC (EraRule s e) → (Either (NonEmpty (PredicateFailure (EraRule s e))) (State (EraRule s e)) → ans) → ans Source #
goSTS ∷ ∀ s e ans env state sig. (BaseM (EraRule s e) ~ ShelleyBase, STS (EraRule s e), env ~ Environment (EraRule s e), state ~ State (EraRule s e), sig ~ Signal (EraRule s e)) ⇒ WitRule s e → env → state → sig → (Either (NonEmpty (PredicateFailure (EraRule s e))) (State (EraRule s e)) → ans) → ans Source #
Like runSTS, but makes the components of the TRC triple explicit.
in case you can't remember, in ghci type
@@
:t goSTS (UTXOW Babbage)
goSTS (LEDGER Babbage)
:: LedgerEnv (BabbageEra StandardCrypto)
-> (UTxOState (BabbageEra StandardCrypto), CertState StandardCrypto)
-> Cardano.Ledger.Alonzo.Tx.AlonzoTx (BabbageEra StandardCrypto)
-> (Either
[LedgerPredicateFailure (BabbageEra StandardCrypto)]
(UTxOState (BabbageEra StandardCrypto), CertState StandardCrypto)
-> ans)
-> ans
@@
it will tell you what type env
state
and sig
are for Babbage
preShelley ∷ [Some Proof] Source #
preAllegra ∷ [Some Proof] Source #
preBabbage ∷ [Some Proof] Source #
postShelley ∷ [Some Proof] Source #
postAllegra ∷ [Some Proof] Source #
postAlonzo ∷ [Some Proof] Source #
postBabbage ∷ [Some Proof] Source #
postConway ∷ [Some Proof] Source #
data ShelleyEra c Source #
Instances
data AllegraEra c Source #
The Allegra era
Instances
Instances
The Alonzo era
Instances
data BabbageEra c Source #
The Babbage era
Instances
The Conway era
Instances
data StandardCrypto Source #
The same crypto used on the net
Instances
specialize ∷ ∀ constraint era t. (constraint (ShelleyEra (EraCrypto era)), constraint (AllegraEra (EraCrypto era)), constraint (MaryEra (EraCrypto era)), constraint (AlonzoEra (EraCrypto era)), constraint (BabbageEra (EraCrypto era)), constraint (ConwayEra (EraCrypto era))) ⇒ Proof era → (constraint era ⇒ t) → t Source #
Specialize (action
:: (constraint era => t)) to all known era
, because
we know (constraint era) holds for all known era. In order for this to work
it is best to type apply specialize
to a concrete constraint. So a call site
looks like '(specialize @EraSegWits proof action). This way the constraint does
not percolate upwards, past the call site of action
unReflect ∷ (Reflect era ⇒ Proof era → a) → Proof era → a Source #
lift a function (Proof era -> a) that has a (Reflect era) constraint to one that does not. This is possible because every inhabited term of type (Proof era) packs a (Reflect era) instance. so instead of writing: f proof arg1 .. argn one writes: unReflect f proof arg1 .. argn which will not require a (Reflect era) instance
runSTS' ∷ ∀ s e. (BaseM (EraRule s e) ~ ShelleyBase, STS (EraRule s e)) ⇒ WitRule s e → TRC (EraRule s e) → Either (NonEmpty (PredicateFailure (EraRule s e))) (State (EraRule s e)) Source #
data ValueWit era where Source #
ValueShelleyToAllegra ∷ Value era ~ Coin ⇒ ValueWit era | |
ValueMaryToConway ∷ Value era ~ MaryValue (EraCrypto era) ⇒ ValueWit era |
data TxOutWit era where Source #
TxOutShelleyToMary ∷ (TxOut era ~ ShelleyTxOut era, EraTxOut era, ProtVerAtMost era 8) ⇒ TxOutWit era | |
TxOutAlonzoToAlonzo ∷ (TxOut era ~ AlonzoTxOut era, AlonzoEraTxOut era, ProtVerAtMost era 8) ⇒ TxOutWit era | |
TxOutBabbageToConway ∷ (TxOut era ~ BabbageTxOut era, BabbageEraTxOut era) ⇒ TxOutWit era |
data TxCertWit era where Source #
TxCertShelleyToBabbage ∷ (TxCert era ~ ShelleyTxCert era, ShelleyEraTxCert era, ProtVerAtMost era 8) ⇒ TxCertWit era | |
TxCertConwayToConway ∷ (TxCert era ~ ConwayTxCert era, ConwayEraTxCert era, ConwayEraPParams era) ⇒ TxCertWit era |
data PParamsWit era where Source #
PParamsShelleyToMary ∷ (PParamsHKD Identity era ~ ShelleyPParams Identity era, EraPParams era) ⇒ PParamsWit era | |
PParamsAlonzoToAlonzo ∷ (PParamsHKD Identity era ~ AlonzoPParams Identity era, AlonzoEraPParams era) ⇒ PParamsWit era | |
PParamsBabbageToBabbage ∷ (PParamsHKD Identity era ~ BabbagePParams Identity era, BabbageEraPParams era) ⇒ PParamsWit era | |
PParamsConwayToConway ∷ (PParamsHKD Identity era ~ ConwayPParams Identity era, ConwayEraPParams era) ⇒ PParamsWit era |
data UTxOWit era where Source #
UTxOShelleyToMary ∷ (EraUTxO era, ScriptsNeeded era ~ ShelleyScriptsNeeded era, TxWits era ~ ShelleyTxWits era) ⇒ UTxOWit era | |
UTxOAlonzoToConway ∷ (EraUTxO era, AlonzoEraScript era, AlonzoEraTxBody era, AlonzoEraPParams era, AlonzoEraTxOut era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, Script era ~ AlonzoScript era, TxWits era ~ AlonzoTxWits era) ⇒ UTxOWit era |
data ScriptWit era where Source #
ScriptShelleyToShelley ∷ (Script era ~ MultiSig era, EraScript era) ⇒ ScriptWit era | |
ScriptAllegraToMary ∷ (Script era ~ Timelock era, EraScript era) ⇒ ScriptWit era | |
ScriptAlonzoToConway ∷ (Script era ~ AlonzoScript era, EraScript era) ⇒ ScriptWit era |
data GovStateWit era where Source #
GovStateShelleyToBabbage ∷ (EraGov era, GovState era ~ ShelleyGovState era) ⇒ GovStateWit era | |
GovStateConwayToConway ∷ (ConwayEraPParams era, RunConwayRatify era, EraGov era, GovState era ~ ConwayGovState era) ⇒ GovStateWit era |
whichValue ∷ Proof era → ValueWit era Source #
whichTxOut ∷ Proof era → TxOutWit era Source #
whichTxCert ∷ Proof era → TxCertWit era Source #
whichPParams ∷ Proof era → PParamsWit era Source #
whichScript ∷ Proof era → ScriptWit era Source #
whichGovState ∷ Proof era → GovStateWit era Source #