diff --git a/common/types.go b/common/types.go index aadca87f82..d308b8e8f7 100644 --- a/common/types.go +++ b/common/types.go @@ -245,6 +245,12 @@ func (a Address) Cmp(other Address) int { // Bytes gets the string representation of the underlying address. func (a Address) Bytes() []byte { return a[:] } +func (a Address) Bytes32() []byte { + ret := make([]byte, 32) + copy(ret, a.Bytes()) + return ret +} + // Big converts an address to a big integer. func (a Address) Big() *big.Int { return new(big.Int).SetBytes(a[:]) }