Skip to content

Commit

Permalink
(fix) address type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
didaunesp committed Sep 7, 2023
1 parent aa4372d commit 2c93e15
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions common/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@ func TestAddress_Scan(t *testing.T) {
}

if !tt.wantErr {
for i := range a {
if a[i] != tt.args.src.([]byte)[i] {
for i := range a.Bytes() {
if a.Bytes()[i] != tt.args.src.([]byte)[i] {
t.Errorf(
"Address.Scan() didn't scan the %d src correctly (have %X, want %X)",
i, a[i], tt.args.src.([]byte)[i],
i, a.Bytes()[i], tt.args.src.([]byte)[i],
)
}
}
Expand All @@ -343,8 +343,7 @@ func TestAddress_Value(t *testing.T) {
0xb2, 0x6f, 0x2b, 0x34, 0x2a, 0xab, 0x24, 0xbc, 0xf6, 0x3e,
0xa2, 0x18, 0xc6, 0xa9, 0x27, 0x4d, 0x30, 0xab, 0x9a, 0x15,
}
var usedA Address
usedA.SetBytes(b)
usedA := BytesToAddress(b);
tests := []struct {
name string
a Address
Expand Down Expand Up @@ -377,9 +376,8 @@ func TestAddress_Format(t *testing.T) {
0xb2, 0x6f, 0x2b, 0x34, 0x2a, 0xab, 0x24, 0xbc, 0xf6, 0x3e,
0xa2, 0x18, 0xc6, 0xa9, 0x27, 0x4d, 0x30, 0xab, 0x9a, 0x15,
}
var addr Address
addr.SetBytes(b)

addr := BytesToAddress(b)
tests := []struct {
name string
out string
Expand Down

0 comments on commit 2c93e15

Please sign in to comment.