| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Singular.Registry.Types
Description
The caller-importable surface of the registry wire: every datum,
redeemer, domain type, edge constant and helper that used to live in
this module, re-exported unchanged from the five focused owners of the
Singular.Registry.Wire family that now hold each definition beside its
encoding instances. The constructors, selectors, strictness and
ToData/FromData/UnsafeFromData encodings are byte-identical to
the single-module era; existing callers keep importing this facade and
should continue to. See the wire guide
(Singular.Registry.Wire.Primitive and its siblings) for who owns
what and the dependency direction between the owners.
Synopsis
- data CageDatum
- = RequestDatum !OnChainRequest
- | StateDatum !OnChainTokenState
- | AbsentCustody !ByteString
- data MintRedeemer
- data Migration = Migration {
- migrationOldPolicy :: !BuiltinByteString
- migrationTokenId :: !OnChainTokenId
- data UpdateRedeemer
- data RequestAction
- newtype OnChainTokenId = OnChainTokenId {
- unOnChainTokenId :: BuiltinByteString
- type Edge = Integer
- edgeInsertAbsent :: Edge
- edgeInsertActive :: Edge
- edgeUpdateActive :: Edge
- edgeUpdateTerminal :: Edge
- edgeDeleteAbsent :: Edge
- edgeDeleteActive :: Edge
- edgeWitnessTerminal :: Edge
- edgeName :: Edge -> String
- data RequestPhase
- requestPhase :: SlotNo -> SlotNo -> SlotNo -> RequestPhase
- newtype OnChainRoot = OnChainRoot {
- unOnChainRoot :: ByteString
- data OnChainRequest = OnChainRequest {
- requestToken :: !OnChainTokenId
- requestOwner :: !BuiltinByteString
- requestKey :: !ByteString
- requestEdge :: !Edge
- requestDeposit :: !Integer
- requestSubmittedAt :: !Integer
- requestDestination :: !RequestDestination
- type RequestDestination = (ByteString, Maybe Data)
- data OnChainTokenState = OnChainTokenState {
- stateRoot :: !OnChainRoot
- stateMaxFee :: !Integer
- stateProcessTime :: !Integer
- stateRetractTime :: !Integer
- stateAppPolicy :: !BuiltinByteString
- stateActivePolicy :: !BuiltinByteString
- stateAbsentPolicy :: !BuiltinByteString
- stateTerminalPolicy :: !BuiltinByteString
- data OnChainTxOutRef = OnChainTxOutRef {
- txOutRefId :: !BuiltinByteString
- txOutRefIdx :: !Integer
- data ProofStep
- = Branch {
- branchSkip :: !Integer
- branchNeighbors :: !ByteString
- | Fork {
- forkSkip :: !Integer
- forkNeighbor :: !Neighbor
- | Leaf { }
- = Branch {
- data Neighbor = Neighbor {
- neighborNibble :: !Integer
- neighborPrefix :: !ByteString
- neighborRoot :: !ByteString
- stateActivePolicyBytes :: OnChainTokenState -> ByteString
- stateAppPolicyBytes :: OnChainTokenState -> ByteString
- stateAbsentPolicyBytes :: OnChainTokenState -> ByteString
- stateTerminalPolicyBytes :: OnChainTokenState -> ByteString
- data ConsumerRedeemer = Hook
On-chain datum/redeemer types
Cage datum: either a pending request or a token
state. Matches Aiken types/CageDatum.
Constructors
| RequestDatum !OnChainRequest | A pending operation request (Constr 0) |
| StateDatum !OnChainTokenState | Current token state (Constr 1) |
| AbsentCustody !ByteString | The cage's own custody of an absent token (Constr 2, #157 absent-custody-datum; appended, so 0 and 1 never move): the address the inserter named for the refund. The registry key is the sole non-ADA asset carried by the output. |
Instances
| Show CageDatum Source # | |
Defined in Singular.Registry.Wire.State | |
| Eq CageDatum Source # | |
Defined in Singular.Registry.Wire.State | |
| FromData CageDatum Source # | |
Defined in Singular.Registry.Wire.State Methods fromBuiltinData :: BuiltinData -> Maybe CageDatum | |
| ToData CageDatum Source # | |
Defined in Singular.Registry.Wire.State Methods toBuiltinData :: CageDatum -> BuiltinData | |
| UnsafeFromData CageDatum Source # | |
Defined in Singular.Registry.Wire.State Methods unsafeFromBuiltinData :: BuiltinData -> CageDatum | |
data MintRedeemer Source #
Minting redeemer. Matches Aiken
types/MintRedeemer.
The seed OutputReference that authorizes a fresh
mint and derives the asset name is carried by the
redeemer because the state validator is global and
unparameterized.
Constructors
| Minting !OnChainTxOutRef | Mint a new cage token (Constr 0) |
| Migrating !Migration | Migrate from old validator (Constr 1) |
| Burning !OnChainTokenId | Burn a cage token (Constr 2) |
Instances
| Show MintRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods showsPrec :: Int -> MintRedeemer -> ShowS Source # show :: MintRedeemer -> String Source # showList :: [MintRedeemer] -> ShowS Source # | |
| Eq MintRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods (==) :: MintRedeemer -> MintRedeemer -> Bool Source # (/=) :: MintRedeemer -> MintRedeemer -> Bool Source # | |
| FromData MintRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods fromBuiltinData :: BuiltinData -> Maybe MintRedeemer | |
| ToData MintRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods toBuiltinData :: MintRedeemer -> BuiltinData | |
| UnsafeFromData MintRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods unsafeFromBuiltinData :: BuiltinData -> MintRedeemer | |
Migration parameters. Matches Aiken
types/Migration.
Constructors
| Migration | |
Fields
| |
Instances
| Show Migration Source # | |
Defined in Singular.Registry.Wire.Redeemer | |
| Eq Migration Source # | |
Defined in Singular.Registry.Wire.Redeemer | |
| FromData Migration Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods fromBuiltinData :: BuiltinData -> Maybe Migration | |
| ToData Migration Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods toBuiltinData :: Migration -> BuiltinData | |
| UnsafeFromData Migration Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods unsafeFromBuiltinData :: BuiltinData -> Migration | |
data UpdateRedeemer Source #
Spending redeemer. Matches Aiken
types/UpdateRedeemer.
Sweep stateRef is refused for every party (operator ruling
NOTE-028/A-003); the constructor stays for the wire shape.
Constructors
| End | End the token (Constr 0) |
| Contribute !OnChainTxOutRef | Link a request to a state UTxO (Constr 1) |
| Modify ![RequestAction] | Process requests with mixed actions (Constr 2) |
| Retract !OnChainTxOutRef | Reclaim a pending request (Constr 3) |
| Sweep !OnChainTxOutRef | Reclaim a non-legitimate UTxO at the cage's address (Constr 4). Owner-signed. |
Instances
| Show UpdateRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods showsPrec :: Int -> UpdateRedeemer -> ShowS Source # show :: UpdateRedeemer -> String Source # showList :: [UpdateRedeemer] -> ShowS Source # | |
| Eq UpdateRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods (==) :: UpdateRedeemer -> UpdateRedeemer -> Bool Source # (/=) :: UpdateRedeemer -> UpdateRedeemer -> Bool Source # | |
| FromData UpdateRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods fromBuiltinData :: BuiltinData -> Maybe UpdateRedeemer | |
| ToData UpdateRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods toBuiltinData :: UpdateRedeemer -> BuiltinData | |
| UnsafeFromData UpdateRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods unsafeFromBuiltinData :: BuiltinData -> UpdateRedeemer | |
data RequestAction Source #
Per-request action in a Modify redeemer.
Matches Aiken types/RequestAction.
Constructors
| Update ![ProofStep] | Update with Merkle proof (Constr 0) |
| Rejected | Reject expired request (Constr 1) |
Instances
| Show RequestAction Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods showsPrec :: Int -> RequestAction -> ShowS Source # show :: RequestAction -> String Source # showList :: [RequestAction] -> ShowS Source # | |
| Eq RequestAction Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods (==) :: RequestAction -> RequestAction -> Bool Source # (/=) :: RequestAction -> RequestAction -> Bool Source # | |
| FromData RequestAction Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods fromBuiltinData :: BuiltinData -> Maybe RequestAction | |
| ToData RequestAction Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods toBuiltinData :: RequestAction -> BuiltinData | |
| UnsafeFromData RequestAction Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods unsafeFromBuiltinData :: BuiltinData -> RequestAction | |
On-chain domain types
newtype OnChainTokenId Source #
On-chain token identifier (asset name as raw
bytes). Matches Aiken lib/TokenId.
Constructors
| OnChainTokenId | |
Fields
| |
Instances
| Show OnChainTokenId Source # | |
Defined in Singular.Registry.Wire.Primitive Methods showsPrec :: Int -> OnChainTokenId -> ShowS Source # show :: OnChainTokenId -> String Source # showList :: [OnChainTokenId] -> ShowS Source # | |
| Eq OnChainTokenId Source # | |
Defined in Singular.Registry.Wire.Primitive Methods (==) :: OnChainTokenId -> OnChainTokenId -> Bool Source # (/=) :: OnChainTokenId -> OnChainTokenId -> Bool Source # | |
| FromData OnChainTokenId Source # | |
Defined in Singular.Registry.Wire.Primitive Methods fromBuiltinData :: BuiltinData -> Maybe OnChainTokenId | |
| ToData OnChainTokenId Source # | |
Defined in Singular.Registry.Wire.Primitive Methods toBuiltinData :: OnChainTokenId -> BuiltinData | |
| UnsafeFromData OnChainTokenId Source # | |
Defined in Singular.Registry.Wire.Primitive Methods unsafeFromBuiltinData :: BuiltinData -> OnChainTokenId | |
The seven-admitted-edges row index a request names (#183, Lean Request.edge,
Aiken lib/edgeInsertAbsent … edgeWitnessTerminal).
An edge names its own leaf bytes, so no value bytes travel with a request and an illegal value-byte shape is not expressible:
0 insertAbsent insert 0x00 1 insertActive insert 0x01 2 updateActive update 0x00 -> 0x01 3 updateTerminal update 0x01 -> 0x02 4 deleteAbsent delete 0x00 5 deleteActive delete 0x01 6 witnessTerminal read 0x02
It is a plain Integer, exactly as it is a plain Int on chain, so a
tag outside 0..6 can still be encoded and sent — which is what the
cage's edge-inadmissible refusal is there to answer, and what a row
that exercises that refusal needs to be able to build.
data RequestPhase Source #
The exit a resuming client chooses for one of its pending requests at a chain tip.
It follows the windows of onchainvalidatorsshared.ak: an update is
folded only while the tip is before submitted_at + process_time (phase
1), and the owner may retract only before submitted_at + process_time +
retract_time (phase 2). After both the client rejects (phase 3). This is
the client's choice, not the validator's rule for a reject: a reject
carries no admission and is accepted in every window (#320).
Constructors
| PhaseAccept | |
| PhaseRetract | |
| PhaseReject |
Instances
| Show RequestPhase Source # | |
Defined in Singular.Registry.Wire.Request Methods showsPrec :: Int -> RequestPhase -> ShowS Source # show :: RequestPhase -> String Source # showList :: [RequestPhase] -> ShowS Source # | |
| Eq RequestPhase Source # | |
Defined in Singular.Registry.Wire.Request Methods (==) :: RequestPhase -> RequestPhase -> Bool Source # (/=) :: RequestPhase -> RequestPhase -> Bool Source # | |
Arguments
| :: SlotNo | Last slot an accept fold can carry (process deadline). |
| -> SlotNo | Last slot a retract can carry (retract deadline). |
| -> SlotNo | The live tip. |
| -> RequestPhase |
Classify a request from its two boundary slots and the live tip.
The boundaries are the slots the builders can express: the accept fold's validity upper bound is the process deadline slot, the retract's is the retract deadline slot. The comparison is strict, so a phase is chosen only while the tip is inside what that phase's builder can still build — a window already behind the tip never classifies into the phase that would build it.
newtype OnChainRoot Source #
On-chain MPF root hash (raw bytes).
Constructors
| OnChainRoot | |
Fields
| |
Instances
| Show OnChainRoot Source # | |
Defined in Singular.Registry.Wire.Primitive Methods showsPrec :: Int -> OnChainRoot -> ShowS Source # show :: OnChainRoot -> String Source # showList :: [OnChainRoot] -> ShowS Source # | |
| Eq OnChainRoot Source # | |
Defined in Singular.Registry.Wire.Primitive Methods (==) :: OnChainRoot -> OnChainRoot -> Bool Source # (/=) :: OnChainRoot -> OnChainRoot -> Bool Source # | |
| FromData OnChainRoot Source # | |
Defined in Singular.Registry.Wire.Primitive Methods fromBuiltinData :: BuiltinData -> Maybe OnChainRoot | |
| ToData OnChainRoot Source # | |
Defined in Singular.Registry.Wire.Primitive Methods toBuiltinData :: OnChainRoot -> BuiltinData | |
| UnsafeFromData OnChainRoot Source # | |
Defined in Singular.Registry.Wire.Primitive Methods unsafeFromBuiltinData :: BuiltinData -> OnChainRoot | |
data OnChainRequest Source #
On-chain request to modify a token's trie.
Matches Aiken types/Request.
Constructors
| OnChainRequest | |
Fields
| |
Instances
| Show OnChainRequest Source # | |
Defined in Singular.Registry.Wire.Request Methods showsPrec :: Int -> OnChainRequest -> ShowS Source # show :: OnChainRequest -> String Source # showList :: [OnChainRequest] -> ShowS Source # | |
| Eq OnChainRequest Source # | |
Defined in Singular.Registry.Wire.Request Methods (==) :: OnChainRequest -> OnChainRequest -> Bool Source # (/=) :: OnChainRequest -> OnChainRequest -> Bool Source # | |
| FromData OnChainRequest Source # | |
Defined in Singular.Registry.Wire.Request Methods fromBuiltinData :: BuiltinData -> Maybe OnChainRequest | |
| ToData OnChainRequest Source # | |
Defined in Singular.Registry.Wire.Request Methods toBuiltinData :: OnChainRequest -> BuiltinData | |
| UnsafeFromData OnChainRequest Source # | |
Defined in Singular.Registry.Wire.Request Methods unsafeFromBuiltinData :: BuiltinData -> OnChainRequest | |
type RequestDestination = (ByteString, Maybe Data) Source #
Where a request's minted token goes, and the datum the receiving output must carry, or none (#419): what the request carries on the chain.
data OnChainTokenState Source #
On-chain token state. Matches Aiken types/State (#157 state-datum-fields: eight
fields, replacing the six). consumer_pin is deleted with the pinned
consumer; representative_policy is renamed active_policy; the
application, absent and terminal policies are new. All four policies are
set at genesis and preserved by every Modify.
Constructors
| OnChainTokenState | |
Fields
| |
Instances
| Show OnChainTokenState Source # | |
Defined in Singular.Registry.Wire.State Methods showsPrec :: Int -> OnChainTokenState -> ShowS Source # show :: OnChainTokenState -> String Source # showList :: [OnChainTokenState] -> ShowS Source # | |
| Eq OnChainTokenState Source # | |
Defined in Singular.Registry.Wire.State Methods (==) :: OnChainTokenState -> OnChainTokenState -> Bool Source # (/=) :: OnChainTokenState -> OnChainTokenState -> Bool Source # | |
| FromData OnChainTokenState Source # | |
Defined in Singular.Registry.Wire.State Methods fromBuiltinData :: BuiltinData -> Maybe OnChainTokenState | |
| ToData OnChainTokenState Source # | |
Defined in Singular.Registry.Wire.State Methods toBuiltinData :: OnChainTokenState -> BuiltinData | |
| UnsafeFromData OnChainTokenState Source # | |
Defined in Singular.Registry.Wire.State Methods unsafeFromBuiltinData :: BuiltinData -> OnChainTokenState | |
data OnChainTxOutRef Source #
On-chain output reference. Matches Aiken
cardano/transaction/OutputReference.
Constructors
| OnChainTxOutRef | |
Fields
| |
Instances
| Show OnChainTxOutRef Source # | |
Defined in Singular.Registry.Wire.Primitive Methods showsPrec :: Int -> OnChainTxOutRef -> ShowS Source # show :: OnChainTxOutRef -> String Source # showList :: [OnChainTxOutRef] -> ShowS Source # | |
| Eq OnChainTxOutRef Source # | |
Defined in Singular.Registry.Wire.Primitive Methods (==) :: OnChainTxOutRef -> OnChainTxOutRef -> Bool Source # (/=) :: OnChainTxOutRef -> OnChainTxOutRef -> Bool Source # | |
| FromData OnChainTxOutRef Source # | |
Defined in Singular.Registry.Wire.Primitive Methods fromBuiltinData :: BuiltinData -> Maybe OnChainTxOutRef | |
| ToData OnChainTxOutRef Source # | |
Defined in Singular.Registry.Wire.Primitive Methods toBuiltinData :: OnChainTxOutRef -> BuiltinData | |
| UnsafeFromData OnChainTxOutRef Source # | |
Defined in Singular.Registry.Wire.Primitive Methods unsafeFromBuiltinData :: BuiltinData -> OnChainTxOutRef | |
Proof steps (Aiken MPF proof encoding)
A single step in an MPF Merkle proof, matching
the Aiken ProofStep type from
aiken-lang/merkle-patricia-forestry.
Constructors
| Branch | Branch step (Constr 0) |
Fields
| |
| Fork | Fork step (Constr 1) |
Fields
| |
| Leaf | Leaf step (Constr 2) |
Instances
| Show ProofStep Source # | |
Defined in Singular.Registry.Wire.Proof | |
| Eq ProofStep Source # | |
Defined in Singular.Registry.Wire.Proof | |
| FromData ProofStep Source # | |
Defined in Singular.Registry.Wire.Proof Methods fromBuiltinData :: BuiltinData -> Maybe ProofStep | |
| ToData ProofStep Source # | |
Defined in Singular.Registry.Wire.Proof Methods toBuiltinData :: ProofStep -> BuiltinData | |
| UnsafeFromData ProofStep Source # | |
Defined in Singular.Registry.Wire.Proof Methods unsafeFromBuiltinData :: BuiltinData -> ProofStep | |
Neighbor node in a fork proof step.
Constructors
| Neighbor | |
Fields
| |
Instances
| Show Neighbor Source # | |
Defined in Singular.Registry.Wire.Proof | |
| Eq Neighbor Source # | |
Defined in Singular.Registry.Wire.Proof | |
| FromData Neighbor Source # | |
Defined in Singular.Registry.Wire.Proof Methods fromBuiltinData :: BuiltinData -> Maybe Neighbor | |
| ToData Neighbor Source # | |
Defined in Singular.Registry.Wire.Proof Methods toBuiltinData :: Neighbor -> BuiltinData | |
| UnsafeFromData Neighbor Source # | |
Defined in Singular.Registry.Wire.Proof Methods unsafeFromBuiltinData :: BuiltinData -> Neighbor | |
State helpers
stateActivePolicyBytes :: OnChainTokenState -> ByteString Source #
The active-token policy as plain bytes (issue #77 E-001, renamed by
#157 state-datum-fields): unwraps the BuiltinByteString for hex comparison in
verifiers. Named for the field it reads — no alias of the
representative policy survives.
stateAppPolicyBytes :: OnChainTokenState -> ByteString Source #
The application policy as plain bytes (#157 tree-edge-admission-by-approval).
stateAbsentPolicyBytes :: OnChainTokenState -> ByteString Source #
The absent-token policy as plain bytes (#157 mint-matches-edge-deltas).
stateTerminalPolicyBytes :: OnChainTokenState -> ByteString Source #
The terminal-token policy as plain bytes (#157 mint-matches-edge-deltas).
Pinned-hook consumer redeemer (NOTE-021)
data ConsumerRedeemer Source #
Pinned-hook consumer redeemer (NOTE-021): a nullary hook. The
consumer authenticates the batch from the transaction's own evidence
(spent state, request datums, naming claims, mint field) — the redeemer
carries nothing because nothing caller-supplied is trusted. Encodes as
Constr 0 [].
Constructors
| Hook |
Instances
| Show ConsumerRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods showsPrec :: Int -> ConsumerRedeemer -> ShowS Source # show :: ConsumerRedeemer -> String Source # showList :: [ConsumerRedeemer] -> ShowS Source # | |
| Eq ConsumerRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods (==) :: ConsumerRedeemer -> ConsumerRedeemer -> Bool Source # (/=) :: ConsumerRedeemer -> ConsumerRedeemer -> Bool Source # | |
| ToData ConsumerRedeemer Source # | |
Defined in Singular.Registry.Wire.Redeemer Methods toBuiltinData :: ConsumerRedeemer -> BuiltinData | |