singular_state_fold_fixtures

Shared fixtures of the Singular fold tests.

Every token name a transaction carries, every proof and every root is obtained from the producers at run time: the role names from singular_state/preimage, the roots and proofs from the Merkle Patricia Forestry library through the proof builders of singular_state_proof_fixtures. A fold scenario names the registry’s seed, the keys already registered and the registrations folded now; the transaction, the redeemer and the proofs are derived from it, so a test changes one part of a valid fold and nothing else.

The keys differ in the first nibble of their hash, so the proof builders, which describe a root with one leaf per first nibble, describe every trie built here.

Types

One registration as the booker commits it: the key, the request input that carries the approval, and the holding the token is delivered to.

Constructors

  • Registration {
      key: ByteArray,
      request: OutputReference,
      holding_address: Address,
      datum: Data,
      deposit: Int,
      holding_lovelace: Int,
    }

A fold: the registry’s seed, the keys already registered, and the registrations folded now, in order.

Constructors

  • Scenario {
      seed: OutputReference,
      before: List<ByteArray>,
      registrations: List<Registration>,
    }

Constants

fold_transaction_id: ByteArray = #"f01df01df01df01df01df01df01df01df01df01df01df01df01df01df01df01d"

funding_reference: OutputReference

holding_script_a: ByteArray = #"d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1"

holding_script_b: ByteArray = #"d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2"

holding_stake: ByteArray = #"e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3"

key_a: ByteArray = #"6b657941"

“keyA”: the hash begins with nibble 6.

key_b: ByteArray = #"6b657942"

“keyB”: c.

key_c: ByteArray = #"6b657943"

“keyC”: 2.

key_d: ByteArray = #"6b657944"

“keyD”: f.

key_e: ByteArray = #"6b657945"

“keyE”: 8.

key_f: ByteArray = #"6b657946"

“keyF”: 7.

request_script: ByteArray = #"8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d"

request_transaction: ByteArray = #"5245515545535400000000000000000000000000000000000000000000000000"

state_lovelace: Int = 5_000_000

state_reference: OutputReference

Functions

proof_into(existing: List<ByteArray>, key: ByteArray) -> Proof

The proof that inserts key into the trie that holds exactly existing. When existing already holds the key, no such proof exists; the proof returned is the one a booker would build against the trie without the key, which shows the key absent from a trie that is not the one in the state.

trie_of(keys: List<ByteArray>) -> MerklePatriciaForestry

The trie that holds exactly keys, each bound to the active leaf. A key listed twice is bound once, so a scenario that registers a key twice still has a continuing state to build.

root_of(keys: List<ByteArray>) -> ByteArray

The root of the trie that holds exactly keys.

request_reference(index: Int) -> OutputReference

staked_holding_a() -> Address

An address with the payment credential of holding_script_a and a stake credential.

registration_a() -> Registration

registration_b() -> Registration

The holding holds exactly the deposit.

registration_c() -> Registration

registration_d() -> Registration

registry_of(seed: OutputReference) -> RegistryIdentity

The registry created by spending seed.

approval_of(registry: RegistryIdentity, registration: Registration) -> AssetName

The approval name the booker commits for registration in registry.

request_input(registry: RegistryIdentity, registration: Registration) -> Input

The request input that carries the approval of registration.

holding_output(registry: RegistryIdentity, registration: Registration) -> Output

The holding output the fold delivers the token of registration to.

state_output(seed: OutputReference, keys: List<ByteArray>) -> Output

The state output of the registry created from seed that holds keys.

state_input(seed: OutputReference, keys: List<ByteArray>) -> Input

first_registration() -> Scenario

One registration into an empty registry.

three_registrations() -> Scenario

Three registrations in a registry that holds one key.

holding_index(n: Int) -> Int

The index of the output of the nth registration: after an ordinary output and the continuing state.

changes_of(scenario: Scenario) -> List<Change>

The changes of the fold, each with the proof against the trie as the earlier changes advanced it.

minted(scenario: Scenario) -> Value

The mint of the fold: one token for each key, and each approval burned.

transaction_of(scenario: Scenario) -> Transaction

The transaction of the fold.

redeemer_of(scenario: Scenario) -> StateSpend

The redeemer of the fold.

Search Document