Make contract testing utilities avaiable to all
- Dominant language
- Rust
- Stars
- 1.7k
- Forks
- 218
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
We currently have a number of fixture files being compiled and tested [here](https://github.com/ethereum/fe/tree/master/compiler/tests).
The testing utilities we use are valuable to us and would be valuable to other people. Problem is, these utilities are not being distributed, so no one else can use them. We should make an effort to package our contract testing utilities for use outside of this repository.
In general, I think it's good to accomplish multiple things at once. Writing our own internal utilities for contract testing and then creating a separate framework for users later on is duplicating work. So, we should make our testing utilities openly available and user-friendly.
To start, we should create a new library in this repository that contains all of the existing testing utilities (call it `fe-testing` or something). This will be enough to close this issue.
We should make incremental improvements to the library from there on out. The improvements might include the following:
- Add fuzzing tooling.
- Create macros that make tests more concise and easier for those unfamiliar with Rust to write.
- Example macros:
- `assert_event_emitted!(...)`, `assert_reverts!(...)` `assert_call!(...)`, `call!(...)`
- `set_block_number!(...)`, `set_block_timestamp!(...)`
- `u256!(2343542345456345634563456)`, `string!("hello world")`
- Integration with the CLI
- We might want to include the Rust compiler in CLI, so people can run tests without installing Rust. This might not be so simple, tho.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by inspecting the fixture files and testing utilities under compiler/tests to understand what is currently compiled and tested. Create a new fe-testing library in this repository containing the existing utilities, and verify that the library is packaged for use outside the repository.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100