Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Output = Output {
- outputTxOut :: TxOut CtxTx Era
- outputIx :: TxIx
- data Input = Input {
- inputTxOut :: TxOut CtxUTxO Era
- inputTxIn :: TxIn
- class IsInputOrOutput t where
- changeAddressOf :: t -> AddressAny -> TxModifier
- changeValueOf :: t -> Value -> TxModifier
- changeDatumOf :: t -> Datum -> TxModifier
- addressOf :: t -> AddressAny
- valueOf :: t -> Value
- type Datum = TxOutDatum CtxTx Era
- type Redeemer = ScriptData
- newtype TxModifier = TxModifier [TxMod]
- data TxMod where
- RemoveInput :: TxIn -> TxMod
- RemoveOutput :: TxIx -> TxMod
- ChangeOutput :: TxIx -> Maybe AddressAny -> Maybe Value -> Maybe Datum -> TxMod
- ChangeInput :: TxIn -> Maybe AddressAny -> Maybe Value -> Maybe Datum -> TxMod
- ChangeScriptInput :: TxIn -> Maybe Value -> Maybe Datum -> Maybe Redeemer -> TxMod
- ChangeValidityRange :: Maybe (TxValidityLowerBound Era) -> Maybe (TxValidityUpperBound Era) -> TxMod
- AddOutput :: AddressAny -> Value -> Datum -> TxMod
- AddInput :: AddressAny -> Value -> Datum -> TxMod
- AddPlutusScriptInput :: PlutusScript PlutusScriptV2 -> Value -> Datum -> Redeemer -> TxMod
- AddSimpleScriptInput :: SimpleScript SimpleScriptV2 -> Value -> TxMod
- ReplaceTx :: Tx Era -> UTxO Era -> TxMod
- txMod :: TxMod -> TxModifier
- applyTxModifier :: Tx Era -> UTxO Era -> TxModifier -> (Tx Era, UTxO Era)
- applyTxMod :: Tx Era -> UTxO Era -> TxMod -> (Tx Era, UTxO Era)
- addOutput :: AddressAny -> Value -> Datum -> TxModifier
- removeOutput :: Output -> TxModifier
- addKeyInput :: AddressAny -> Value -> Datum -> TxModifier
- removeInput :: Input -> TxModifier
- addPlutusScriptInput :: PlutusScript PlutusScriptV2 -> Value -> Datum -> Redeemer -> TxModifier
- addSimpleScriptInput :: SimpleScript SimpleScriptV2 -> Value -> TxModifier
- changeRedeemerOf :: Input -> Redeemer -> TxModifier
- changeValidityRange :: (TxValidityLowerBound Era, TxValidityUpperBound Era) -> TxModifier
- changeValidityLowerBound :: TxValidityLowerBound Era -> TxModifier
- changeValidityUpperBound :: TxValidityUpperBound Era -> TxModifier
- replaceTx :: Tx Era -> UTxO Era -> TxModifier
Documentation
A transaction output paired with its index in the transaction.
Output | |
|
Instances
Show Output Source # | |
IsInputOrOutput Output Source # | |
Defined in Test.QuickCheck.ContractModel.ThreatModel.TxModifier changeAddressOf :: Output -> AddressAny -> TxModifier Source # changeValueOf :: Output -> Value -> TxModifier Source # changeDatumOf :: Output -> Datum -> TxModifier Source # |
A transaction input reference togheter with the corresponding TxOut
from the UTxO
set.
Input | |
|
Instances
Show Input Source # | |
IsInputOrOutput Input Source # | |
Defined in Test.QuickCheck.ContractModel.ThreatModel.TxModifier changeAddressOf :: Input -> AddressAny -> TxModifier Source # changeValueOf :: Input -> Value -> TxModifier Source # changeDatumOf :: Input -> Datum -> TxModifier Source # |
class IsInputOrOutput t where Source #
changeAddressOf :: t -> AddressAny -> TxModifier Source #
Change the target address of an input or an output. For outputs this means redirecting an output to a different address, and for inputs it means modifying the UTxO set, changing the owner of the given input.
Note: Does not work for script inputs.
changeValueOf :: t -> Value -> TxModifier Source #
Change the value of an input or an output.
changeDatumOf :: t -> Datum -> TxModifier Source #
Change the datum on an input or an output.
addressOf :: t -> AddressAny Source #
Get the address (pubkey or script address) of an input or an output.
valueOf :: t -> Value Source #
Get the value at an input or an output.
Instances
IsInputOrOutput Input Source # | |
Defined in Test.QuickCheck.ContractModel.ThreatModel.TxModifier changeAddressOf :: Input -> AddressAny -> TxModifier Source # changeValueOf :: Input -> Value -> TxModifier Source # changeDatumOf :: Input -> Datum -> TxModifier Source # | |
IsInputOrOutput Output Source # | |
Defined in Test.QuickCheck.ContractModel.ThreatModel.TxModifier changeAddressOf :: Output -> AddressAny -> TxModifier Source # changeValueOf :: Output -> Value -> TxModifier Source # changeDatumOf :: Output -> Datum -> TxModifier Source # |
type Datum = TxOutDatum CtxTx Era Source #
Type synonym for datums. The CtxTx
context means that the actual datum value can be present,
not just the hash.
newtype TxModifier Source #
The type of transaction modifiers. When combined using the monoid instance, individual modifications are applied in left-to-right order.
Instances
Semigroup TxModifier Source # | |
Defined in Test.QuickCheck.ContractModel.ThreatModel.TxModifier (<>) :: TxModifier -> TxModifier -> TxModifier Source # sconcat :: NonEmpty TxModifier -> TxModifier Source # stimes :: Integral b => b -> TxModifier -> TxModifier Source # | |
Monoid TxModifier Source # | |
Defined in Test.QuickCheck.ContractModel.ThreatModel.TxModifier mempty :: TxModifier Source # mappend :: TxModifier -> TxModifier -> TxModifier Source # mconcat :: [TxModifier] -> TxModifier Source # |
RemoveInput :: TxIn -> TxMod | |
RemoveOutput :: TxIx -> TxMod | |
ChangeOutput :: TxIx -> Maybe AddressAny -> Maybe Value -> Maybe Datum -> TxMod | |
ChangeInput :: TxIn -> Maybe AddressAny -> Maybe Value -> Maybe Datum -> TxMod | |
ChangeScriptInput :: TxIn -> Maybe Value -> Maybe Datum -> Maybe Redeemer -> TxMod | |
ChangeValidityRange :: Maybe (TxValidityLowerBound Era) -> Maybe (TxValidityUpperBound Era) -> TxMod | |
AddOutput :: AddressAny -> Value -> Datum -> TxMod | |
AddInput :: AddressAny -> Value -> Datum -> TxMod | |
AddPlutusScriptInput :: PlutusScript PlutusScriptV2 -> Value -> Datum -> Redeemer -> TxMod | |
AddSimpleScriptInput :: SimpleScript SimpleScriptV2 -> Value -> TxMod | |
ReplaceTx :: Tx Era -> UTxO Era -> TxMod |
txMod :: TxMod -> TxModifier Source #
applyTxModifier :: Tx Era -> UTxO Era -> TxModifier -> (Tx Era, UTxO Era) Source #
addOutput :: AddressAny -> Value -> Datum -> TxModifier Source #
Add a new output of any type (public key or script)
removeOutput :: Output -> TxModifier Source #
Remove an output of any type.
addKeyInput :: AddressAny -> Value -> Datum -> TxModifier Source #
Add a new public key input.
removeInput :: Input -> TxModifier Source #
Remove an input of any type.
addPlutusScriptInput :: PlutusScript PlutusScriptV2 -> Value -> Datum -> Redeemer -> TxModifier Source #
Add a plutus script input.
addSimpleScriptInput :: SimpleScript SimpleScriptV2 -> Value -> TxModifier Source #
Add a simple script input.
changeRedeemerOf :: Input -> Redeemer -> TxModifier Source #
Change the redeemer of a script input.
changeValidityRange :: (TxValidityLowerBound Era, TxValidityUpperBound Era) -> TxModifier Source #
Change the validity range of the transaction.
changeValidityLowerBound :: TxValidityLowerBound Era -> TxModifier Source #
Change the validity lower bound of the transaction.
changeValidityUpperBound :: TxValidityUpperBound Era -> TxModifier Source #
Change the validity upper bound of the transaction.