Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
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
- type SimpleId = Integer
- data SimpleTx = SimpleTx {}
- newtype SimpleTxOut = SimpleTxOut {}
- newtype SimpleChainState = SimpleChainState {
- slot :: ChainSlot
- simpleLedger :: Ledger SimpleTx
- utxoRef :: Integer -> UTxOType SimpleTx
- utxoRefs :: [Integer] -> UTxOType SimpleTx
- aValidTx :: Integer -> SimpleTx
- listOfCommittedUTxOs :: Integer -> Gen [UTxOType 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.
Instances
newtype SimpleTxOut Source #
A single output of a SimpleTx
having an integer identity and sole value.
Instances
Simple chain state
newtype SimpleChainState Source #
SimpleChainState | |
|
Instances
A simple ledger
Builders
Generators
listOfCommittedUTxOs :: Integer -> Gen [UTxOType SimpleTx] Source #