diff --git a/common/types.go b/common/types.go index 8d098a36bc..e0915dbdd4 100644 --- a/common/types.go +++ b/common/types.go @@ -177,6 +177,8 @@ func BytesToAddress(b []byte) Address { return a } +func StringToAddress(s string) Address { return BytesToAddress([]byte(s)) } + // BigToAddress returns Address with byte values of b. // If b is larger than len(h), b will be cropped from the left. func BigToAddress(b *big.Int) Address { return BytesToAddress(b.Bytes()) }