Module

Ctl.Internal.Testnet.Contract

#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.

#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

#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

#withTestnetContractEnv

withTestnetContractEnv :: forall (distr :: Type) (wallets :: Type) (a :: Type). UtxoDistribution distr wallets => TestnetConfig -> distr -> (ContractEnv -> wallets -> Aff a) -> Aff a

Provide a ContractEnv connected to cardano-testnet. Can be used to run multiple Contracts using runContractInEnv.

#execDistribution

execDistribution :: TestPlanM ContractTest Unit -> Aff ContractTestPlan

Lifts the UTxO distributions of each test out of Mote, into a combined distribution. Adapts the tests to pick their distribution out of the combined distribution. NOTE: Skipped tests still have their distribution generated. This is the current method of constructing all the wallets with required distributions in one go during TestNet startup.

Modules