Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
GeniusYield.Test.Utils
Description
Synopsis
- data TestInfo = TestInfo {}
- data Wallets = Wallets {}
- withBalance ∷ GYTxQueryMonad m ⇒ String → User → m b → m (b, GYValue)
- withWalletBalancesCheck ∷ GYTxQueryMonad m ⇒ [(User, GYValue)] → m a → m a
- findLockedUtxosInBody ∷ Num a ⇒ GYAddress → GYTx → Maybe [a]
- getRefInfos ∷ GYTxQueryMonad m ⇒ GYAddress → m (Map (Some GYScript) GYTxOutRef)
- findRefScriptsInBody ∷ GYTxBody → Map (Some GYScript) GYTxOutRef
- addRefScript ∷ ∀ m. GYTxMonad m ⇒ GYAddress → GYScript 'PlutusV2 → m GYTxOutRef
- addRefInput ∷ GYTxMonad m ⇒ Bool → GYAddress → GYDatum → m GYTxOutRef
- fakeCoin ∷ FakeCoin → AssetClass
- fakeGold ∷ FromFakeCoin a ⇒ a
- fakeIron ∷ FromFakeCoin a ⇒ a
- afterAllSucceed ∷ TestTree → TestTree → TestTree
- feesFromLovelace ∷ Integer → GYValue
- withMaxQCTests ∷ Int → TestTree → TestTree
- pattern (:=) ∷ x → y → (x, y)
- module GeniusYield.Test.FeeTracker
Documentation
General information about the test environment to help in running polymorphic tests.
Constructors
TestInfo | |
Fields |
withBalance ∷ GYTxQueryMonad m ⇒ String → User → m b → m (b, GYValue) #
Computes a `GYTx*Monad` action and returns the result and how this action changed the balance of some Address.
withWalletBalancesCheck ∷ GYTxQueryMonad 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.
findLockedUtxosInBody ∷ Num a ⇒ GYAddress → GYTx → 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.
getRefInfos ∷ GYTxQueryMonad m ⇒ GYAddress → m (Map (Some GYScript) GYTxOutRef) #
Find reference scripts at given address.
findRefScriptsInBody ∷ GYTxBody → Map (Some GYScript) GYTxOutRef #
Find reference scripts in transaction body.
addRefScript ∷ ∀ m. GYTxMonad m ⇒ GYAddress → GYScript '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.
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.
fakeCoin ∷ FakeCoin → AssetClass #
Fake coin class generated from fixed tag.
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 #
feesFromLovelace ∷ Integer → GYValue #
Abstraction for explicitly building a Value representing the fees of a transaction.
withMaxQCTests ∷ Int → TestTree → TestTree #
Adjust the number of QuickCheck cases to generate.
module GeniusYield.Test.FeeTracker