atlas-0.1.0.0: Application backend for Plutus smart contracts on Cardano
Copyright(c) 2023 GYELD GMBH
LicenseApache 2.0
Maintainersupport@geniusyield.co
Stabilitydevelop
Safe HaskellNone
LanguageHaskell2010

GeniusYield.Test.Utils

Description

 
Synopsis

Documentation

data Run a #

Instances

Instances details
Monad Run 
Instance details

Defined in Plutus.Model.Mock

Methods

(>>=)Run a → (a → Run b) → Run b #

(>>)Run a → Run b → Run b #

return ∷ a → Run a #

Functor Run 
Instance details

Defined in Plutus.Model.Mock

Methods

fmap ∷ (a → b) → Run a → Run b #

(<$) ∷ a → Run b → Run a #

MonadFail Run 
Instance details

Defined in Plutus.Model.Mock

Methods

failStringRun a #

Applicative Run 
Instance details

Defined in Plutus.Model.Mock

Methods

pure ∷ a → Run a #

(<*>)Run (a → b) → Run a → Run b #

liftA2 ∷ (a → b → c) → Run a → Run b → Run c #

(*>)Run a → Run b → Run b #

(<*)Run a → Run b → Run a #

MonadState Mock Run 
Instance details

Defined in Plutus.Model.Mock

Methods

getRun Mock #

put ∷ Mock → Run () #

state ∷ (Mock → (a, Mock)) → Run a #

testRunString → (WalletsRun a) → TestTree #

Given a test name, runs the trace for every wallet, checking there weren't errors.

data Wallet #

Testing Wallet representation.

Instances

Instances details
Eq Wallet # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

(==)WalletWalletBool #

(/=)WalletWalletBool #

Ord Wallet # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

compareWalletWalletOrdering #

(<)WalletWalletBool #

(<=)WalletWalletBool #

(>)WalletWalletBool #

(>=)WalletWalletBool #

maxWalletWalletWallet #

minWalletWalletWallet #

Show Wallet # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

showsPrecIntWalletShowS #

showWalletString #

showList ∷ [Wallet] → ShowS #

HasAddress Wallet # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

toAddressWallet → Address

data Wallets #

Available wallets.

Constructors

Wallets 

Fields

Instances

Instances details
Eq Wallets # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

(==)WalletsWalletsBool #

(/=)WalletsWalletsBool #

Ord Wallets # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

compareWalletsWalletsOrdering #

(<)WalletsWalletsBool #

(<=)WalletsWalletsBool #

(>)WalletsWalletsBool #

(>=)WalletsWalletsBool #

maxWalletsWalletsWallets #

minWalletsWalletsWallets #

Show Wallets # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

showsPrecIntWalletsShowS #

showWalletsString #

showList ∷ [Wallets] → ShowS #

newWalletStringGYValueRandT StdGen Run Wallet #

Given a name and an initial fund, create a testing wallet.

runWalletWalletGYTxMonadRun a → Run (Maybe a) #

Runs a GYTxMonadRun action using the given wallet.

walletAddressWalletGYAddress #

Gets a GYAddress of a testing wallet.

walletPubKeyHashWalletGYPubKeyHash #

Gets a GYPubKeyHash of a testing wallet.

balance ∷ HasAddress a ⇒ a → GYTxMonadRun GYValue #

Gets the balance from anything that HasAddress. The usal case will be a testing wallet.

withBalance ∷ HasAddress a ⇒ String → a → GYTxMonadRun b → GYTxMonadRun (b, GYValue) #

Computes a GYTxMonadRun action and returns the result and how this action changed the balance of some Address.

withWalletBalancesCheck ∷ [(Wallet, GYValue)] → GYTxMonadRun a → GYTxMonadRun a #

Computes a GYTxMonadRun action, checking that the Wallet balances change according to the input list.

Notes:

  • An empty list means no checks are performed.
  • The GYValue should be negative to check if the Wallet lost those funds.

waitUntilSlotGYSlotGYTxMonadRun () #

Waits until a certain GYSlot. Fails if the given slot is greater than the current slot.

findLockedUtxosInBodyNum a ⇒ GYNetworkIdGYAddress → Tx → Maybe [a] #

Returns the list of outputs of the transaction for the given address. Returns Nothing if it fails to decode an address contained in the transaction outputs.

addRefScriptGYAddressGYValidator PlutusV2GYTxMonadRun (Maybe GYTxOutRef) #

Adds the given script to the given address and returns the reference for it.

expectInsufficientFundsWalletGYTxSkeleton v → Run () #

Expect the transaction building to fail with a BalancingErrorInsufficientFunds error

addRefInput #

Arguments

Bool

Whether to inline this datum?

GYAddress

Where to place this output?

GYDatum

Our datum.

GYTxMonadRun (Maybe GYTxOutRef) 

Adds an input (whose datum we'll refer later) and returns the reference to it.

fakeGold ∷ FromFakeCoin a ⇒ a #

Fake "Gold" coin to use during tests. Can represent a GYAssetClass or a Plutus AssetClass

fakeIron ∷ FromFakeCoin a ⇒ a #

Fake "Iron" coin to use during tests Can represent a GYAssetClass or a Plutus AssetClass

afterAllSucceed ∷ TestTree → TestTree → TestTree #

Runs the second TestTree after all tests in the first TestTree succeed

withMaxQCTestsInt → TestTree → TestTree #

Adjust the number of QuickCheck cases to generate.

pattern (:=) ∷ x → y → (x, y) infix 0 #

Pattern to create pairs easily.