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)
- canApply :: Ledger tx -> ChainSlot -> UTxOType tx -> tx -> ValidationResult
- 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 | |
|
canApply :: Ledger tx -> ChainSlot -> UTxOType tx -> tx -> ValidationResult Source #
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
newtype ValidationError Source #