| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
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
- data References = References {
- referencesLive :: [(ScriptHash, (TxIn, TxOut ConwayEra))]
- referencesPublication :: Maybe Publication
- referencesDiscovery :: [ReferenceDiscovery]
- data Publication = Publication {
- publicationTx :: ConwayTx
- publicationOutputs :: [(ScriptHash, TxIn)]
- data ReferenceDiscovery = ReferenceDiscovery {
- discoveryHash :: ScriptHash
- discoveryCandidates :: [(TxIn, Maybe ScriptHash)]
- planReferences :: Session NoWitness IO -> Addr -> [Script ConwayEra] -> IO (Either Refusal References)
- planNextReference :: [TxIn] -> Session NoWitness IO -> Addr -> [Script ConwayEra] -> IO (Either Refusal References)
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
| |
Instances
| Show ReferenceDiscovery Source # | |
Defined in Singular.State.Publication Methods showsPrec :: Int -> ReferenceDiscovery -> ShowS Source # show :: ReferenceDiscovery -> String Source # showList :: [ReferenceDiscovery] -> ShowS Source # | |
| Eq ReferenceDiscovery Source # | |
Defined in Singular.State.Publication Methods (==) :: ReferenceDiscovery -> ReferenceDiscovery -> Bool Source # (/=) :: ReferenceDiscovery -> ReferenceDiscovery -> Bool 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.
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.