Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Hydra.Chain.ScriptRegistry
Description
A data-type to keep track of reference Hydra scripts published on-chain, and needed to construct transactions leveraging reference inputs.
Synopsis
- queryScriptRegistry :: (MonadIO m, MonadThrow m) => NetworkId -> SocketPath -> [TxId] -> m ScriptRegistry
- publishHydraScripts :: NetworkId -> SocketPath -> SigningKey PaymentKey -> IO [TxId]
- newtype PublishScriptException = FailedToBuildPublishingTx (TxBodyErrorAutoBalance Era)
- buildScriptPublishingTxs :: MonadThrow m => PParams LedgerEra -> SystemStart -> NetworkId -> EraHistory -> Set PoolId -> UTxO -> SigningKey PaymentKey -> m [Tx]
Documentation
Arguments
:: (MonadIO m, MonadThrow m) | |
=> NetworkId | cardano-node's network identifier. A combination of network discriminant + magic number. |
-> SocketPath | Filepath to the cardano-node's domain socket |
-> [TxId] | |
-> m ScriptRegistry |
Query for TxIn
s in the search for outputs containing all the reference
scripts of the ScriptRegistry
.
This is implemented by repeated querying until we have all necessary reference scripts as we do only know the transaction id, not the indices.
Can throw at least NewScriptRegistryException
on failure.
Arguments
:: NetworkId | Expected network discriminant. |
-> SocketPath | Path to the cardano-node's domain socket |
-> SigningKey PaymentKey | Keys assumed to hold funds to pay for the publishing transaction. |
-> IO [TxId] |
newtype PublishScriptException Source #
Exception raised when building the script publishing transactions.
Constructors
FailedToBuildPublishingTx (TxBodyErrorAutoBalance Era) |
Instances
Exception PublishScriptException Source # | |
Defined in Hydra.Chain.ScriptRegistry | |
Show PublishScriptException Source # | |
Defined in Hydra.Chain.ScriptRegistry |
buildScriptPublishingTxs Source #
Arguments
:: MonadThrow m | |
=> PParams LedgerEra | |
-> SystemStart | |
-> NetworkId | |
-> EraHistory | |
-> Set PoolId | |
-> UTxO | Outputs that can be spent by signing key. |
-> SigningKey PaymentKey | Key owning funds to pay deposit and fees. |
-> m [Tx] |
Builds a chain of script publishing transactions. Throws: PublishScriptException