Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds more tests related to precompiles #2709

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open

Conversation

diegoximenes
Copy link
Contributor

@diegoximenes diegoximenes commented Sep 27, 2024

Resolves NIT-2772.

Improve precompiles' test coverage.

Other precompiles methods from ArbOwner, ArbWasm, and ArbWasmCache, are tested in a PR from @ganeshvanahalli.

@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label Sep 27, 2024
@diegoximenes diegoximenes marked this pull request as ready for review September 30, 2024 10:38
"github.com/offchainlabs/nitro/util/testhelpers"
)

func TestArbGasInfo(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it's actually checking several different calls in the same test. But, I can't tell if the results of the later calls actually depend on the results of the earlier calls. In many cases, it looks like they are unrelated. If so, they should be in separate test functions to make it clearer which part of the test is failing, and to make the setup for the test clearly connect to the assertions in the test.

@@ -125,6 +142,184 @@ func TestPrecompileErrorGasLeft(t *testing.T) {
assertNotAllGasConsumed(common.HexToAddress("0xff"), arbDebug.Methods["legacyError"].ID)
}

func TestArbGasInfoAndArbOwner(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same feedback about doing too much in the same test function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants