| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Chain.UTxO
Synopsis
- data TxValidationMode
- module Cardano.Chain.UTxO.Validation
- module Cardano.Chain.UTxO.UTxO
- type TxWitness = Vector TxInWitness
- data TxInWitness
- newtype TxSigData = TxSigData {
- txSigTxHash :: Hash Tx
- type TxSig = Signature TxSigData
- recoverSigData :: Annotated Tx ByteString -> Annotated TxSigData ByteString
- data TxProof = TxProof {
- txpNumber :: !Word32
- txpRoot :: !(MerkleRoot Tx)
- txpWitnessesHash :: !(Hash [TxWitness])
- mkTxProof :: TxPayload -> TxProof
- recoverTxProof :: ATxPayload ByteString -> TxProof
- data UTxOConfiguration = UTxOConfiguration {}
- defaultUTxOConfiguration :: UTxOConfiguration
- mkUTxOConfiguration :: [Address] -> UTxOConfiguration
- type TxPayload = ATxPayload ()
- newtype ATxPayload a = ATxPayload {
- aUnTxPayload :: [ATxAux a]
- mkTxPayload :: [TxAux] -> TxPayload
- recoverHashedBytes :: ATxPayload ByteString -> Annotated [TxWitness] ByteString
- txpAnnotatedTxs :: ATxPayload a -> [Annotated Tx a]
- txpTxs :: ATxPayload a -> [Tx]
- txpWitnesses :: TxPayload -> [TxWitness]
- unTxPayload :: ATxPayload a -> [TxAux]
- type TxAux = ATxAux ()
- data ATxAux a = ATxAux {
- aTaTx :: !(Annotated Tx a)
- aTaWitness :: !(Annotated TxWitness a)
- aTaAnnotation :: !a
- mkTxAux :: Tx -> TxWitness -> TxAux
- annotateTxAux :: TxAux -> ATxAux ByteString
- taTx :: ATxAux a -> Tx
- taWitness :: ATxAux a -> TxWitness
- txaF :: Format r (TxAux -> r)
- data Tx = UnsafeTx {
- txInputs :: !(NonEmpty TxIn)
- txOutputs :: !(NonEmpty TxOut)
- txAttributes :: !TxAttributes
- txF :: Format r (Tx -> r)
- type TxId = Hash Tx
- type TxAttributes = Attributes ()
- data TxIn = TxInUtxo TxId Word32
- data TxOut = TxOut {
- txOutAddress :: !Address
- txOutValue :: !Lovelace
- genesisUtxo :: Config -> UTxO
- data CompactTxIn = CompactTxInUtxo !CompactTxId !Word32
- toCompactTxIn :: TxIn -> CompactTxIn
- fromCompactTxIn :: CompactTxIn -> TxIn
- data CompactTxId
- toCompactTxId :: TxId -> CompactTxId
- fromCompactTxId :: CompactTxId -> TxId
- data CompactTxOut = CompactTxOut !CompactAddress !Lovelace
- toCompactTxOut :: TxOut -> CompactTxOut
- fromCompactTxOut :: CompactTxOut -> TxOut
Documentation
data TxValidationMode Source #
Indicates what sort of transaction validation should be performed.
Constructors
| TxValidation | Perform all transaction validations. |
| TxValidationNoCrypto | Because we've already validated this transaction against some ledger state, we know that cryptographic validation has passed. However, we should still perform all of the other non-cryptographic checks since we're validating against a potentially dfferent ledger state. |
| NoTxValidation | No validations should be performed as we have already validated this transaction against this very same ledger state. |
Instances
| Eq TxValidationMode Source # | |
Defined in Cardano.Chain.UTxO.ValidationMode Methods (==) :: TxValidationMode -> TxValidationMode -> Bool # (/=) :: TxValidationMode -> TxValidationMode -> Bool # | |
| Show TxValidationMode Source # | |
Defined in Cardano.Chain.UTxO.ValidationMode Methods showsPrec :: Int -> TxValidationMode -> ShowS # show :: TxValidationMode -> String # showList :: [TxValidationMode] -> ShowS # | |
module Cardano.Chain.UTxO.UTxO
type TxWitness = Vector TxInWitness Source #
A witness is a proof that a transaction is allowed to spend the funds it spends (by providing signatures, redeeming scripts, etc). A separate proof is provided for each input.
data TxInWitness Source #
A witness for a single input
Constructors
| VKWitness !VerificationKey !TxSig | VKWitness twKey twSig |
| RedeemWitness !RedeemVerificationKey !(RedeemSignature TxSigData) | RedeemWitness twRedeemKey twRedeemSig |
Instances
Data that is being signed when creating a TxSig
Constructors
| TxSigData | |
Fields
| |
Constructors
| TxProof | |
Fields
| |
Instances
| Eq TxProof Source # | |
| Show TxProof Source # | |
| Generic TxProof Source # | |
| NFData TxProof Source # | |
Defined in Cardano.Chain.UTxO.TxProof | |
| ToJSON TxProof Source # | |
| ToCBOR TxProof Source # | |
| FromCBOR TxProof Source # | |
| Buildable TxProof Source # | |
| NoThunks TxProof Source # | |
| type Rep TxProof Source # | |
Defined in Cardano.Chain.UTxO.TxProof type Rep TxProof = D1 ('MetaData "TxProof" "Cardano.Chain.UTxO.TxProof" "cardano-ledger-0.1.0.0-LsmGdPmHvbsHmMt4VaqSe3" 'False) (C1 ('MetaCons "TxProof" 'PrefixI 'True) (S1 ('MetaSel ('Just "txpNumber") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: (S1 ('MetaSel ('Just "txpRoot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (MerkleRoot Tx)) :*: S1 ('MetaSel ('Just "txpWitnessesHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Hash [TxWitness]))))) | |
data UTxOConfiguration Source #
Additional configuration for ledger validation.
Constructors
| UTxOConfiguration | |
Fields
| |
Instances
type TxPayload = ATxPayload () Source #
Payload of UTxO component which is part of the block body
newtype ATxPayload a Source #
Constructors
| ATxPayload | |
Fields
| |
Instances
mkTxPayload :: [TxAux] -> TxPayload Source #
txpAnnotatedTxs :: ATxPayload a -> [Annotated Tx a] Source #
txpTxs :: ATxPayload a -> [Tx] Source #
txpWitnesses :: TxPayload -> [TxWitness] Source #
unTxPayload :: ATxPayload a -> [TxAux] Source #
Constructors
| ATxAux | |
Fields
| |
Instances
annotateTxAux :: TxAux -> ATxAux ByteString Source #
Transaction
NB: transaction witnesses are stored separately
Constructors
| UnsafeTx | |
Fields
| |
Instances
| Eq Tx Source # | |
| Ord Tx Source # | |
| Show Tx Source # | |
| Generic Tx Source # | |
| NFData Tx Source # | |
Defined in Cardano.Chain.UTxO.Tx | |
| ToJSON Tx Source # | |
| ToCBOR Tx Source # | |
| FromCBOR Tx Source # | |
| Buildable Tx Source # | |
| type Rep Tx Source # | |
Defined in Cardano.Chain.UTxO.Tx type Rep Tx = D1 ('MetaData "Tx" "Cardano.Chain.UTxO.Tx" "cardano-ledger-0.1.0.0-LsmGdPmHvbsHmMt4VaqSe3" 'False) (C1 ('MetaCons "UnsafeTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "txInputs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NonEmpty TxIn)) :*: (S1 ('MetaSel ('Just "txOutputs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NonEmpty TxOut)) :*: S1 ('MetaSel ('Just "txAttributes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxAttributes)))) | |
type TxAttributes = Attributes () Source #
Represents transaction attributes: map from 1-byte integer to arbitrary-type value. To be used for extending transaction with new fields via softfork.
Transaction arbitrary input
Constructors
| TxInUtxo TxId Word32 | TxId = Which transaction's output is used | Word32 = Index of the output in transaction's outputs |
Instances
| Eq TxIn Source # | |
| Ord TxIn Source # | |
| Show TxIn Source # | |
| Generic TxIn Source # | |
| NFData TxIn Source # | |
Defined in Cardano.Chain.UTxO.Tx | |
| ToJSON TxIn Source # | |
| ToCBOR TxIn Source # | |
| FromCBOR TxIn Source # | |
| HeapWords TxIn Source # | |
| Buildable TxIn Source # | |
| type Rep TxIn Source # | |
Defined in Cardano.Chain.UTxO.Tx type Rep TxIn = D1 ('MetaData "TxIn" "Cardano.Chain.UTxO.Tx" "cardano-ledger-0.1.0.0-LsmGdPmHvbsHmMt4VaqSe3" 'False) (C1 ('MetaCons "TxInUtxo" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxId) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))) | |
Transaction output
Constructors
| TxOut | |
Fields
| |
Instances
| Eq TxOut Source # | |
| Ord TxOut Source # | |
| Show TxOut Source # | |
| Generic TxOut Source # | |
| NFData TxOut Source # | |
Defined in Cardano.Chain.UTxO.Tx | |
| ToJSON TxOut Source # | |
| ToCBOR TxOut Source # | |
| FromCBOR TxOut Source # | |
| HeapWords TxOut Source # | |
| Buildable TxOut Source # | |
| type Rep TxOut Source # | |
Defined in Cardano.Chain.UTxO.Tx type Rep TxOut = D1 ('MetaData "TxOut" "Cardano.Chain.UTxO.Tx" "cardano-ledger-0.1.0.0-LsmGdPmHvbsHmMt4VaqSe3" 'False) (C1 ('MetaCons "TxOut" 'PrefixI 'True) (S1 ('MetaSel ('Just "txOutAddress") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Address) :*: S1 ('MetaSel ('Just "txOutValue") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Lovelace))) | |
genesisUtxo :: Config -> UTxO Source #
Create initial UTxO from balances defined in the genesis config
data CompactTxIn Source #
A compact in-memory representation for a TxIn.
Convert using toCompactTxIn and fromCompactTxIn.
Constructors
| CompactTxInUtxo !CompactTxId !Word32 |
Instances
toCompactTxIn :: TxIn -> CompactTxIn Source #
fromCompactTxIn :: CompactTxIn -> TxIn Source #
data CompactTxId Source #
A compact in-memory representation for a TxId.
Convert using toCompactTxId and fromCompactTxId.
Compared to a normal TxId, this takes 5 heap words rather than 12.
Instances
toCompactTxId :: TxId -> CompactTxId Source #
fromCompactTxId :: CompactTxId -> TxId Source #
data CompactTxOut Source #
A compact in-memory representation for a TxOut.
Convert using toCompactTxOut and fromCompactTxOut.
Constructors
| CompactTxOut !CompactAddress !Lovelace |
Instances
toCompactTxOut :: TxOut -> CompactTxOut Source #
fromCompactTxOut :: CompactTxOut -> TxOut Source #