Skip to main content
Version: 1.6.0

mutation

module all

let func: <a, b>(_: a) => (_: (_: a) => b) => option<[b, mutation]>

Given a value to mutate (first argument), it will try all the mutations available of it, passing each one to the function (second argument). On the first case of non failure when running the function on a mutation, the value and mutation involved will be returned.

let from_file: <b, p, s>(_: string) => (_: s) => (_: tez) => (_: (_: [typed_address<p, s>, michelson_contract<p, s>, int]) => b) => option< [b, mutation] >

Given a contract from a file (passed by filepath, entrypoint and views), an initial storage and balance, it will originate mutants of the contract and pass the result to the function (last argument). On the first case of non failure when running the function on a mutation, the value and mutation involved will be returned.

let contract: <p, s, b>(_: module_contract<p, s>) => (_: s) => (_: tez) => ( _: (_: typed_address<p, s>) => (_: michelson_contract<p, s>) => (_: int) => b ) => option<[b, mutation]>

Given a contract as a module/namespace, an initial storage and balance, it will originate mutants of the contract and pass the result to the function (last argument). On the first case of non failure when running the function on a mutation, the value and mutation involved will be returned.

let value: <a>(_: nat) => (_: a) => option<[a, mutation]>

Mutates a value using a natural number as an index for the available mutations, returns an option for indicating whether mutation was successful or not.

let save: (_: string) => (_: mutation) => option<string>

This function reconstructs a file from a mutation (second argument), and saves it to a file in the directory path (first argument). It returns an optional string indicating the filename where the mutation was saved, or `None` if there was an error.