| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
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
- data RegistryDuties = RegistryDuties {
- rdMints :: [ConnectedMint]
- rdOutputs :: [TxOut ConwayEra]
- rdSpends :: [ConnectedSpend]
- rdSigners :: [KeyHash 'Guard]
- rdInputs :: [(TxIn, TxOut ConwayEra)]
- registryDuties :: CageConfig -> PParams ConwayEra -> OnChainTokenState -> RegistryContext -> [(TxIn, TxOut ConwayEra)] -> [Bool] -> Either String RegistryDuties
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
| |
Instances
| Monoid RegistryDuties Source # | |
Defined in Singular.Registry.TxBuilder.Update.Duties Methods mempty :: RegistryDuties Source # mappend :: RegistryDuties -> RegistryDuties -> RegistryDuties Source # mconcat :: [RegistryDuties] -> RegistryDuties Source # | |
| Semigroup RegistryDuties Source # | |
Defined in Singular.Registry.TxBuilder.Update.Duties Methods (<>) :: RegistryDuties -> RegistryDuties -> RegistryDuties Source # sconcat :: NonEmpty RegistryDuties -> RegistryDuties Source # stimes :: Integral b => b -> RegistryDuties -> 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.