-
Notifications
You must be signed in to change notification settings - Fork 222
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
Generate precompile tests #565
Conversation
…nto config-test-suites
accounts/abi/bind/precompilebind/precompile_config_test_template.go
Outdated
Show resolved
Hide resolved
// Run tests. | ||
for name, test := range tests { | ||
t.Run(name, func(t *testing.T) { | ||
test.Run(t, module, NewTestStateDB(t *testing.T)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewTestStateDB(t *testing.T)
does not seem correct here.
Is it possible to include a test that generates a precompile then compiles or calls gofmt on the resulting code? We could do this as a separate PR or an issue, however I think it will make it easier to edit the templates in the long run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean like a unit test in the precompile_bind_test
?
accounts/abi/bind/precompilebind/precompile_contract_test_template.go
Outdated
Show resolved
Hide resolved
accounts/abi/bind/precompilebind/precompile_contract_test_template.go
Outdated
Show resolved
Hide resolved
accounts/abi/bind/precompilebind/precompile_contract_test_template.go
Outdated
Show resolved
Hide resolved
…late.go Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
…late.go Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
…late.go Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
…t-evm into generate-precompile-tests
Why this should be merged
Adds unit test generation to precompile generation tool
How this works
Adds 2 new templates for contract and config tests.
How this was tested
Generated hello world precompile in #564
How is this documented
Page at https://docs.avax.network/subnets/hello-world-precompile-tutorial needs to be updated.