Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | None |
Language | Haskell2010 |
GeniusYield.Test.Privnet.Ctx
Contents
Description
Synopsis
- data Ctx = Ctx {
- ctxEra ∷ !GYEra
- ctxInfo ∷ !(LocalNodeConnectInfo CardanoMode)
- ctxLCI ∷ !LCIClient
- ctxDbSync ∷ !(Maybe CardanoDbSyncConn)
- ctxUserF ∷ !User
- ctxUser2 ∷ !User
- ctxUser3 ∷ !User
- ctxUser4 ∷ !User
- ctxUser5 ∷ !User
- ctxUser6 ∷ !User
- ctxUser7 ∷ !User
- ctxUser8 ∷ !User
- ctxUser9 ∷ !User
- ctxGold ∷ !GYAssetClass
- ctxIron ∷ !GYAssetClass
- ctxLog ∷ !GYLog
- ctxLookupDatum ∷ !GYLookupDatum
- ctxQueryUtxos ∷ !GYQueryUTxO
- ctxGetParams ∷ !GYGetParameters
- data User = User {}
- ctxUsers ∷ Ctx → [User]
- userPkh ∷ User → GYPubKeyHash
- userVKey ∷ User → GYPaymentVerificationKey
- ctxRunI ∷ Ctx → User → GYTxMonadNode (GYTxSkeleton v) → IO GYTxBody
- ctxRunC ∷ ∀ a. Ctx → User → GYTxMonadNode a → IO a
- ctxRunF ∷ ∀ t v. Traversable t ⇒ Ctx → User → GYTxMonadNode (t (GYTxSkeleton v)) → IO (t GYTxBody)
- ctxRunFWithCollateral ∷ ∀ t v. Traversable t ⇒ Ctx → User → GYTxOutRef → Bool → GYTxMonadNode (t (GYTxSkeleton v)) → IO (t GYTxBody)
- ctxCurrentSlot ∷ Ctx → IO GYSlot
- ctxWaitNextSlot ∷ Ctx → IO ()
- ctxWaitUntilSlot ∷ Ctx → GYSlot → IO ()
- ctxProviders ∷ Ctx → GYProviders
- ctxSlotConfig ∷ Ctx → IO GYSlotConfig
- submitTx ∷ Ctx → User → GYTxBody → IO GYTxId
- newTempUserCtx ∷ Ctx → User → GYValue → Bool → IO User
- ctxQueryBalance ∷ Ctx → User → IO GYValue
- findOutput ∷ GYAddress → GYTxBody → IO GYTxOutRef
- addRefScriptCtx ∷ Ctx → User → GYScript 'PlutusV2 → IO GYTxOutRef
- addRefInputCtx ∷ Ctx → User → Bool → GYAddress → GYDatum → IO GYTxOutRef
Context
Constructors
Ctx | |
Fields
|
User
userPkh ∷ User → GYPubKeyHash #
Operations
ctxRunI ∷ Ctx → User → GYTxMonadNode (GYTxSkeleton v) → IO GYTxBody #
ctxRunF ∷ ∀ t v. Traversable t ⇒ Ctx → User → GYTxMonadNode (t (GYTxSkeleton v)) → IO (t GYTxBody) #
Arguments
∷ ∀ t v. Traversable t | |
⇒ Ctx | |
→ User | |
→ GYTxOutRef | Reference to UTxO to be used as collateral. |
→ Bool | To check whether this given collateral UTxO has value of exact 5 ada? If it doesn't have exact 5 ada, it would be ignored. |
→ GYTxMonadNode (t (GYTxSkeleton v)) | |
→ IO (t GYTxBody) |
Variant of ctxRunF
where caller can also give the UTxO to be used as collateral.
ctxCurrentSlot ∷ Ctx → IO GYSlot #
ctxWaitNextSlot ∷ Ctx → IO () #
ctxWaitUntilSlot ∷ Ctx → GYSlot → IO () #
ctxProviders ∷ Ctx → GYProviders #
ctxSlotConfig ∷ Ctx → IO GYSlotConfig #
Helpers
Arguments
∷ Ctx | |
→ User | User which will fund this new user. |
→ GYValue | Describes balance of new user. |
→ Bool | Create collateral output of 5 ada? |
→ IO User |
Creates a new user with the given balance. Note that the actual balance which this user get's could be more than what is provided to satisfy minimum ada requirement of a UTxO.
findOutput ∷ GYAddress → GYTxBody → IO GYTxOutRef #
Arguments
∷ Ctx | Given context. |
→ User | User which will execute the transaction (if required). |
→ GYScript 'PlutusV2 | Given script. |
→ IO GYTxOutRef | Returns the reference for the desired output. |
Function to add for a reference script. It adds the script in so called "Always failing" validator so that it won't be later possible to spend this output. There is a slight optimisation here in that if the desired reference script already exists then we don't add another one and return the reference for the found one else, we create a new one.