| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Alonzo.Tx
Contents
Description
This module exports implementations of many of the functions outlined in the Alonzo specification. The link to source of the specification https://github.com/intersectmbo/cardano-ledger/tree/master/eras/alonzo/formal-spec The most recent version of the document can be found here: https://github.com/intersectmbo/cardano-ledger/releases/latest/download/alonzo-ledger.pdf The functions can be found in Figures in that document, and sections of this code refer to those figures.
Synopsis
- data CostModel
- getLanguageView ∷ AlonzoEraPParams era ⇒ PParams era → Language → LangDepView
- data Data era
- type DataHash = SafeHash EraIndependentData
- newtype IsValid = IsValid Bool
- hashData ∷ Data era → DataHash
- nonNativeLanguages ∷ [Language]
- hashScriptIntegrity ∷ Era era ⇒ ScriptIntegrity era → ScriptIntegrityHash
- data EraIndependentScriptIntegrity
- data ScriptIntegrity era = ScriptIntegrity !(Redeemers era) !(TxDats era) !(Set LangDepView)
- type ScriptIntegrityHash = SafeHash EraIndependentScriptIntegrity
- data AlonzoTx era = AlonzoTx {}
- data family Tx era
- class (EraTx era, AlonzoEraTxBody era, AlonzoEraTxWits era, AlonzoEraScript era) ⇒ AlonzoEraTx era where
- isValidTxL ∷ Lens' (Tx era) IsValid
- mkBasicAlonzoTx ∷ Monoid (TxWits era) ⇒ TxBody era → AlonzoTx era
- bodyAlonzoTxL ∷ Lens' (AlonzoTx era) (TxBody era)
- witsAlonzoTxL ∷ Lens' (AlonzoTx era) (TxWits era)
- auxDataAlonzoTxL ∷ Lens' (AlonzoTx era) (StrictMaybe (TxAuxData era))
- sizeAlonzoTxF ∷ ∀ era. (HasCallStack, EraTx era) ⇒ SimpleGetter (AlonzoTx era) Word32
- isValidAlonzoTxL ∷ Lens' (AlonzoTx era) IsValid
- txdats' ∷ Era era ⇒ AlonzoTxWits era → TxDats era
- txscripts' ∷ Era era ⇒ AlonzoTxWits era → Map ScriptHash (Script era)
- txrdmrs ∷ AlonzoEraScript era ⇒ AlonzoTxWits era → Redeemers era
- data family TxBody era
- totExUnits ∷ (EraTx era, AlonzoEraTxWits era) ⇒ Tx era → ExUnits
- alonzoMinFeeTx ∷ (EraTx era, AlonzoEraTxWits era, AlonzoEraPParams era) ⇒ PParams era → Tx era → Coin
- txouts ∷ EraTxBody era ⇒ TxBody era → UTxO era
- toCBORForSizeComputation ∷ (EncCBOR (TxBody era), EncCBOR (TxWits era), EncCBOR (TxAuxData era)) ⇒ AlonzoTx era → Encoding
- toCBORForMempoolSubmission ∷ (EncCBOR (TxBody era), EncCBOR (TxWits era), EncCBOR (TxAuxData era)) ⇒ AlonzoTx era → Encoding
- alonzoTxEqRaw ∷ AlonzoEraTx era ⇒ Tx era → Tx era → Bool
- mkScriptIntegrity ∷ (AlonzoEraPParams era, AlonzoEraTxWits era, EraUTxO era) ⇒ PParams era → Tx era → ScriptsProvided era → Set ScriptHash → StrictMaybe (ScriptIntegrity era)
Documentation
A language dependent cost model for the Plutus evaluator.
Note that the EvaluationContext is entirely dependent on the
cost model parameters (ie the Map Text Integer) and that
this type uses the smart constructor mkCostModel
to hide the evaluation context.
Instances
| ToJSON CostModel | |
| Generic CostModel | |
| Show CostModel | |
| NFData CostModel | |
Defined in Cardano.Ledger.Plutus.CostModels | |
| Eq CostModel | Note that this Eq instance ignores the evaluation context, which is
entirely dependent on the cost model parameters and is guarded by the
smart constructor |
| Ord CostModel | Note that this Ord instance ignores the evaluation context, which is
entirely dependent on the cost model parameters and is guarded by the
smart constructor |
Defined in Cardano.Ledger.Plutus.CostModels | |
| NoThunks CostModel | |
| type Rep CostModel | |
Defined in Cardano.Ledger.Plutus.CostModels type Rep CostModel = D1 ('MetaData "CostModel" "Cardano.Ledger.Plutus.CostModels" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "CostModel" 'PrefixI 'True) (S1 ('MetaSel ('Just "cmLanguage") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Language) :*: (S1 ('MetaSel ('Just "cmValues") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Int64]) :*: S1 ('MetaSel ('Just "cmEvalCtx") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EvaluationContext)))) | |
getLanguageView ∷ AlonzoEraPParams era ⇒ PParams era → Language → LangDepView Source #
Instances
type DataHash = SafeHash EraIndependentData Source #
Tag indicating whether non-native scripts in this transaction are expected to validate. This is added by the block creator when constructing the block.
Instances
| ToJSON IsValid Source # | |
| Generic IsValid Source # | |
| Show IsValid Source # | |
| ToCBOR IsValid Source # | |
| DecCBOR IsValid Source # | |
| EncCBOR IsValid Source # | |
| NFData IsValid Source # | |
Defined in Cardano.Ledger.Alonzo.Tx | |
| Eq IsValid Source # | |
| NoThunks IsValid Source # | |
| type Rep IsValid Source # | |
Defined in Cardano.Ledger.Alonzo.Tx | |
hashScriptIntegrity ∷ Era era ⇒ ScriptIntegrity era → ScriptIntegrityHash Source #
data EraIndependentScriptIntegrity Source #
Instances
| Era era ⇒ HashAnnotated (ScriptIntegrity era) EraIndependentScriptIntegrity Source # | |
Defined in Cardano.Ledger.Alonzo.Tx Methods hashAnnotated ∷ ScriptIntegrity era → SafeHash EraIndependentScriptIntegrity Source # | |
data ScriptIntegrity era Source #
A ScriptIntegrityHash is the hash of three things. The first two come from the witnesses and the last comes from the Protocol Parameters.
Constructors
| ScriptIntegrity !(Redeemers era) !(TxDats era) !(Set LangDepView) |
Instances
Constructors
| AlonzoTx | |
Instances
Instances
class (EraTx era, AlonzoEraTxBody era, AlonzoEraTxWits era, AlonzoEraScript era) ⇒ AlonzoEraTx era where Source #
Instances
| AlonzoEraTx AlonzoEra Source # | |
Defined in Cardano.Ledger.Alonzo.Tx | |
auxDataAlonzoTxL ∷ Lens' (AlonzoTx era) (StrictMaybe (TxAuxData era)) Source #
sizeAlonzoTxF ∷ ∀ era. (HasCallStack, EraTx era) ⇒ SimpleGetter (AlonzoTx era) Word32 Source #
txsize computes the length of the serialised bytes (for estimations)
txscripts' ∷ Era era ⇒ AlonzoTxWits era → Map ScriptHash (Script era) Source #
Deprecated: In favor of txscripts
txrdmrs ∷ AlonzoEraScript era ⇒ AlonzoTxWits era → Redeemers era Source #
data family TxBody era Source #
The body of a transaction.
Instances
totExUnits ∷ (EraTx era, AlonzoEraTxWits era) ⇒ Tx era → ExUnits Source #
alonzoMinFeeTx ∷ (EraTx era, AlonzoEraTxWits era, AlonzoEraPParams era) ⇒ PParams era → Tx era → Coin Source #
txouts ∷ EraTxBody era ⇒ TxBody era → UTxO era Source #
Compute the transaction outputs of a transaction.
toCBORForSizeComputation ∷ (EncCBOR (TxBody era), EncCBOR (TxWits era), EncCBOR (TxAuxData era)) ⇒ AlonzoTx era → Encoding Source #
This ensures that the size of transactions from Mary is unchanged. The individual components all store their bytes; the only work we do in this function is concatenating
toCBORForMempoolSubmission ∷ (EncCBOR (TxBody era), EncCBOR (TxWits era), EncCBOR (TxAuxData era)) ⇒ AlonzoTx era → Encoding Source #
Encode to CBOR for the purposes of transmission from node to node, or from wallet to node.
Note that this serialisation is neither the serialisation used on-chain
(where Txs are deconstructed using segwit), nor the serialisation used for
computing the transaction size (which omits the IsValid field for
compatibility with Mary - see toCBORForSizeComputation).
alonzoTxEqRaw ∷ AlonzoEraTx era ⇒ Tx era → Tx era → Bool Source #
mkScriptIntegrity ∷ (AlonzoEraPParams era, AlonzoEraTxWits era, EraUTxO era) ⇒ PParams era → Tx era → ScriptsProvided era → Set ScriptHash → StrictMaybe (ScriptIntegrity era) Source #
Orphan instances
| EraTx AlonzoEra Source # | |
Methods mkBasicTx ∷ TxBody AlonzoEra → Tx AlonzoEra Source # bodyTxL ∷ Lens' (Tx AlonzoEra) (TxBody AlonzoEra) Source # witsTxL ∷ Lens' (Tx AlonzoEra) (TxWits AlonzoEra) Source # auxDataTxL ∷ Lens' (Tx AlonzoEra) (StrictMaybe (TxAuxData AlonzoEra)) Source # sizeTxF ∷ SimpleGetter (Tx AlonzoEra) Word32 Source # sizeTxForFeeCalculation ∷ Tx AlonzoEra → Word32 Source # validateNativeScript ∷ Tx AlonzoEra → NativeScript AlonzoEra → Bool Source # getMinFeeTx ∷ PParams AlonzoEra → Tx AlonzoEra → Int → Coin Source # | |
| Generic (Tx AlonzoEra) Source # | |
| Show (Tx AlonzoEra) Source # | |
| ToCBOR (Tx AlonzoEra) Source # | |
| DecCBOR (Annotator (Tx AlonzoEra)) Source # | |
| EncCBOR (Tx AlonzoEra) Source # | |
| EqRaw (Tx AlonzoEra) Source # | |
| NFData (Tx AlonzoEra) Source # | |
| Eq (Tx AlonzoEra) Source # | |
| NoThunks (Tx AlonzoEra) Source # | |