Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hydra.Ledger.Simple
Description
A mock implementation of a ledger using very simple UTxO transactions.
These transactions have a very simplified representation of unspent transaction outputs being just integers, but already have inputs and outputs. Transactions are validated against the current state of the ledger, so that one transaction could at some point be invalid, then becomes valid because some inputs it consumes are now available.
NOTE: There is no notion of time in this ledger, so transactions validation will never depend on the L1 slot.
Synopsis
- data SimpleTx = SimpleTx {}
- type SimpleId = Integer
- newtype SimpleChainState = SimpleChainState {}
- newtype SimpleTxIn = SimpleTxIn {}
- simpleLedger :: Ledger SimpleTx
- utxoRef :: Integer -> UTxOType SimpleTx
- utxoRefs :: [Integer] -> UTxOType SimpleTx
- aValidTx :: Integer -> SimpleTx
- listOfCommittedUTxOs :: Integer -> Gen [UTxOType SimpleTx]
- genSequenceOfValidTransactions :: UTxOType SimpleTx -> Gen [SimpleTx]
Simple transactions
Simple transaction.
A transaction is a SimpleId
, a list of inputs and a list of outputs,
and it has no time validity.
Constructors
SimpleTx | |
Instances
Simple chain state
newtype SimpleChainState Source #
Constructors
SimpleChainState | |
Instances
newtype SimpleTxIn Source #
An identifier for a single output of a SimpleTx
.
Constructors
SimpleTxIn | |
Fields |