From 3dc23871247b470c7f22df7ac8b42664ff4dc81f Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Wed, 27 Jun 2018 10:39:57 -0700 Subject: [PATCH] Merge PR #1404: Add more context for errors when no address is provided --- types/account.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/account.go b/types/account.go index 00f6cc5247e0..cbaf87beb8f5 100644 --- a/types/account.go +++ b/types/account.go @@ -80,7 +80,7 @@ func MustBech32ifyValPub(pub crypto.PubKey) string { // create an Address from a string func GetAccAddressHex(address string) (addr Address, err error) { if len(address) == 0 { - return addr, errors.New("must use provide address") + return addr, errors.New("decoding bech32 address failed: must provide an address") } bz, err := hex.DecodeString(address) if err != nil { @@ -116,7 +116,7 @@ func GetAccPubKeyBech32(address string) (pk crypto.PubKey, err error) { // create an Address from a hex string func GetValAddressHex(address string) (addr Address, err error) { if len(address) == 0 { - return addr, errors.New("must use provide address") + return addr, errors.New("decoding bech32 address failed: must provide an address") } bz, err := hex.DecodeString(address) if err != nil { @@ -152,7 +152,7 @@ func GetValPubKeyBech32(pubkey string) (pk crypto.PubKey, err error) { // decode a bytestring from a bech32-encoded string func GetFromBech32(bech32str, prefix string) ([]byte, error) { if len(bech32str) == 0 { - return nil, errors.New("must provide non-empty string") + return nil, errors.New("decoding bech32 address failed: must provide an address") } hrp, bz, err := bech32.DecodeAndConvert(bech32str) if err != nil {