Skip to content

Commit

Permalink
Plural
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
  • Loading branch information
peterbroadhurst committed Jul 28, 2024
1 parent 5a9cec1 commit a6319b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pkg/ethtypes/hexbytes.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type HexBytesPlain []byte
// HexBytes0xPrefix are serialized to JSON as hex with an `0x` prefix
type HexBytes0xPrefix []byte

func (h HexBytesPlain) Equal(h2 HexBytesPlain) bool {
func (h HexBytesPlain) Equals(h2 HexBytesPlain) bool {
return bytes.Equal(h, h2)
}

Expand Down Expand Up @@ -59,7 +59,7 @@ func (h *HexBytes0xPrefix) UnmarshalJSON(b []byte) error {
return ((*HexBytesPlain)(h)).UnmarshalJSON(b)
}

func (h HexBytes0xPrefix) Equal(h2 HexBytes0xPrefix) bool {
func (h HexBytes0xPrefix) Equals(h2 HexBytes0xPrefix) bool {
return bytes.Equal(h, h2)
}

Expand Down
18 changes: 9 additions & 9 deletions pkg/ethtypes/hexbytes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ func TestHexByteConstructors(t *testing.T) {
}

func TestHexByteEqual(t *testing.T) {
assert.True(t, HexBytesPlain(nil).Equal(nil))
assert.False(t, HexBytesPlain(nil).Equal(HexBytesPlain{0x00}))
assert.False(t, (HexBytesPlain{0x00}).Equal(nil))
assert.True(t, (HexBytesPlain{0x00}).Equal(HexBytesPlain{0x00}))

assert.True(t, HexBytes0xPrefix(nil).Equal(nil))
assert.False(t, HexBytes0xPrefix(nil).Equal(HexBytes0xPrefix{0x00}))
assert.False(t, (HexBytes0xPrefix{0x00}).Equal(nil))
assert.True(t, (HexBytes0xPrefix{0x00}).Equal(HexBytes0xPrefix{0x00}))
assert.True(t, HexBytesPlain(nil).Equals(nil))
assert.False(t, HexBytesPlain(nil).Equals(HexBytesPlain{0x00}))
assert.False(t, (HexBytesPlain{0x00}).Equals(nil))
assert.True(t, (HexBytesPlain{0x00}).Equals(HexBytesPlain{0x00}))

assert.True(t, HexBytes0xPrefix(nil).Equals(nil))
assert.False(t, HexBytes0xPrefix(nil).Equals(HexBytes0xPrefix{0x00}))
assert.False(t, (HexBytes0xPrefix{0x00}).Equals(nil))
assert.True(t, (HexBytes0xPrefix{0x00}).Equals(HexBytes0xPrefix{0x00}))
}

0 comments on commit a6319b0

Please sign in to comment.