pigy-genetics
Safe HaskellNone
LanguageHaskell2010

Pigy.Chain.Types

Description

Types for chain operations.

Synopsis

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

Instances details
Default ChainState Source # 
Instance details

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.

withChainState Source #

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.