Rename DecodeAddr to DecodeAddress.
Now that the deprecated DecodeAddress has been removed, rename DecodeAddr to DecodeAddress and remove the comment which warned this change was coming.
This commit is contained in:
parent
1c82527b3d
commit
53483d0843
2 changed files with 3 additions and 8 deletions
|
@ -116,14 +116,9 @@ type Address interface {
|
||||||
IsForNet(btcwire.BitcoinNet) bool
|
IsForNet(btcwire.BitcoinNet) bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// DecodeAddr decodes the string encoding of an address and returns
|
// DecodeAddress decodes the string encoding of an address and returns
|
||||||
// the Address if addr is a valid encoding for a known address type.
|
// the Address if addr is a valid encoding for a known address type.
|
||||||
//
|
func DecodeAddress(addr string) (Address, error) {
|
||||||
// This is named DecodeAddr and not DecodeAddress due to DecodeAddress
|
|
||||||
// already being defined for an old api. When the old api is eventually
|
|
||||||
// removed, a proper DecodeAddress function will be added, and DecodeAddr
|
|
||||||
// will become deprecated.
|
|
||||||
func DecodeAddr(addr string) (Address, error) {
|
|
||||||
decoded := Base58Decode(addr)
|
decoded := Base58Decode(addr)
|
||||||
|
|
||||||
// Switch on decoded length to determine the type.
|
// Switch on decoded length to determine the type.
|
||||||
|
|
|
@ -489,7 +489,7 @@ func TestAddresses(t *testing.T) {
|
||||||
var err error
|
var err error
|
||||||
if test.canDecode {
|
if test.canDecode {
|
||||||
// Decode addr and compare error against valid.
|
// Decode addr and compare error against valid.
|
||||||
decoded, err = btcutil.DecodeAddr(test.addr)
|
decoded, err = btcutil.DecodeAddress(test.addr)
|
||||||
if (err == nil) != test.valid {
|
if (err == nil) != test.valid {
|
||||||
t.Errorf("%v: decoding test failed", test.name)
|
t.Errorf("%v: decoding test failed", test.name)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue