singular-registry
LicenseApache-2.0
Safe HaskellNone
LanguageGHC2021

Singular.State.Publication

Description

A transaction that runs the state validator or the application's validator carries its code from a reference output. The first registry of an application publishes both scripts; a later registry finds the live copies and publishes nothing. A copy is live when an output of the chain carries a reference script whose hash, computed from the script itself, is the expected one; an output that carries another script is never reused, whatever the provider claims.

Synopsis

Documentation

data References Source #

Where the scripts of an application can be read from.

Constructors

References 

Fields

data Publication Source #

The transaction that publishes the scripts no live output carries.

Constructors

Publication 

Fields

data ReferenceDiscovery Source #

Discovery evidence for a script. An empty list means that this provider returned no live copy, without distinguishing a spent output from one that never existed. A candidate carries its actual script hash, or no script.

Constructors

ReferenceDiscovery 

Fields

  • discoveryHash :: ScriptHash

    The expected hash of the requested script

  • discoveryCandidates :: [(TxIn, Maybe ScriptHash)]

    Output references and hashes computed from their carried scripts

Instances

Instances details
Show ReferenceDiscovery Source # 
Instance details

Defined in Singular.State.Publication

Methods

showsPrec :: Int -> ReferenceDiscovery -> ShowS Source #

show :: ReferenceDiscovery -> String Source #

showList :: [ReferenceDiscovery] -> ShowS Source #

Eq ReferenceDiscovery Source # 
Instance details

Defined in Singular.State.Publication

Methods

(==) :: ReferenceDiscovery -> ReferenceDiscovery -> Bool Source #

(/=) :: ReferenceDiscovery -> ReferenceDiscovery -> Bool Source #

planReferences Source #

Arguments

:: Session NoWitness IO 
-> Addr

The payer: fee, collateral, change and the owner of the new outputs

-> [Script ConwayEra] 
-> IO (Either Refusal References) 

Find the live copy of each script and plan the publication of the others, at the payer's address: one transaction that holds every missing script in an output of its own.

planNextReference Source #

Arguments

:: [TxIn]

Wallet outputs reserved for the later transaction

-> Session NoWitness IO 
-> Addr 
-> [Script ConwayEra] 
-> IO (Either Refusal References) 

Find every live copy and plan one missing script's publication, in the order requested. Call again after that transaction is live, using the new chain view. Each transaction is size-checked independently, and the reserved wallet outputs are left unspent for the later creation.