cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.MockChain.Error

Description

This module exposes the errors that can be raised during a mockchain run

Synopsis

Mockchain errors

data BalancingError Source #

Errors that can be produced during balancing

Constructors

NotEnoughFundForExtraMinAda Peer

The balancing user theoretically has enough funds to balancing the trasaction, but this balancing results in a surplus payment which they cannot afford ADA-wise.

NotEnoughFundForProperFee Peer

The balancing does not have enough funds to sustain the fee required to balance the transaction.

NotEnoughFund Peer Value

The balancing wallet does not have enough funds to balance the transaction

NoSuitableCollateral Integer Integer Value

The provided of collateral UTxOs does not have enough funds to cover the potential collateral cost

MissingBalancingUser

The balancing user has not be provided, but the balancing requires it

data MockChainError Source #

Errors that can be produced by the blockchain

Constructors

MCEValidationError ValidationPhase ValidationError

Validation errors, either in Phase 1 or Phase 2

MCEBalancingError BalancingError

Balancing errors

MCEToCardanoError ToCardanoError

Translating a skeleton element to its Cardano counterpart failed

MCEWrongReferenceScriptError TxOutRef ScriptHash (Maybe ScriptHash)

The required reference script is missing from a witness utxo

MCEUnknownOutRef TxOutRef

A UTxO is missing from the mockchain state

MCEPastSlot Slot Slot

A jump in time would result in a past slot

MCEUnsupportedFeature String

An attempt to invoke an unsupported feature has been made

MCEFailure String

Used to provide MonadFail instances.

Interpretating effects into `Error MockChainError`

runToCardanoErrorInMockChainError :: forall effs a. Member (Error MockChainError) effs => Sem (Error ToCardanoError : effs) a -> Sem effs a Source #

Interpreting ToCardanoError in terms of MockChainError

runFailInMockChainError :: forall effs a. Member (Error MockChainError) effs => Sem (Fail : effs) a -> Sem effs a Source #

Interpreting failures in terms of MockChainError