Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | support@geniusyield.co |
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)
- ctxUser1 ∷ !User
- ctxUser2 ∷ !User
- ctxUser3 ∷ !User
- ctxGold ∷ !GYAssetClass
- ctxIron ∷ !GYAssetClass
- ctxLog ∷ !GYLog
- ctxLookupDatum ∷ !GYLookupDatum
- ctxQueryUtxos ∷ !GYQueryUTxO
- ctxGetParams ∷ !GYGetParameters
- data User = User {}
- data UserIdx
- userPkh ∷ User → GYPubKeyHash
- userVKey ∷ User → GYPaymentVerificationKey
- ctxRunI ∷ Ctx → UserIdx → GYTxMonadNode (GYTxSkeleton v) → IO GYTxBody
- ctxRunC ∷ ∀ a. Ctx → UserIdx → GYTxMonadNode a → IO a
- ctxRunF ∷ ∀ t v. Traversable t ⇒ Ctx → UserIdx → GYTxMonadNode (t (GYTxSkeleton v)) → IO (t GYTxBody)
- __ctxRunF ∷ ∀ t v. Traversable t ⇒ Ctx → User → 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 → UserIdx → GYTxBody → IO GYTxId
- __submitTx ∷ Ctx → User → GYTxBody → IO GYTxId
- ctxUser ∷ Ctx → UserIdx → User
- ctxUserAddr ∷ Ctx → UserIdx → GYAddress
- ctxUserPkh ∷ Ctx → UserIdx → GYPubKeyHash
- newTempUserCtx ∷ Ctx → UserIdx → GYValue → IO User
- ctxQueryBalance ∷ Ctx → UserIdx → IO GYValue
- findOutput ∷ GYAddress → GYTxBody → IO GYTxOutRef
- addRefScriptCtx ∷ Ctx → UserIdx → GYScript 'PlutusV2 → IO GYTxOutRef
- addRefInputCtx ∷ Ctx → UserIdx → Bool → GYAddress → GYDatum → IO GYTxOutRef
Context
Constructors
Ctx | |
Fields
|
User
Constructors
User | |
Fields |
userPkh ∷ User → GYPubKeyHash #
Operations
ctxRunI ∷ Ctx → UserIdx → GYTxMonadNode (GYTxSkeleton v) → IO GYTxBody #
ctxRunF ∷ ∀ t v. Traversable t ⇒ Ctx → UserIdx → GYTxMonadNode (t (GYTxSkeleton v)) → IO (t GYTxBody) #
__ctxRunF ∷ ∀ t v. Traversable t ⇒ Ctx → User → 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 #
Helpers
ctxUserAddr ∷ Ctx → UserIdx → GYAddress #
ctxUserPkh ∷ Ctx → UserIdx → GYPubKeyHash #
Arguments
∷ Ctx | |
→ UserIdx | User which will fund this new user. |
→ GYValue | Describes balance of new user. |
→ IO User |
Creates a new user with the given balance. Note that we'll deduct 5 ada from the given fund as a collateral output.
findOutput ∷ GYAddress → GYTxBody → IO GYTxOutRef #
Arguments
∷ Ctx | Given context. |
→ UserIdx | 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.