Module

Contract.Test.Testnet

#defaultTestnetConfig

Re-exports from Contract.Monad

#runContractInEnv

runContractInEnv :: forall (a :: Type). ContractEnv -> Contract a -> Aff a

Runs a contract in existing environment. Does not destroy the environment when contract execution ends.

Re-exports from Contract.Wallet

#withKeyWallet

withKeyWallet :: forall (a :: Type). KeyWallet -> Contract a -> Contract a

Re-exports from Ctl.Internal.Test.ContractTest

#ContractTestPlan

newtype ContractTestPlan

Represents Contracts in TestPlanM that depend on some wallet UtxoDistribution

Constructors

#ContractTest

newtype ContractTest

Represents a Contract test suite that depend on some wallet UtxoDistribution.

#withWallets

withWallets :: forall (distr :: Type) (wallets :: Type). UtxoDistribution distr wallets => distr -> (wallets -> Contract Unit) -> ContractTest

Store a wallet UtxoDistribution and a Contract that depends on those wallets

#sameWallets

sameWallets :: forall (distr :: Type) (wallets :: Type). UtxoDistribution distr wallets => distr -> TestPlanM (wallets -> Contract Unit) Unit -> ContractTestPlan

Store a wallet UtxoDistribution and a TestPlanM that depend on those wallets

#noWallet

noWallet :: Contract Unit -> ContractTest

Lift a Contract into ContractTest

Re-exports from Ctl.Internal.Test.UtxoDistribution

#UtxoAmount

type UtxoAmount = BigNum

UTxO amount in Lovelaces

#InitialUTxOsWithStakeKey

data InitialUTxOsWithStakeKey

A wrapper that allows to specify a stake key to attach to a generated pre-funded Address.

Constructors

Instances

#InitialUTxOs

#InitialUTxODistribution

type InitialUTxODistribution = Array InitialUTxOs

A spec for distribution of UTxOs between wallets.

#UtxoDistribution

class UtxoDistribution distr wallets | distr -> wallets

A type class that implements a type-safe interface for specifying UTXO distribution for wallets. Number of wallets in distribution specification matches the number of wallets provided to the user.

Instances

Re-exports from Ctl.Internal.Testnet.Contract

#testTestnetContracts

testTestnetContracts :: TestnetConfig -> TestPlanM ContractTest Unit -> TestPlanM (Aff Unit) Unit

Run several Contracts in tests in a (single) cardano-testnet environment (cardano-testnet, ogmios, kupo, etc.). NOTE: This uses MoteTs bracketing, and thus has the same caveats. Namely, brackets are run for each of the top-level groups and tests inside the bracket. If you wish to only set up Testnet once, ensure all tests that are passed to testTestnetContracts are wrapped in a single group. https://github.com/Plutonomicon/cardano-transaction-lib/blob/develop/doc/cardano-testnet-testing.md#testing-with-mote FIXME

#runTestnetTestPlan

runTestnetTestPlan :: TestnetConfig -> ContractTestPlan -> TestPlanM (Aff Unit) Unit

Run a ContractTestPlan in a (single) cardano-testnet environment. Supports wallet reuse - see docs on sharing wallet state between wallets in doc/cardano-testnet-testing.md. FIXME

#runTestnetContract

runTestnetContract :: forall (distr :: Type) (wallets :: Type) (a :: Type). UtxoDistribution distr wallets => TestnetConfig -> distr -> (wallets -> Contract a) -> Aff a

Run a single Contract in cardano-testnet environment.

Re-exports from Ctl.Internal.Testnet.Types

#TestnetConfig

type TestnetConfig = { clusterConfig :: TestnetClusterConfig, customLogger :: Maybe (LogLevel -> Message -> Aff Unit), hooks :: Hooks, kupoConfig :: ServerConfig, logLevel :: LogLevel, ogmiosConfig :: ServerConfig, suppressLogs :: Boolean }

Modules