Skip to content

Commit

Permalink
Merge PR #1404: Add more context for errors when no address is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon authored and cwgoes committed Jun 27, 2018
1 parent 6018e71 commit 3dc2387
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions types/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3dc2387

Please sign in to comment.