Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- outputsOfTx :: IsTx tx => tx -> [TxOutType tx]
- nextChainSlot :: ChainSlot -> ChainSlot
- newtype Ledger tx = Ledger {
- applyTransactions :: ChainSlot -> UTxOType tx -> [tx] -> Either (tx, ValidationError) (UTxOType tx)
- collectTransactions :: Ledger tx -> ChainSlot -> UTxOType tx -> [tx] -> ([tx], UTxOType tx)
- data ValidationResult
- newtype ValidationError = ValidationError {}
Documentation
outputsOfTx :: IsTx tx => tx -> [TxOutType tx] Source #
Get outputs of a transaction.
nextChainSlot :: ChainSlot -> ChainSlot Source #
An abstract interface for a Ledger
. Allows to define mock / simpler
implementation for testing as well as limiting feature-envy from the business
logic by forcing a closed interface.
Ledger | |
|
collectTransactions :: Ledger tx -> ChainSlot -> UTxOType tx -> [tx] -> ([tx], UTxOType tx) Source #
Collect applicable transactions and resulting UTxO. In contrast to
$sel:applyTransactions:Ledger
, this functions continues on validation errors.
data ValidationResult Source #
Either valid or an error which we get from the ledger-specs tx validation.
Instances
Generic ValidationResult Source # | |
Defined in Hydra.Ledger from :: ValidationResult -> Rep ValidationResult x Source # to :: Rep ValidationResult x -> ValidationResult Source # | |
Show ValidationResult Source # | |
Defined in Hydra.Ledger | |
Eq ValidationResult Source # | |
Defined in Hydra.Ledger (==) :: ValidationResult -> ValidationResult -> Bool Source # (/=) :: ValidationResult -> ValidationResult -> Bool Source # | |
type Rep ValidationResult Source # | |
Defined in Hydra.Ledger type Rep ValidationResult = D1 ('MetaData "ValidationResult" "Hydra.Ledger" "hydra-node-0.20.0-36eQlJ1pRR653kUqePgM5r" 'False) (C1 ('MetaCons "Valid" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Invalid" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ValidationError))) |
newtype ValidationError Source #