| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
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
- applyDataParam :: Data -> ShortByteString -> ShortByteString
- applyIntParam :: Integer -> ShortByteString -> ShortByteString
- applyBytesParam :: ByteString -> ShortByteString -> ShortByteString
- applyOutputRef :: OnChainTxOutRef -> ShortByteString -> ShortByteString
- applyPreviousPolicies :: [ByteString] -> ShortByteString -> ShortByteString
- applyRequestParams :: ByteString -> OnChainTokenId -> ShortByteString -> ShortByteString
Documentation
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.
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.
Arguments
| :: ByteString | Encoded bytes parameter |
| -> ShortByteString | Flat-encoded UPLC program |
| -> ShortByteString |
Apply a raw bytes parameter to a UPLC script.
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); |
| -> 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).
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.