cage_fixtures

Constants

aRequest: CageDatum

burn_value: Value

capturedMinUtxoRefundOutput: Output

capturedRefundRequest: CageDatum

capturedRefundRequestInput: Input

capturedRefundState: State

capturedRefundStateDatum: Option<CageDatum>

capturedRefundStateInput: Input

capturedRefundStateOutput: Output

capturedRefundTip: Int = 2_000_000

capturedRefundTxFee: Int = 2_289_551

capturedStateValue: Value

feeApproval: Value

feeDelivery: Output

feeOwner: ByteArray = "requester_key_aaaaaaaaaaaaaaa"

feeRequest: CageDatum

feeRequestInput: Input

feeState: State

feeStateDatum: Option<CageDatum>

feeStateInput: Input

feeStateOutput: Output

legacyApproval: Value

The approval the application minted for exactly this request.

legacyDelivery: Output

legacyDestination: (ByteArray, Option<Data>) = (legacyWallet, None)

legacyKey: ByteArray = "42"

Registry-mode shape for this module’s shared fold fixture (#157): the request books "42" at edge 1 — so the fixture describes a real edge of seven-admitted-edges instead of the pre-#157 “any bytes” registry. Every Modify row below therefore refuses for ITS OWN reason rather than at the leaf codec.

legacyMint: Value

The +1 active the booking entails, and the output it must land in.

legacyRoot: ByteArray

The root after the booking folds.

legacyWallet: ByteArray = #"60eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"

An enterprise payment-key address, as destination carries it.

noDestination: (ByteArray, Option<Data>) = (#"", None)

The destination of a request that names none (#157 request-destination-binding): the requests in this module exercise the cage’s non-registry paths — minting, contribute, retract, sweep, rejection — none of which moves a token to a destination. The registry-mode rows build their own.

output: Output

phase1Range: Interval<Int>

phase2Range: Interval<Int>

phase3Range: Interval<Int>

rawStateDatum: CageDatum

refundOutput: Output

rejectedStateOutput: Output

request: Input

state: State

stateDatum: Option<CageDatum>

testAbsentPolicy: ByteArray = #"b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0"

testAppPolicy: ByteArray = #"a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9"

testFee: Int = 500_000

testProcessTime: Int = 10_000

Unit tests and validator-level property tests for the MPF Cage validator.

This is a test module (no pub exports), which allows it to import the cage validator directly via qualified syntax: cage.mpfCage.spend(...).

Test Fixture Layout

All tests share a common set of constants that simulate a minimal cage scenario:

  • Time phases: process_time = 10s, retract_time = 10s, submitted_at = 0

    • Phase 1 (oracle processing): [0, 10_000) — validity range [0, 5_000]
    • Phase 2 (requester retract): [10_000, 20_000) — validity range [10_000, 15_000]
    • After the windows: [20_000, …) — validity range [20_000, 25_000]
  • State UTxO (update): holds testToken at testScriptAddress with an empty MPF root (no owner field exists).

  • Request UTxO (request): an edge-1 (insertActive) request targeting testToken, submitted at time 0.

  • Expected output (output): the State UTxO after processing the Insert, with the computed MPF root.

testRepPolicy: ByteArray = #"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

The four policies the eight-field State pins (#157 state-datum-fields). The active policy keeps the 0xaa bytes the representative policy had, so the preservation rows that used 0xbb for the altered case still read the same way; the application, absent and terminal policies are the three the ticket adds.

testRequestRef: OutputReference

testRetractTime: Int = 10_000

testScriptAddress: Address

testSeed: OutputReference

testStakeScript: ByteArray = "test_stake_script"

testStateRef: OutputReference

testTerminalPolicy: ByteArray = #"c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0"

testToken: TokenId

testValue: Value

topupRefundRequest: CageDatum

topupSmallRequestInput: Input

update: Input

zfDelivery: Output

The delivery output for the fee fixture: its request carries 2 ADA against a 500_000 tip, so the deposit the fold returns is the difference — 2_000_000 less the 500_000 testFee (#157 request-deposit-returned). The zero-tip variant: the whole 2 ADA rides back to the destination.

Functions

endRedeemerData() -> Data

updateActionData() -> Data

rejectedActionData() -> Data

modifyRedeemerData(actions: List<Data>) -> Data

stateSpendRedeemerData(redeemer: Data) -> Pair<ScriptPurpose, Data>

owner_fuzzer() -> Fuzzer<ByteArray>

Search Document