-
Notifications
You must be signed in to change notification settings - Fork 278
sync: coreth PR #1279: style: forbidigo t.Fatal #1849
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
Merged
+834
−2,081
Merged
Changes from 43 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
96fc992
style: forbidigo t.Fatal (#1279)
alarso16 1a0ecea
subnet-evm specific linting
JonathanOppenheimer a32a038
Merge branch 'master' into JonathanOppenheimer/sync-pr-1279-forbidgo
JonathanOppenheimer fc68ccd
fix merge
JonathanOppenheimer ce76ccf
use require nil instead
JonathanOppenheimer 4405b43
fix linting
JonathanOppenheimer 7ed4f7b
Add set default log from coreth
JonathanOppenheimer d725b55
lint
JonathanOppenheimer 104c7cb
fix merge
JonathanOppenheimer 94f3547
get rid of a lot of require.Fail
JonathanOppenheimer 7da2909
some Austin comments
JonathanOppenheimer 54688c7
More Austin comments
JonathanOppenheimer 963d58f
Update core/blockchain_ext_test.go
JonathanOppenheimer 016a09c
lint
JonathanOppenheimer 324071c
more cleanup
JonathanOppenheimer dccd040
more austin
JonathanOppenheimer 9723436
Update plugin/evm/customtypes/block_ext_test.go
JonathanOppenheimer cea161c
Update plugin/evm/customtypes/header_ext_test.go
JonathanOppenheimer aa1b960
More Austin suggestions
JonathanOppenheimer 9602fd5
fix sticky test
JonathanOppenheimer a863dda
Update core/blockchain_ext_test.go
JonathanOppenheimer 6fd5673
further simplify api extra test
JonathanOppenheimer 67e5a35
More Austin comment
JonathanOppenheimer efba90f
simplify test
JonathanOppenheimer 2efea13
fix uncles test
JonathanOppenheimer 15eddc3
Update plugin/evm/syncervm_test.go
JonathanOppenheimer 544e028
clean up code syncer test
JonathanOppenheimer f209131
Update plugin/evm/vm_test.go
JonathanOppenheimer 784946a
Austin comments
JonathanOppenheimer fca96c1
remove confusing error checking
JonathanOppenheimer 21dca21
austin comments
JonathanOppenheimer 6f634bc
revert
JonathanOppenheimer b6007a9
remove out of PR scope change
JonathanOppenheimer d002836
don't fully revert
JonathanOppenheimer f3a60b6
lint
JonathanOppenheimer 6f63d49
require no error
JonathanOppenheimer f99591a
add blockchain stop back
JonathanOppenheimer 6743707
use binint.cmp
JonathanOppenheimer 4d25847
Merge branch 'master' into JonathanOppenheimer/sync-pr-1279-forbidgo
JonathanOppenheimer 25db6a9
restore blockcahin test
JonathanOppenheimer 64ca62c
Merge branch 'master' into JonathanOppenheimer/sync-pr-1279-forbidgo
JonathanOppenheimer d54febd
remove exception
JonathanOppenheimer 9ae0b3d
Merge branch 'master' into JonathanOppenheimer/sync-pr-1279-forbidgo
JonathanOppenheimer 8ce8366
Cey feedback
JonathanOppenheimer 6166387
Update params/extras/precompile_upgrade_test.go
JonathanOppenheimer 1f5bcec
Cey feedback
JonathanOppenheimer 0aef80d
Merge remote-tracking branch 'origin' into JonathanOppenheimer/sync-p…
JonathanOppenheimer 7bf4819
Revert to nil
JonathanOppenheimer 527f3b6
Merge branch 'master' into JonathanOppenheimer/sync-pr-1279-forbidgo
JonathanOppenheimer 5883f1d
chore: lint
JonathanOppenheimer 53490cf
revert version_test suggestion
ceyonur e080ed1
fix linter
ceyonur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -628,9 +628,7 @@ func TestPrecompileBind(t *testing.T) { | |
| ws := t.TempDir() | ||
|
|
||
| pkg := filepath.Join(ws, "precompilebindtest") | ||
| if err := os.MkdirAll(pkg, 0o700); err != nil { | ||
| t.Fatalf("failed to create package: %v", err) | ||
| } | ||
| require.NoError(t, os.MkdirAll(pkg, 0o700), "failed to create package") | ||
| // Generate the test suite for all the contracts | ||
| for i, tt := range bindTests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
|
|
@@ -642,14 +640,10 @@ func TestPrecompileBind(t *testing.T) { | |
| require.ErrorContains(t, err, tt.errMsg) | ||
| return | ||
| } | ||
| if err != nil { | ||
| t.Fatalf("test %d: failed to generate binding: %v", i, err) | ||
| } | ||
| require.NoError(t, err, "test %d: failed to generate binding: %v", i, err) | ||
|
|
||
| precompilePath := filepath.Join(pkg, tt.name) | ||
| if err := os.MkdirAll(precompilePath, 0o700); err != nil { | ||
| t.Fatalf("failed to create package: %v", err) | ||
| } | ||
| require.NoError(t, os.MkdirAll(precompilePath, 0o700), "failed to create package") | ||
| for _, file := range bindedFiles { | ||
| switch file.FileName { | ||
| case ContractFileName: | ||
|
|
@@ -663,13 +657,9 @@ func TestPrecompileBind(t *testing.T) { | |
| // change address to a suitable one for testing | ||
| file.Content = strings.Replace(file.Content, `common.HexToAddress("{ASUITABLEHEXADDRESS}")`, `common.HexToAddress("0x03000000000000000000000000000000000000ff")`, 1) | ||
| } | ||
| if err = os.WriteFile(filepath.Join(precompilePath, file.FileName), []byte(file.Content), 0o600); err != nil { | ||
| t.Fatalf("test %d: failed to write binding: %v", i, err) | ||
| } | ||
| } | ||
| if err = os.WriteFile(filepath.Join(precompilePath, "contract.abi"), []byte(tt.abi), 0o600); err != nil { | ||
| t.Fatalf("test %d: failed to write binding: %v", i, err) | ||
| require.NoError(t, os.WriteFile(filepath.Join(precompilePath, file.FileName), []byte(file.Content), 0o600), "test %d: failed to write binding", i) | ||
| } | ||
| require.NoError(t, os.WriteFile(filepath.Join(precompilePath, "contract.abi"), []byte(tt.abi), 0o600), "test %d: failed to write binding", i) | ||
|
|
||
| // Generate the test file with the injected test code | ||
| code := fmt.Sprintf(` | ||
|
|
@@ -684,32 +674,29 @@ func TestPrecompileBind(t *testing.T) { | |
| %s | ||
| } | ||
| `, tt.name, tt.imports, tt.name, tt.tester) | ||
| if err := os.WriteFile(filepath.Join(precompilePath, strings.ToLower(tt.name)+"_test.go"), []byte(code), 0o600); err != nil { | ||
| t.Fatalf("test %d: failed to write tests: %v", i, err) | ||
| } | ||
| require.NoError(t, os.WriteFile(filepath.Join(precompilePath, strings.ToLower(tt.name)+"_test.go"), []byte(code), 0o600), "test %d: failed to write tests", i) | ||
| }) | ||
| } | ||
|
|
||
| moder := exec.Command(gocmd, "mod", "init", "precompilebindtest") | ||
| moder.Dir = pkg | ||
| if out, err := moder.CombinedOutput(); err != nil { | ||
| t.Fatalf("failed to convert binding test to modules: %v\n%s", err, out) | ||
| } | ||
| out, err := moder.CombinedOutput() | ||
| require.NoError(t, err, "failed to convert binding test to modules: %v\n%s", err, out) | ||
|
|
||
| pwd, _ := os.Getwd() | ||
| replacer := exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/ava-labs/[email protected]", "-replace", "github.com/ava-labs/subnet-evm="+filepath.Join(pwd, "..", "..", "..", "..")) // Repo root | ||
| replacer.Dir = pkg | ||
| if out, err := replacer.CombinedOutput(); err != nil { | ||
| t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out) | ||
| } | ||
| out, err = replacer.CombinedOutput() | ||
| require.NoError(t, err, "failed to replace binding test dependency to current source tree: %v\n%s", err, out) | ||
|
|
||
| tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.24") | ||
| tidier.Dir = pkg | ||
| if out, err := tidier.CombinedOutput(); err != nil { | ||
| t.Fatalf("failed to tidy Go module file: %v\n%s", err, out) | ||
| } | ||
| out, err = tidier.CombinedOutput() | ||
| require.NoError(t, err, "failed to tidy Go module file: %v\n%s", err, out) | ||
|
|
||
| // Test the entire package and report any failures | ||
| cmd := exec.Command(gocmd, "test", "./...", "-v", "-count", "1") | ||
| cmd.Dir = pkg | ||
| if out, err := cmd.CombinedOutput(); err != nil { | ||
| t.Fatalf("failed to run binding test: %v\n%s", err, out) | ||
| } | ||
| out, err = cmd.CombinedOutput() | ||
| require.NoError(t, err, "failed to run binding test: %v\n%s", err, out) | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.