singular-registry
LicenseApache-2.0
Safe HaskellNone
LanguageGHC2021

Singular.Registry.TxBuilder.Update.Duties

Description

The obligations a fold's requests create, computed once, off chain: what must move under the registry's three token policies, where a minted token has to land, which custody has to be spent, which holder input a burn consumes, what returns to the owner, and who has to sign (the fold: nobody). This is one derivation; the cage computes its own from the requests it consumes, and the two are deliberately separate.

This module owns no queries and no transaction assembly; see Singular.Registry.TxBuilder.Update.Context and Singular.Registry.TxBuilder.Update.Build. The public surface stays Singular.Registry.TxBuilder.Update, which re-exports the duties unchanged (#267).

Synopsis

Documentation

data RegistryDuties Source #

Everything an edge owes a fold beyond the trie: what must move under the active token policy, where a registration lands, and which holder a retirement consumes.

The cage computes these from the requests it consumes (dutiesOf, dutyOk); this recomputes them from the same requests so a fold can be built that discharges them. The two are deliberately separate derivations — a builder that agrees with the validator by construction would not catch a disagreement.

Constructors

RegistryDuties 

Fields

  • rdMints :: [ConnectedMint]
     
  • rdOutputs :: [TxOut ConwayEra]
     
  • rdSpends :: [ConnectedSpend]
     
  • rdSigners :: [KeyHash 'Guard]
     
  • rdInputs :: [(TxIn, TxOut ConwayEra)]

    #177 I177-BUILDER: ordinary (non-script) inputs the edge needs the transaction to consume. A retirement of an active key burns an asset it does not create, so the holder UTxO carrying that asset has to ride in as an input; a mint of `-1` with nothing to burn is a transaction whose only possible outcome is a refusal.

Instances

Instances details
Monoid RegistryDuties Source # 
Instance details

Defined in Singular.Registry.TxBuilder.Update.Duties

Methods

mempty :: RegistryDuties Source #

mappend :: RegistryDuties -> RegistryDuties -> RegistryDuties Source #

mconcat :: [RegistryDuties] -> RegistryDuties Source #

Semigroup RegistryDuties Source # 
Instance details

Defined in Singular.Registry.TxBuilder.Update.Duties

Methods

(<>) :: RegistryDuties -> RegistryDuties -> RegistryDuties Source #

sconcat :: NonEmpty RegistryDuties -> RegistryDuties Source #

stimes :: Integral b => b -> RegistryDuties -> RegistryDuties Source #

registryDuties Source #

Arguments

:: CageConfig 
-> PParams ConwayEra 
-> OnChainTokenState 
-> RegistryContext 
-> [(TxIn, TxOut ConwayEra)] 
-> [Bool]

Whether each request is PROCESSED by this fold. A rejected request takes no edge: it owes its owner a refund, and the approval that certified it was never spent.

-> Either String RegistryDuties 

The obligations this set of requests creates, or the reason they cannot be met. A fold whose duties cannot be built is a fold that would be refused on chain; failing here names why, in the builder, where it is cheap.