Skip to content

Commit

Permalink
Revert "common: remove address.Hash footgun (ethereum#28228)"
Browse files Browse the repository at this point in the history
This reverts commit 4502642.
  • Loading branch information
devopsbo3 authored Nov 10, 2023
1 parent 432e35a commit b837223
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ func (a Address) Cmp(other Address) int {
// Bytes gets the string representation of the underlying address.
func (a Address) Bytes() []byte { return a[:] }

// Hash converts an address to a hash by left-padding it with zeros.
func (a Address) Hash() Hash { return BytesToHash(a[:]) }

// Big converts an address to a big integer.
func (a Address) Big() *big.Int { return new(big.Int).SetBytes(a[:]) }

Expand Down

0 comments on commit b837223

Please sign in to comment.