Skip to content

Commit

Permalink
panic when init fail
Browse files Browse the repository at this point in the history
  • Loading branch information
leonz789 committed Nov 18, 2024
1 parent 31c4444 commit 905eb74
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions testutil/network/tx_precompile.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,15 @@ func init() {
_, currentFile, _, ok := runtime.Caller(0)
if !ok {
fmt.Println("Failed to get current file path")
return
panic("Failed to get current file path")
}
basePath := filepath.Dir(currentFile)
var err error
for precompileName, precompilePath := range precompilePaths {
p := filepath.Join(basePath, precompilePath)
abis[precompileName], err = parseABI(p)
if err != nil {
fmt.Printf("Failed to parse abi from path:%s\r\n", p)
return
panic(fmt.Sprintf("Failed to parse abi from path:%s\r\n", p))
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning test

Iteration over map may be a possible source of non-determinism
}
Expand Down

0 comments on commit 905eb74

Please sign in to comment.