add test for address_test

pull/1429/head
Minh Doan 5 years ago
parent 9aab6dc5d0
commit 7f8d1a4374
  1. 13
      internal/common/address_test.go

@ -150,6 +150,19 @@ func TestAddressToBech32(t *testing.T) {
}
}
func TestParseAddr(t *testing.T) {
adr := ethCommon.HexToAddress("0x15a128e599b74842bccba860311efa92991bffb5")
adr2 := ParseAddr("one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur")
if adr.Hex() != adr2.Hex() {
t.Errorf("error on ParseAddr")
}
// Parsing incorrect address
adr3 := ParseAddr("helloworldone1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ufdfsrfasdfadfas")
if adr3.Hex() != "0x0000000000000000000000000000000000000000" {
t.Errorf("error on ParseAddr")
}
}
func TestAddress_Scan(t *testing.T) {
type args struct {
src interface{}

Loading…
Cancel
Save