Safe Haskell | None |
---|---|
Language | Haskell2010 |
Pigy.Chain.Types
Description
Types for chain operations.
Synopsis
- type MaryAddress = AddressInEra MaryEra
- type MaryScript = ScriptInEra MaryEra
- type Origins = Map TxIn MaryAddress
- type Pendings = Map TxIn ([MaryAddress], Value)
- type History = [(SlotNo, (Origins, Pendings))]
- data ChainState = ChainState {
- context :: Context
- active :: Bool
- current :: SlotNo
- origins :: Origins
- pendings :: Pendings
- history :: History
- scriptAddress :: MaryAddress
- script :: MaryScript
- scriptHash :: ScriptHash
- checker :: Value -> Bool
- activeLens :: Lens' ChainState Bool
- currentLens :: Lens' ChainState SlotNo
- originsLens :: Lens' ChainState Origins
- pendingsLens :: Lens' ChainState Pendings
- historyLens :: Lens' ChainState History
- type Chain a = StateT ChainState IO a
- withChainState :: IORef ChainState -> Chain a -> IO a
Documentation
type MaryAddress = AddressInEra MaryEra Source #
A Mary address.
type MaryScript = ScriptInEra MaryEra Source #
A Mary script.
type Origins = Map TxIn MaryAddress Source #
Map of origins of transactions.
type Pendings = Map TxIn ([MaryAddress], Value) Source #
Map of transactions that to be processed.
type History = [(SlotNo, (Origins, Pendings))] Source #
History of transaction origins and pending transactions.
data ChainState Source #
The state of the chain.
Constructors
ChainState | |
Fields
|
Instances
Default ChainState Source # | |
Defined in Pigy.Chain.Types Methods def :: ChainState |
activeLens :: Lens' ChainState Bool Source #
Lens for the active state.
currentLens :: Lens' ChainState SlotNo Source #
Lens for the current slot number.
originsLens :: Lens' ChainState Origins Source #
Lens for the originating addresses being tracked.
pendingsLens :: Lens' ChainState Pendings Source #
Lens for the queued mintings.
historyLens :: Lens' ChainState History Source #
Lens for the tracking history.
type Chain a = StateT ChainState IO a Source #
The monad for the chain state.
Arguments
:: IORef ChainState | Reference to the chain state. |
-> Chain a | Action for modifying the chain state. |
-> IO a | Action returning the result of the modification. |
Modify the chain state.