singular-registry
LicenseApache-2.0
Safe HaskellNone
LanguageGHC2021

Singular.State.Records

Description

What the state validator reads and the builders write: the root-only state datum, the actions of its mint and the redeemer of its spend, each in the Plutus Data layout the validator decodes. The layout follows the validator's types (singular_state/state, singular_state/genesis, singular_state/fold). The same functions decode a transaction's redeemers, so a registry's history can be read with the bytes the builders wrote.

Synopsis

The state datum

stateDatum :: ByteString -> Data Source #

The datum of a state output: the root of the registry's trie.

decodeStateDatum :: Data -> Maybe ByteString Source #

The root a state datum carries.

The mint

genesisRedeemer :: TxIn -> Data Source #

The redeemer of the state policy that creates the registry of a seed.

decodeGenesisRedeemer :: Data -> Maybe TxIn Source #

The seed a genesis redeemer names.

foldedRedeemer :: Data Source #

The redeemer of a state policy mint that belongs to a fold: the spend of the state output decides it.

The spend

data Change Source #

One registration or termination change, in the validator's Change order.

Constructors

Register 

Fields

Terminate 

Fields

Instances

Instances details
Show Change Source # 
Instance details

Defined in Singular.State.Records

Methods

showsPrec :: Int -> Change -> ShowS Source #

show :: Change -> String Source #

showList :: [Change] -> ShowS Source #

Eq Change Source # 
Instance details

Defined in Singular.State.Records

Methods

(==) :: Change -> Change -> Bool Source #

(/=) :: Change -> Change -> Bool Source #

foldRedeemer :: TxIn -> [Change] -> Data Source #

The redeemer of a state output: the seed that names the registry and the changes.

decodeFoldRedeemer :: Data -> Maybe (TxIn, [Change]) Source #

The seed and the changes a fold redeemer carries.