convex-mockchain-0.2.0.0: Minimal mockchain for testing plutus scripts
Safe HaskellSafe-Inferred
LanguageHaskell2010

Convex.MockChain

Description

Minimal mockchain

Synopsis

State of the mockchain

initialStateForNodeParamsInitialUTXOsMockChainState Source #

Initialise the MockChainState with a list of UTxOs

genesisUTxO ∷ ∀ era capiEra. (EraCrypto era ~ StandardCrypto, EraTxOut era) ⇒ [(AddressInEra capiEra, Coin)] → UTxO era Source #

utxoSetMonadMockchain m ⇒ m (UtxoSet CtxUTxO ()) Source #

All transaction outputs

walletUtxoMonadMockchain m ⇒ Wallet → m (UtxoSet CtxUTxO ()) Source #

The wallet's transaction outputs on the mockchain

fromLedgerUTxOShelleyLedgerEra era ~ ledgerera ⇒ EraCrypto ledgerera ~ StandardCryptoShelleyBasedEra era → UTxO ledgerera → UTxO era Source #

Transaction validation

evaluateTxNodeParamsSlotNoUTxO ERATx BabbageEraEither ValidationError [ScriptContext ERA] Source #

Evaluate a transaction, returning all of its script contexts.

Plutus scripts

type ScriptContext era = (ShortByteString, Language, [Data era], ExUnits, CostModel) Source #

All the information needed to evaluate a Plutus script: The script itself, the script language, redeemers and datums, execution units required, and the cost model.

fullyAppliedScriptNodeParamsScriptContext ERAEither String (Program NamedDeBruijn DefaultUni DefaultFun ()) Source #

Apply the plutus script to all its arguments and return a plutus program

Mockchain implementation

newtype MockchainT m a Source #

Instances

Instances details
MonadTrans MockchainT Source # 
Instance details

Defined in Convex.MockChain

Methods

liftMonad m ⇒ m a → MockchainT m a Source #

Monad m ⇒ MonadFail (MockchainT m) Source # 
Instance details

Defined in Convex.MockChain

Methods

failStringMockchainT m a Source #

MonadIO m ⇒ MonadIO (MockchainT m) Source # 
Instance details

Defined in Convex.MockChain

Methods

liftIOIO a → MockchainT m a Source #

Monad m ⇒ Applicative (MockchainT m) Source # 
Instance details

Defined in Convex.MockChain

Methods

pure ∷ a → MockchainT m a Source #

(<*>)MockchainT m (a → b) → MockchainT m a → MockchainT m b Source #

liftA2 ∷ (a → b → c) → MockchainT m a → MockchainT m b → MockchainT m c Source #

(*>)MockchainT m a → MockchainT m b → MockchainT m b Source #

(<*)MockchainT m a → MockchainT m b → MockchainT m a Source #

Functor m ⇒ Functor (MockchainT m) Source # 
Instance details

Defined in Convex.MockChain

Methods

fmap ∷ (a → b) → MockchainT m a → MockchainT m b Source #

(<$) ∷ a → MockchainT m b → MockchainT m a Source #

Monad m ⇒ Monad (MockchainT m) Source # 
Instance details

Defined in Convex.MockChain

Methods

(>>=)MockchainT m a → (a → MockchainT m b) → MockchainT m b Source #

(>>)MockchainT m a → MockchainT m b → MockchainT m b Source #

return ∷ a → MockchainT m a Source #

Monad m ⇒ MonadBlockchain (MockchainT m) Source # 
Instance details

Defined in Convex.MockChain

Monad m ⇒ MonadMockchain (MockchainT m) Source # 
Instance details

Defined in Convex.MockChain

MonadLog m ⇒ MonadLog (MockchainT m) Source # 
Instance details

Defined in Convex.MockChain

runMockchainTMockchainT m a → NodeParamsMockChainState → m (Either MockchainError (a, MockChainState)) Source #

Run the MockchainT action with the NodeParams from an initial state

runMockchain0InitialUTXOsMockchain a → Either MockchainError (a, MockChainState) Source #

Run the mockchain action with an initial distribution, using the default node parameters

MockchainIO

runMockchain0IOInitialUTXOsMockchainIO a → IO (Either MockchainError (a, MockChainState)) Source #

Run the mockchain IO action with an initial distribution, using the default node parameters

runMockchain0IOWithInitialUTXOsNodeParamsMockchainIO a → IO (Either MockchainError (a, MockChainState)) Source #

Run the mockchain IO action with an initial distribution and a given set of node params