atlas-cardano-0.6.2: Application backend for Plutus smart contracts on Cardano
Copyright(c) 2023 GYELD GMBH
LicenseApache 2.0
Maintainer[email protected]
Stabilitydevelop
Safe HaskellSafe-Inferred
LanguageGHC2021

GeniusYield.Test.Utils

Description

 
Synopsis

Documentation

data TestInfo #

General information about the test environment to help in running polymorphic tests.

data Wallets #

Available wallets.

Constructors

Wallets 

Fields

Instances

Instances details
Show Wallets # 
Instance details

Defined in GeniusYield.Test.Utils

Methods

showsPrecIntWalletsShowS #

showWalletsString #

showList ∷ [Wallets] → ShowS #

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 #

createUserWithLovelaceGYTxGameMonad m ⇒ UserNatural → m User #

Create an user and fund them with the given amount of lovelace provided by the given funder user.

createUserWithAssetsGYTxGameMonad m ⇒ UserNatural → [(FakeCoin, Natural)] → m User #

`createUserWithAssets funder lovelaces tokens` is equivalent to `createUserWithLovelace funder lovelace', followed by 'mintTestAssets tokens' as the newly created user.

Note: This will obviously require the user to have enough lovelace to cover the fees and min ada deposits for the mints.

createUserFullGYTxGameMonad m ⇒ UserNatural → [(FakeCoin, Natural)] → m User #

This is a combination of createUserWithAssets and generateCollateral. It creates a user with ada, non-ada assets, and a collateral. Thereby making a user ready to participate in smart contracts.

withBalanceGYTxQueryMonad m ⇒ StringUser → m b → m (b, GYValue) #

Computes a `GYTx*Monad` action and returns the result and how this action changed the balance of some Address.

withWalletBalancesCheckGYTxQueryMonad m ⇒ [(User, GYValue)] → m a → m a #

Computes a `GYTx*Monad` 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.

findLockedUtxosInBodyNum a ⇒ GYAddressGYTxMaybe [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.

getRefInfosGYTxQueryMonad m ⇒ GYAddress → m (Map GYAnyScript GYTxOutRef) #

Find reference scripts at given address.

findRefScriptsInBodyGYTxBodyMap GYAnyScript GYTxOutRef #

Find reference scripts in transaction body.

addRefScript ∷ ∀ m. GYTxMonad m ⇒ GYAddressGYScript 'PlutusV2 → m GYTxOutRef #

Adds the given script to the given address and returns the reference for it. Note: The new utxo is given an inline unit datum.

addRefInput #

Arguments

GYTxMonad m 
Bool

Whether to inline this datum?

GYAddress

Where to place this output?

GYDatum

Our datum.

→ m GYTxOutRef 

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

mintTestAssetsGYTxMonad m ⇒ [(FakeCoin, Natural)] → m () #

Mint given amount of test tokens.

generateCollateralGYTxMonad m ⇒ m GYTxOutRef #

Create a collateral utxo out of the existing ada within a user wallet. Returns the collateral reference.

fakeCoinFakeCoinGYAssetClass #

Fake coin class generated from fixed tag.

fakeGoldFakeCoin #

Fake "Gold" coin to use during tests.

fakeIronFakeCoin #

Fake "Iron" coin to use during tests

afterAllSucceedTestTreeTestTreeTestTree #

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

feesFromLovelaceIntegerGYValue #

Abstraction for explicitly building a Value representing the fees of a transaction.

withMaxQCTestsIntTestTreeTestTree #

Adjust the number of QuickCheck cases to generate.

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

Pattern to create pairs easily.