| 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 :: (ChainBackend m, MonadThrow m) => [TxId] -> m ScriptRegistry
- publishHydraScripts :: (ChainBackend m, MonadIO m, MonadCatch m) => Secret CardanoSigningKey -> m [TxId]
- handleError :: MonadThrow m => SomeException -> m a
- data PublishScriptException
- = PublishingFundsMissing Text
- | FailedToBuildPublishingTx (TxBodyErrorAutoBalance Era)
- buildScriptPublishingTxs :: MonadThrow m => PParams LedgerEra -> SystemStart -> NetworkId -> EraHistory -> Set PoolId -> UTxO -> Secret CardanoSigningKey -> m [Tx]
Documentation
queryScriptRegistry :: (ChainBackend m, MonadThrow m) => [TxId] -> m ScriptRegistry Source #
Query for TxIns 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
| :: (ChainBackend m, MonadIO m, MonadCatch m) | |
| => Secret CardanoSigningKey | Keys assumed to hold funds to pay for the publishing transaction. |
| -> m [TxId] |
handleError :: MonadThrow m => SomeException -> m a Source #
data PublishScriptException Source #
Exception raised when publishing Hydra scripts.
Constructors
| PublishingFundsMissing Text | |
| 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. |
| -> Secret CardanoSigningKey | Key owning funds to pay deposit and fees. |
| -> m [Tx] |
Builds a chain of script publishing transactions. Throws: PublishScriptException