| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Singular.Registry.Confirmation
Description
Exact-output confirmation from generic sessions and explicit clock effects. Confirmation reads have their own acquisitions, after the body is prepared.
Synopsis
- data ConfirmationRuntime (m :: Type -> Type) = ConfirmationRuntime {
- currentPosixMs :: m Integer
- pausePolling :: Int -> m ()
- attemptWindowRead :: forall a. m a -> m (Either ConfirmationFailure a)
- boundedConfirmation :: forall a. TxId -> Int -> m (Either Integer a) -> m (Either WaitFailure a)
- data ConfirmationFailure
- = ConfirmationAcquireFailure AcquireFailure
- | ConfirmationReadFailure ReadFailure
- | ConfirmationTimeFailure NetworkTimeFailure
- | ConfirmationNoOutput TxId
- | ConfirmationWaitFailure WaitFailure
- confirmTransaction :: Monad m => ConfirmationRuntime m -> LedgerProvider w m -> Network -> ConwayTx -> m (Either ConfirmationFailure ())
- confirmationWindow :: Monad m => ConfirmationRuntime m -> LedgerProvider w m -> Network -> ConwayTx -> m (Either ConfirmationFailure (Integer, Int))
- newIOConfirmationRuntime :: IO (ConfirmationRuntime IO)
- awaitTransaction :: LedgerProvider w IO -> Network -> ConwayTx -> IO ()
Documentation
data ConfirmationRuntime (m :: Type -> Type) Source #
The consumer supplies clock, sleep and whole-action cancellation effects. A pure State interpreter supplies the same vocabulary without embedded IO.
Constructors
| ConfirmationRuntime | |
Fields
| |
data ConfirmationFailure Source #
Raw refusals and infrastructure timeouts remain distinct.
Constructors
| ConfirmationAcquireFailure AcquireFailure | |
| ConfirmationReadFailure ReadFailure | |
| ConfirmationTimeFailure NetworkTimeFailure | |
| ConfirmationNoOutput TxId | |
| ConfirmationWaitFailure WaitFailure |
Instances
| Exception ConfirmationFailure Source # | |
Defined in Singular.Registry.Confirmation Methods toException :: ConfirmationFailure -> SomeException Source # fromException :: SomeException -> Maybe ConfirmationFailure Source # displayException :: ConfirmationFailure -> String Source # backtraceDesired :: ConfirmationFailure -> Bool Source # | |
| Show ConfirmationFailure Source # | |
Defined in Singular.Registry.Confirmation Methods showsPrec :: Int -> ConfirmationFailure -> ShowS Source # show :: ConfirmationFailure -> String Source # showList :: [ConfirmationFailure] -> ShowS Source # | |
confirmTransaction :: Monad m => ConfirmationRuntime m -> LedgerProvider w m -> Network -> ConwayTx -> m (Either ConfirmationFailure ()) Source #
Output zero must be visible under its exact transaction reference. The finite upper bound is validated before its uncapped two-minute margin; an unbounded body keeps the existing five-minute wall-clock window. Retry after one second, then back off to the original five-second interval so a slow or missing transaction does not multiply provider traffic.
confirmationWindow :: Monad m => ConfirmationRuntime m -> LedgerProvider w m -> Network -> ConwayTx -> m (Either ConfirmationFailure (Integer, Int)) Source #
Derive the same bounded window used by confirmTransaction. A private
read-only recorder may inspect it without inventing a transaction output or
starting a visibility poll. This performs no submission or confirmation.
newIOConfirmationRuntime :: IO (ConfirmationRuntime IO) Source #
IO cancellation preserves the original wait failure and other exceptions.
awaitTransaction :: LedgerProvider w IO -> Network -> ConwayTx -> IO () Source #
Production IO callers rethrow wait failures as infrastructure exceptions, retaining the existing timeout identity instead of publishing a refusal.