diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/types.go | 3 | ||||
-rw-r--r-- | common/types_test.go | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/common/types.go b/common/types.go index 48043788f..98c83edd4 100644 --- a/common/types.go +++ b/common/types.go @@ -202,9 +202,6 @@ func IsHexAddress(s string) bool { // Bytes gets the string representation of the underlying address. func (a Address) Bytes() []byte { return a[:] } -// Big converts an address to a big integer. -func (a Address) Big() *big.Int { return new(big.Int).SetBytes(a[:]) } - // Hash converts an address to a hash by left-padding it with zeros. func (a Address) Hash() Hash { return BytesToHash(a[:]) } diff --git a/common/types_test.go b/common/types_test.go index 7095ccd01..fffd673c6 100644 --- a/common/types_test.go +++ b/common/types_test.go @@ -114,8 +114,8 @@ func TestAddressUnmarshalJSON(t *testing.T) { if test.ShouldErr { t.Errorf("test #%d: expected error, got none", i) } - if v.Big().Cmp(test.Output) != 0 { - t.Errorf("test #%d: address mismatch: have %v, want %v", i, v.Big(), test.Output) + if got := new(big.Int).SetBytes(v.Bytes()); got.Cmp(test.Output) != 0 { + t.Errorf("test #%d: address mismatch: have %v, want %v", i, got, test.Output) } } } |