cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Skeleton.Option

Synopsis

Documentation

data BalanceOutputPolicy Source #

Whether to adjust a potentially existing output to the balancing wallet with the change during transaction balancing.

Constructors

AdjustExistingOutput

Try to adjust an existing public key output with the change. If no suitable output can be found, create a new change output.

DontAdjustExistingOutput

Do not change the existing outputs, always create a new change output.

data FeePolicy Source #

What fee policy to use in the transaction.

Constructors

AutoFeeComputation

Use automatic fee computation. If balancing is activated, an optimal fee will be computed based on the transaction and existing utxos in the balancing wallet. Otherwise, the maximum transaction fee will be applied.

ManualFee Integer

Provide a fee to the transaction. If the autobalancing is activated, it will be attempted around this fee, which might lead to failure if it is too low, otherwise, this fee will be given to transaction generation.

Instances

Instances details
Show FeePolicy Source # 
Instance details

Defined in Cooked.Skeleton.Option

Default FeePolicy Source # 
Instance details

Defined in Cooked.Skeleton.Option

Methods

def :: FeePolicy #

Eq FeePolicy Source # 
Instance details

Defined in Cooked.Skeleton.Option

Ord FeePolicy Source # 
Instance details

Defined in Cooked.Skeleton.Option

data BalancingPolicy Source #

Whether to balance the transaction or not, and which wallet to use to provide outputs for balancing.

Constructors

BalanceWithFirstSigner

Balance with the first signer of the list of signers

BalanceWith Wallet

Balance using a given wallet

DoNotBalance

Do not perform balancing at all

data BalancingUtxos Source #

Which UTxOs to use when balancing. Note that utxos that are already known by the skeleton being balanced (in the sense of txSkelKnownTxOutRefs, i.e. inputs and reference inputs) will be filtered out during balancing.

Constructors

BalancingUtxosFromBalancingWallet

Use all UTxOs containing only a Value (no datum, no staking credential, and no reference script) belonging to the balancing wallet.

BalancingUtxosFromSet (Set TxOutRef)

Use the provided UTxOs. UTxOs belonging to scripts will be filtered out

newtype RawModTx Source #

Wraps a function that will be applied to a Cardano transaction after it has been generated from this skeleton (and thus, after balancing has been performed since it operates on skeletons).

Constructors

RawModTx (Tx ConwayEra -> Tx ConwayEra) 

Instances

Instances details
Show RawModTx Source # 
Instance details

Defined in Cooked.Skeleton.Option

Eq RawModTx Source # 
Instance details

Defined in Cooked.Skeleton.Option

newtype EmulatorParamsModification Source #

Wraps a function that will temporarily change the emulator parameters for the transaction's balancing and submission.

data CollateralUtxos Source #

Describe which UTxOs to use as collaterals

Constructors

CollateralUtxosFromBalancingWallet

Rely on automated computation with only-value UTxOs from the balancing wallet. Return collaterals will be sent to this wallet.

CollateralUtxosFromWallet Wallet

Rely on automated computation with only-value UTxOs from a given wallet. Return collaterals will be sent to this wallet.

CollateralUtxosFromSet (Set TxOutRef) Wallet

Manually provide a set of candidate UTxOs to be used as collaterals alongside a wallet to send return collaterals back to.

data AnchorResolution Source #

Describes how to resolve anchors in proposal procedures

Constructors

AnchorResolutionLocal (Map String ByteString)

Provide a map between urls and page content as Bytestring

AnchorResolutionHttp

Allow online fetch of pages from a given URL. Important note: using this option is unsafe, as it requires a web connection and inherently prevents guarantees of reproducibily. Use at your own discretion.

applyRawModOnBalancedTx :: [RawModTx] -> Tx ConwayEra -> Tx ConwayEra Source #

Applies a list of modifications right before the transaction is submitted. The leftmost function in the argument list is applied first.

data TxOpts Source #

Set of options to modify the behavior of generating and validating some transaction.

Constructors

TxOpts 

Fields

  • txOptAutoSlotIncrease :: Bool

    Whether to increase the slot counter automatically on transaction submission. This is useful for modelling transactions that could be submitted in parallel in reality, so there should be no explicit ordering of what comes first.

    Default is True.

  • txOptUnsafeModTx :: [RawModTx]

    Applies an arbitrary modification to a transaction after it has been potentially adjusted (txOptEnsureMinAda) and balanced. The name of this option contains unsafe to draw attention to the fact that modifying a transaction at that stage might make it invalid. Still, this offers a hook for being able to alter a transaction in unforeseen ways. It is mostly used to test contracts that have been written for custom PABs.

    One interesting use of this function is to observe a transaction just before it is being sent for validation, with

    txOptUnsafeModTx = [RawModTxAfterBalancing Debug.Trace.traceShowId]

    The leftmost function in the list is applied first.

    Default is [].

  • txOptBalancingPolicy :: BalancingPolicy

    Whether to balance the transaction or not, and which wallet should provide/reclaim the missing and surplus value. Balancing ensures that

    input + mints == output + fees + burns

    If you decide to set txOptBalance = DoNotBalance you will have trouble satisfying that equation by hand unless you use ManualFee. You will likely see a error about value preservation.

    Default is BalanceWithFirstSigner

  • txOptFeePolicy :: FeePolicy

    The fee to use when balancing the transaction

    Default is AutomaticFeeComputation

  • txOptBalanceOutputPolicy :: BalanceOutputPolicy

    The BalanceOutputPolicy to apply when balancing the transaction.

    Default is AdjustExistingOutput.

  • txOptBalancingUtxos :: BalancingUtxos

    Which UTxOs to use during balancing. This can either be a precise list, or rely on automatic searches for utxos with values only belonging to the balancing wallet.

    Default is BalancingUtxosFromBalancingWallet.

  • txOptEmulatorParamsModification :: Maybe EmulatorParamsModification

    Apply an arbitrary modification to the protocol parameters that are used to balance and submit the transaction. This is obviously a very unsafe thing to do if you want to preserve compatibility with the actual chain. It is useful mainly for testing purposes, when you might want to use extremely big transactions or transactions that exhaust the maximum execution budget. Such a thing could be accomplished with

    txOptEmulatorParamsModification = Just $ EmulatorParamsModification increaseTransactionLimits

    for example.

    Default is Nothing.

  • txOptCollateralUtxos :: CollateralUtxos

    Which utxos to use as collaterals. They can be given manually, or computed automatically from a given, or the balancing, wallet.

    Default is CollateralUtxosFromBalancingWallet

  • txOptAnchorResolution :: AnchorResolution

    How to resolve anchor in proposal procedures

    Default is 'AnchorResolutionLocal Map.Empty'

  • txOptAutoReferenceScripts :: Bool

    Whether to automatically fill up reference inputs in redeemers when they contain the right reference script. This will imply going through all the known utxos with reference scripts and compare their hashes, thus will slightly reduce performance.

    Defaut is False.

Instances

Instances details
Show TxOpts Source # 
Instance details

Defined in Cooked.Skeleton.Option

Default TxOpts Source # 
Instance details

Defined in Cooked.Skeleton.Option

Methods

def :: TxOpts #

Eq TxOpts Source # 
Instance details

Defined in Cooked.Skeleton.Option

Methods

(==) :: TxOpts -> TxOpts -> Bool #

(/=) :: TxOpts -> TxOpts -> Bool #