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

fail ∷ String → Run 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

get ∷ Run Mock #

put ∷ Mock → Run () #

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

testRun ∷ String → (Wallets → Run 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

(==) ∷ Wallet → Wallet → Bool #

(/=) ∷ Wallet → Wallet → Bool #

Ord Wallet # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

compare ∷ Wallet → Wallet → Ordering #

(<) ∷ Wallet → Wallet → Bool #

(<=) ∷ Wallet → Wallet → Bool #

(>) ∷ Wallet → Wallet → Bool #

(>=) ∷ Wallet → Wallet → Bool #

max ∷ Wallet → Wallet → Wallet #

min ∷ Wallet → Wallet → Wallet #

Show Wallet # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

showsPrec ∷ Int → Wallet → ShowS #

show ∷ Wallet → String #

showList ∷ [Wallet] → ShowS #

HasAddress Wallet # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

toAddress ∷ Wallet → Address

data Wallets #

Available wallets.

Constructors

Wallets 

Fields

Instances

Instances details
Eq Wallets # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

(==) ∷ Wallets → Wallets → Bool #

(/=) ∷ Wallets → Wallets → Bool #

Ord Wallets # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

compare ∷ Wallets → Wallets → Ordering #

(<) ∷ Wallets → Wallets → Bool #

(<=) ∷ Wallets → Wallets → Bool #

(>) ∷ Wallets → Wallets → Bool #

(>=) ∷ Wallets → Wallets → Bool #

max ∷ Wallets → Wallets → Wallets #

min ∷ Wallets → Wallets → Wallets #

Show Wallets # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

showsPrec ∷ Int → Wallets → ShowS #

show ∷ Wallets → String #

showList ∷ [Wallets] → ShowS #

newWallet ∷ String → GYValue → RandT StdGen Run Wallet #

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

runWallet ∷ Wallet → GYTxMonadRun a → Run (Maybe a) #

Runs a GYTxMonadRun action using the given wallet.

walletAddress ∷ Wallet → GYAddress #

Gets a GYAddress of a testing wallet.

walletPubKeyHash ∷ Wallet → GYPubKeyHash #

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.

waitUntilSlot ∷ GYSlot → GYTxMonadRun () #

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

findLockedUtxosInBody ∷ Num a ⇒ GYNetworkId → GYAddress → 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.

addRefScript ∷ GYAddress → GYValidator PlutusV2 → GYTxMonadRun (Maybe GYTxOutRef) #

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

expectInsufficientFunds ∷ Wallet → GYTxSkeleton 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

withMaxQCTests ∷ Int → TestTree → TestTree #

Adjust the number of QuickCheck cases to generate.

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

Pattern to create pairs easily.