Skip to content

CallTestAndUndo - a simple abstract contract to help you write invariant tests that do not influence the story

License

Notifications You must be signed in to change notification settings

Recon-Fuzz/call-test-undo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CallTestAndUndo

A simple contract that allows you to perform stateful invariant tests without changing global state

Use Cases

When you're doing tests and don't want to track their side effects into the global state

You can use this abstract contract to perform the test and then revert all state changes

This way you can keep the "Story" simple while testing complex behavior

Usage

Make your contract inherit CallTestAndUndo

Edit the function you want to test to require it being called by this

Use _doTestAndReturnResult to call the function (use encodeCall)

Demo

See testDemoCal for a quick demo

About

CallTestAndUndo - a simple abstract contract to help you write invariant tests that do not influence the story

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published