cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Attack.DatumTampering

Description

This module provides an attack that modifies the datums of a TxSkel.

Synopsis

Tamper datum params

data DatumTamperingParams a b f k is Source #

Parameters of the tamper datum attack

Constructors

DatumTamperingParams 

Fields

allDatumTamperingParams :: forall a b f. Branching -> (a -> f b) -> DatumTamperingParams a b f A_Traversal '[] Source #

A tamper datum params where all the datums are considered for targets

overloadDatumTamperingParams :: forall k is. Branching -> Optic' k is TxSkel TxSkelOutDatum -> (Int -> Bool) -> DatumTamperingParams BuiltinData BuiltinData Maybe k is Source #

A tamper datum params where the targeted datums are overloaded with dummy extra data I 42 at the end of their BuiltinData representation. This only works if the root data is either a Constr or a List.

Tamper datum label

newtype DatumTamperingLabel a Source #

A label added to a TxSkel on which a tweak tampering a datum has been applied. The label contains all the datum contents that have been modified, before the modification was applied.

Constructors

DatumTamperingLabel [a] 

Tamper datum attack

datumTamperingAttack :: forall a b f k is effs. (DatumConstrs a, Ord a, DatumConstrs b, Foldable f, Alternative f, Is k A_Traversal, Members '[NonDet, Tweak] effs) => DatumTamperingParams a b f k is -> Sem effs [a] Source #

Applies a modification to all datums of type a focused by a given optic. Returns the list of modified datums, as they were before being modified.