Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- alonzoInputHashes :: ( HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), ValidateScript era, TxOut era ~ TxOut era) => Map ( ScriptHash ( Crypto era)) ( Script era) -> ValidatedTx era -> UTxO era -> ( Set ( DataHash ( Crypto era)), Set ( TxIn ( Crypto era)))
- isTwoPhaseScriptAddressFromMap :: ValidateScript era => Map ( ScriptHash ( Crypto era)) ( Script era) -> Addr ( Crypto era) -> Bool
- toCBORForMempoolSubmission :: ( Typeable era, ToCBOR ( TxBody era), ToCBOR ( AuxiliaryData era)) => ValidatedTx era -> Encoding
- segwitTx :: Annotator ( TxBody era) -> Annotator ( TxWitness era) -> IsValid -> Maybe ( Annotator ( AuxiliaryData era)) -> Annotator ( ValidatedTx era)
- indexedRdmrs :: ( Era era, HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "wits" tx ( TxWitness era), HasField "body" tx ( TxBody era)) => tx -> ScriptPurpose ( Crypto era) -> Maybe ( Data era, ExUnits )
- getMapFromValue :: Value crypto -> Map ( PolicyID crypto) ( Map AssetName Integer )
- rdptrInv :: ( HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "minted" ( TxBody era) ( Set ( ScriptHash ( Crypto era)))) => TxBody era -> RdmrPtr -> StrictMaybe ( ScriptPurpose ( Crypto era))
- rdptr :: ( HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "minted" ( TxBody era) ( Set ( ScriptHash ( Crypto era)))) => TxBody era -> ScriptPurpose ( Crypto era) -> StrictMaybe RdmrPtr
- totExUnits :: ( HasField "wits" ( Tx era) ( Witnesses era), HasField "txrdmrs" ( Witnesses era) ( Redeemers era)) => Tx era -> ExUnits
- minfee :: ( HasField "_minfeeA" ( PParams era) Natural , HasField "_minfeeB" ( PParams era) Natural , HasField "_prices" ( PParams era) Prices , HasField "wits" ( Tx era) ( Witnesses era), HasField "txrdmrs" ( Witnesses era) ( Redeemers era), HasField "txsize" ( Tx era) Integer ) => PParams era -> Tx era -> Coin
- toCBORForSizeComputation :: ( Typeable era, ToCBOR ( TxBody era), ToCBOR ( AuxiliaryData era)) => ValidatedTx era -> Encoding
- isTwoPhaseScriptAddress :: ValidateScript era => ValidatedTx era -> Addr ( Crypto era) -> Bool
- hashScriptIntegrity :: Era era => Set LangDepView -> Redeemers era -> TxDats era -> StrictMaybe ( ScriptIntegrityHash ( Crypto era))
- getCoin :: Era era => TxOut era -> Coin
- newtype IsValid = IsValid Bool
-
data
ValidatedTx
era =
ValidatedTx
{
- body :: !( TxBody era)
- wits :: !( TxWitness era)
- isValid :: ! IsValid
- auxiliaryData :: !( StrictMaybe ( AuxiliaryData era))
- data ScriptIntegrity era = ScriptIntegrity !( Redeemers era) !( TxDats era) !( Set LangDepView )
-
data
ScriptPurpose
crypto
- = Minting !( PolicyID crypto)
- | Spending !( TxIn crypto)
- | Rewarding !( RewardAcnt crypto)
- | Certifying !( DCert crypto)
-
class
Indexable
elem container
where
- indexOf :: elem -> container -> StrictMaybe Word64
- fromIndex :: Word64 -> container -> StrictMaybe elem
- txdats' :: TxWitness era -> TxDats era
- txrdmrs :: TxWitness era -> ( Era era, Script era ~ Script era) => Redeemers era
- txscripts' :: TxWitness era -> Map ( ScriptHash ( Crypto era)) ( Script era)
- type ScriptIntegrityHash crypto = SafeHash crypto EraIndependentScriptIntegrity
- hashData :: Era era => Data era -> DataHash ( Crypto era)
- data Data era
- getLanguageView :: HasField "_costmdls" ( PParams era) CostModels => PParams era -> Language -> LangDepView
- data CostModel
- nonNativeLanguages :: [ Language ]
- txouts :: Era era => TxBody era -> UTxO era
- data EraIndependentScriptIntegrity
- type DataHash crypto = SafeHash crypto EraIndependentData
-
data
TxBody
era
where
- pattern TxBody :: BabbageBody era => Set ( TxIn ( Crypto era)) -> Set ( TxIn ( Crypto era)) -> Set ( TxIn ( Crypto era)) -> StrictSeq ( Sized ( TxOut era)) -> StrictMaybe ( Sized ( TxOut era)) -> StrictMaybe Coin -> StrictSeq ( DCert ( Crypto era)) -> Wdrl ( Crypto era) -> Coin -> ValidityInterval -> StrictMaybe ( Update era) -> Set ( KeyHash ' Witness ( Crypto era)) -> Value ( Crypto era) -> StrictMaybe ( ScriptIntegrityHash ( Crypto era)) -> StrictMaybe ( AuxiliaryDataHash ( Crypto era)) -> StrictMaybe Network -> TxBody era
Documentation
alonzoInputHashes :: ( HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), ValidateScript era, TxOut era ~ TxOut era) => Map ( ScriptHash ( Crypto era)) ( Script era) -> ValidatedTx era -> UTxO era -> ( Set ( DataHash ( Crypto era)), Set ( TxIn ( Crypto era))) Source #
isTwoPhaseScriptAddressFromMap :: ValidateScript era => Map ( ScriptHash ( Crypto era)) ( Script era) -> Addr ( Crypto era) -> Bool Source #
Compute if an Addr has the hash of a TwoPhaseScript, we can tell what kind of Script from the Hash, by looking it up in the Map
toCBORForMempoolSubmission :: ( Typeable era, ToCBOR ( TxBody era), ToCBOR ( AuxiliaryData era)) => ValidatedTx 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
).
segwitTx :: Annotator ( TxBody era) -> Annotator ( TxWitness era) -> IsValid -> Maybe ( Annotator ( AuxiliaryData era)) -> Annotator ( ValidatedTx era) Source #
indexedRdmrs :: ( Era era, HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "wits" tx ( TxWitness era), HasField "body" tx ( TxBody era)) => tx -> ScriptPurpose ( Crypto era) -> Maybe ( Data era, ExUnits ) Source #
Find the Data and ExUnits assigned to a script.
rdptrInv :: ( HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "minted" ( TxBody era) ( Set ( ScriptHash ( Crypto era)))) => TxBody era -> RdmrPtr -> StrictMaybe ( ScriptPurpose ( Crypto era)) Source #
rdptr :: ( HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "minted" ( TxBody era) ( Set ( ScriptHash ( Crypto era)))) => TxBody era -> ScriptPurpose ( Crypto era) -> StrictMaybe RdmrPtr Source #
totExUnits :: ( HasField "wits" ( Tx era) ( Witnesses era), HasField "txrdmrs" ( Witnesses era) ( Redeemers era)) => Tx era -> ExUnits Source #
minfee :: ( HasField "_minfeeA" ( PParams era) Natural , HasField "_minfeeB" ( PParams era) Natural , HasField "_prices" ( PParams era) Prices , HasField "wits" ( Tx era) ( Witnesses era), HasField "txrdmrs" ( Witnesses era) ( Redeemers era), HasField "txsize" ( Tx era) Integer ) => PParams era -> Tx era -> Coin Source #
toCBORForSizeComputation :: ( Typeable era, ToCBOR ( TxBody era), ToCBOR ( AuxiliaryData era)) => ValidatedTx 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
isTwoPhaseScriptAddress :: ValidateScript era => ValidatedTx era -> Addr ( Crypto era) -> Bool Source #
hashScriptIntegrity :: Era era => Set LangDepView -> Redeemers era -> TxDats era -> StrictMaybe ( ScriptIntegrityHash ( Crypto era)) 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
Eq IsValid | |
Show IsValid | |
Generic IsValid | |
NFData IsValid | |
Defined in Cardano.Ledger.Alonzo.Tx |
|
ToCBOR IsValid | |
FromCBOR IsValid | |
NoThunks IsValid | |
type Rep IsValid | |
Defined in Cardano.Ledger.Alonzo.Tx
type
Rep
IsValid
=
D1
('
MetaData
"IsValid" "Cardano.Ledger.Alonzo.Tx" "cardano-ledger-alonzo-0.1.0.0-xW3meaGVQP43dxJ76zbGD" '
True
) (
C1
('
MetaCons
"IsValid" '
PrefixI
'
False
) (
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
Bool
)))
|
data ValidatedTx era Source #
ValidatedTx | |
|
Instances
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.
ScriptIntegrity !( Redeemers era) !( TxDats era) !( Set LangDepView ) |
Instances
data ScriptPurpose crypto Source #
Minting !( PolicyID crypto) | |
Spending !( TxIn crypto) | |
Rewarding !( RewardAcnt crypto) | |
Certifying !( DCert crypto) |
Instances
class Indexable elem container where Source #
indexOf :: elem -> container -> StrictMaybe Word64 Source #
fromIndex :: Word64 -> container -> StrictMaybe elem Source #
Instances
Eq k => Indexable k ( StrictSeq k) | |
Defined in Cardano.Ledger.Alonzo.Tx |
|
Ord k => Indexable k ( Set k) | |
Defined in Cardano.Ledger.Alonzo.Tx |
|
Ord k => Indexable k ( Map k v) | |
Defined in Cardano.Ledger.Alonzo.Tx |
txscripts' :: TxWitness era -> Map ( ScriptHash ( Crypto era)) ( Script era) Source #
type ScriptIntegrityHash crypto = SafeHash crypto EraIndependentScriptIntegrity Source #
Instances
getLanguageView :: HasField "_costmdls" ( PParams era) CostModels => PParams era -> Language -> LangDepView Source #
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
nonNativeLanguages :: [ Language ] Source #
txouts :: Era era => TxBody era -> UTxO era Source #
Compute the transaction outputs of a transaction.
data EraIndependentScriptIntegrity Source #
Instances
c ~ Crypto era => HasField "scriptIntegrityHash" ( TxBody era) ( StrictMaybe ( ScriptIntegrityHash c)) | |
Defined in Cardano.Ledger.Alonzo.TxBody getField :: TxBody era -> StrictMaybe ( ScriptIntegrityHash c) Source # |
|
c ~ Crypto era => HasField "scriptIntegrityHash" ( TxBody era) ( StrictMaybe ( ScriptIntegrityHash c)) Source # | |
Defined in Cardano.Ledger.Babbage.TxBody getField :: TxBody era -> StrictMaybe ( ScriptIntegrityHash c) Source # |
|
( Era era, c ~ Crypto era) => HashAnnotated ( ScriptIntegrity era) EraIndependentScriptIntegrity c | |
Defined in Cardano.Ledger.Alonzo.Tx |
type DataHash crypto = SafeHash crypto EraIndependentData Source #
data TxBody era where Source #
pattern TxBody :: BabbageBody era => Set ( TxIn ( Crypto era)) -> Set ( TxIn ( Crypto era)) -> Set ( TxIn ( Crypto era)) -> StrictSeq ( Sized ( TxOut era)) -> StrictMaybe ( Sized ( TxOut era)) -> StrictMaybe Coin -> StrictSeq ( DCert ( Crypto era)) -> Wdrl ( Crypto era) -> Coin -> ValidityInterval -> StrictMaybe ( Update era) -> Set ( KeyHash ' Witness ( Crypto era)) -> Value ( Crypto era) -> StrictMaybe ( ScriptIntegrityHash ( Crypto era)) -> StrictMaybe ( AuxiliaryDataHash ( Crypto era)) -> StrictMaybe Network -> TxBody era |