test-case-generator/

directory
v1.0.1-rc.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2023 License: MIT, MIT

README

ctb-test-case-generator

A lightweight input fuzzing utility used for testing various contracts.

├── test-case-generator
│   ├── cmd: `ctb-test-case-genertor`'s binary
│   └── trie: Utility for generating random merkle trie roots / inclusion proofs

Usage

To build, run yarn build:fuzz from this directory or the contract package.

To generate an abi-encoded fuzz case, pass in a mode via the -m flag as well as an optional variant via the -v flag.

Available Modes
trie

Note Variant required for trie mode.

Variant Description
valid Generate a test case with a valid proof of inclusion for the k/v pair in the trie.
extra_proof_elems Generate an invalid test case with an extra proof element attached to an otherwise valid proof of inclusion for the passed k/v.
corrupted_proof Generate an invalid test case where the proof is malformed.
invalid_data_remainder Generate an invalid test case where a random element of the proof has more bytes than the length designates within the RLP list encoding.
invalid_large_internal_hash Generate an invalid test case where a long proof element is incorrect for the root.
invalid_internal_node_hash Generate an invalid test case where a small proof element is incorrect for the root.
prefixed_valid_key Generate a valid test case with a key that has been given a random prefix
empty_key Generate a valid test case with a proof of inclusion for an empty key.
partial_proof Generate an invalid test case with a partially correct proof

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL