You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're currently limited to only testing the public interface of a contract. This can make debugging features that rely on multiple new runtime functions difficult. We should be able to test the runtime directly within our contracts test suite.
How can it be fixed
Create a new testing function that takes the following: an executor, contract fixture path, contract name, and a set of Yul statements to inject into the runtime.
What we ultimately want to do is build a Yul object similar to an actual contract, but it only contains the runtime (no constructor) and the test statements. We would then compile this object to bytecode and execute it. If we hit a revert, the test has failed.
We should be able to create a function similar to runtime::build_with_abi_dispatcher, but named build_with_test_statements that simply inserts test statements into the runtime object. We then compile and execute.
The text was updated successfully, but these errors were encountered:
What is wrong?
We're currently limited to only testing the public interface of a contract. This can make debugging features that rely on multiple new runtime functions difficult. We should be able to test the runtime directly within our contracts test suite.
How can it be fixed
Create a new testing function that takes the following: an executor, contract fixture path, contract name, and a set of Yul statements to inject into the runtime.
It should look something like this:
What we ultimately want to do is build a Yul object similar to an actual contract, but it only contains the runtime (no constructor) and the test statements. We would then compile this object to bytecode and execute it. If we hit a revert, the test has failed.
We should be able to create a function similar to
runtime::build_with_abi_dispatcher
, but namedbuild_with_test_statements
that simply inserts test statements into the runtime object. We then compile and execute.The text was updated successfully, but these errors were encountered: