From 2661a10a8b0feb782e58d79fdb98aa12aa4fdb11 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Tue, 23 Apr 2024 11:17:48 +0200 Subject: [PATCH] Cast bytes to fixed size array instead of copying --- accounts/abi/abi_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/accounts/abi/abi_test.go b/accounts/abi/abi_test.go index 84175df4bb..4c144a90b2 100644 --- a/accounts/abi/abi_test.go +++ b/accounts/abi/abi_test.go @@ -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)