pigy-genetics
Safe HaskellNone
LanguageHaskell2010

Pigy.Chain

Description

Monitor and act on the blockchain.

Synopsis

Documentation

kSecurity :: Int Source #

The Ouroboros security parameter.

record Source #

Arguments

:: SlotNo

The curent slot number.

-> (Origins, Pendings)

The tracked transactions and queued mintings.

-> History

The original history.

-> History

The augmented history.

Record history.

rollback Source #

Arguments

:: SlotNo

The slot number to revert to.

-> History

The original history.

-> History

The rolled-back history.

Roll back history.

toSlotNo Source #

Arguments

:: ChainPoint

The chain point.

-> SlotNo

The slot number.

Extract the slot number from the chain point.

makeActive Source #

Arguments

:: Chain ()

Action to modify the chain state.

Allow minting.

recordBlock Source #

Arguments

:: SlotNo

The slot number.

-> Chain ()

Action to modify the chain state.

Record a new block.

recordRollback Source #

Arguments

:: SlotNo

The slot number to roll back to.

-> Chain ()

The action to modify the chain state.

Roll back the chain state.

recordInput Source #

Arguments

:: SlotNo

The slot number.

-> TxIn

The spent UTxO.

-> Chain ()

The action to modify the chain state.

Record the input to a transaction.

recordOutput Source #

Arguments

:: [TxIn]

The spend UTxOs.

-> TxIn

The UTxO.

-> MaryAddress

The destination address.

-> Value

The total value.

-> Chain ()

The action to modify the chain state.

Record the output of a transaction.

createPendingSingle Source #

Arguments

:: Chain ()

The action to modify the chain state.

Mint a token from a single transaction.

createPendingMultiple Source #

Arguments

:: Chain ()

The action to modify the chain state.

Mint a token from multiple transactions.

createToken Source #

Arguments

:: [TxIn]

The UTxOs to spend.

-> (MaryAddress, Value)

The destination and total value.

-> Chain ()

The action to modify the chain state.

Mint or burn a token.

printRollback Source #

Arguments

:: (Origins, Origins)

The prior and posterior tracking of transaction origins.

-> (Pendings, Pendings)

The prior and posterior queues for minting.

-> Chain ()

The action to modify the chain state.

Print diagnostic information for a rollback.

printOrigins Source #

Arguments

:: String

The prefatory message.

-> Origins

The transaction origins.

-> IO ()

The action to print the information.

Print diagnostic information for transaction origins.

printPendings Source #

Arguments

:: String

The prefatory message.

-> Pendings

The queued mintings.

-> IO ()

The action to print the information.

Print diagnostic information for queued mintings.

runChain Source #

Arguments

:: MonadFail m 
=> MonadIO m 
=> Context

The service context.

-> MantisM m ()

Action to run the operations.

Run the chain operations for tracking and minting.