singular-registry
LicenseApache-2.0
Safe HaskellNone
LanguageGHC2021

Singular.Registry.Blueprint.Params

Description

Applies the registry's parameters to the flat-encoded UPLC programs a blueprint carries: raw Data values, integers, bytes, output references, the state validator's previousPolicies allowlist, and the request validator's (statePolicyId, cageToken) pair in source order.

This is the parameter-application owner extracted from Singular.Registry.Blueprint; the public module re-exports it and is its only intended consumer surface.

Synopsis

Documentation

applyDataParam Source #

Arguments

:: Data

Encoded parameter value

-> ShortByteString

Flat-encoded UPLC program

-> ShortByteString 

Apply a Data parameter to a UPLC script. The blueprint's compiledCode is a flat-encoded UPLC program that expects one parameter. This function applies the supplied Data value to that parameter slot, producing the final script bytes.

applyIntParam Source #

Arguments

:: Integer

Encoded integer parameter

-> ShortByteString

Flat-encoded UPLC program

-> ShortByteString 

Apply an integer parameter to a UPLC script.

`witness(kind, registry)` (#157 mint-matches-edge-deltas) takes its kind as a plain integer, and the deployment applies it three times. Wrapping the Data encoding here keeps the Data vocabulary inside this module, where the rest of the blueprint's encoding already lives.

applyBytesParam Source #

Arguments

:: ByteString

Encoded bytes parameter

-> ShortByteString

Flat-encoded UPLC program

-> ShortByteString 

Apply a raw bytes parameter to a UPLC script.

applyOutputRef Source #

Arguments

:: OnChainTxOutRef

Output reference to apply as the seed parameter

-> ShortByteString

Flat-encoded UPLC program

-> ShortByteString 

Apply an OnChainTxOutRef parameter to a UPLC script. Wraps applyDataParam with the canonical Constr 0 [bytes, integer] encoding produced by the 'ToData OnChainTxOutRef' instance — matching what the on-chain validator's parameter slot expects when the Aiken validator is parameterized by an OutputReference.

applyPreviousPolicies Source #

Arguments

:: [ByteString]

Predecessor policy-id bytes (28 bytes each); [] for genesis

-> ShortByteString

Flat-encoded raw state UPLC program

-> ShortByteString 

Apply the state validator's previousPolicies allowlist parameter. The on-chain parameter type is List<PolicyId>, encoded as List [B pid0, B pid1, …] (an empty List [] for a genesis cage, which makes migration into it impossible).

applyRequestParams Source #

Arguments

:: ByteString

State policy id bytes

-> OnChainTokenId

Cage token asset name

-> ShortByteString

Flat-encoded request UPLC program

-> ShortByteString 

Apply request-validator parameters in source order: statePolicyId first, then cageTokenName.