StandardTxVariations
Standard transaction variation patterns for property-based and exhaustive testing.
This object provides factory methods for creating common transaction variation patterns. Each method returns a TxVariations[S] or TxSamplingVariations[S] that can be combined with other variations using the ++ operator.
Variations receive a TxTemplate containing the base transaction builder, sponsor, and signer. They modify the builder or create new transactions using the template's sponsor/signer.
==Example Usage==
val stealVariation = StandardTxVariations.removeContractOutput[AuctionState](
extractUtxo = _.utxo,
redeemer = _ => BidRedeemer.toData,
script = auctionScript
)
// Combine with other variations
val allVariations = stealVariation ++ corruptDatumVariation
// Use in testing - txTemplate provides base tx, sponsor, signer
stealVariation.enumerate(provider, state, txTemplate)
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
StandardTxVariations.type
Members list
Value members
Concrete methods
Test around a deadline boundary - modifies validity interval of base tx.
Test around a deadline boundary - modifies validity interval of base tx.
Attributes
Test around a value threshold - modifies output value in base tx.
Test around a value threshold - modifies output value in base tx.
Attributes
Corrupt datum - return correct value but wrong datum.
Corrupt datum - return correct value but wrong datum.
Attributes
Default combined variations for testing common attack vectors.
Default combined variations for testing common attack vectors.
Includes:
removeContractOutput: Steal attack - spend without returning fundsduplicateOutput: Double output attack - split value into two outputsstealPartialValue: Partial theft - return less value than expected
Attributes
Extended default variations with corrupted datum and wrong address testing.
Extended default variations with corrupted datum and wrong address testing.
Attributes
Double satisfaction attack - spend two UTXOs, only satisfy one.
Double satisfaction attack - spend two UTXOs, only satisfy one.
Attributes
Duplicate output - split value into two outputs.
Duplicate output - split value into two outputs.
Attributes
Mint extra tokens beyond allowed.
Mint extra tokens beyond allowed.
Attributes
No validity range - removes time constraints from base tx.
No validity range - removes time constraints from base tx.
Attributes
Remove expected output - funds go to change (steal attack).
Remove expected output - funds go to change (steal attack).
Attributes
Remove required reference input from base tx.
Remove required reference input from base tx.
Attributes
Generate slots around a deadline.
Generate slots around a deadline.
Attributes
Return partial value - less than expected.
Return partial value - less than expected.
Attributes
Unauthorized mint - add minting to base transaction.
Unauthorized mint - add minting to base transaction.
Attributes
Generate values around a threshold.
Generate values around a threshold.
Attributes
Wide validity range - sets overly permissive time bounds on base tx.
Wide validity range - sets overly permissive time bounds on base tx.
Attributes
Wrong output address - send to wrong recipient.
Wrong output address - send to wrong recipient.
Attributes
Wrong redeemer - use incorrect redeemer with base tx outputs.
Wrong redeemer - use incorrect redeemer with base tx outputs.
Attributes
Add wrong/stale reference input to base tx.
Add wrong/stale reference input to base tx.