Skip to content

Commit

Permalink
Cast bytes to fixed size array instead of copying
Browse files Browse the repository at this point in the history
  • Loading branch information
anodar committed Apr 23, 2024
1 parent cb4fc77 commit 2661a10
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions accounts/abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1068,8 +1068,7 @@ func TestABI_ErrorByID(t *testing.T) {
}
for name, m := range abi.Errors {
a := fmt.Sprintf("%v", &m)
var id [4]byte
copy(id[:], m.ID[:4])
id := [4]byte(m.ID.Bytes())
m2, err := abi.ErrorByID(id)
if err != nil {
t.Fatalf("Failed to look up ABI error: %v", err)
Expand Down

0 comments on commit 2661a10

Please sign in to comment.