Make Address a fmt.Stringer.

This commit is contained in:
Josh Rickmar 2014-06-12 20:11:24 -05:00
parent 5bcc7790a0
commit fb4c64910d

View file

@ -55,7 +55,19 @@ func encodeAddress(hash160 []byte, netID byte) string {
// enough that other kinds of addresses may be added in the future without // enough that other kinds of addresses may be added in the future without
// changing the decoding and encoding API. // changing the decoding and encoding API.
type Address interface { type Address interface {
// EncodeAddress returns the string encoding of the address. // String returns the string encoding of the transaction output
// destination.
//
// Please note that String differs subtly from EncodeAddress: String
// will return the value as a string without any conversion, while
// EncodeAddress may convert destination types (for example,
// converting pubkeys to P2PKH addresses) before encoding as a
// payment address string.
String() string
// EncodeAddress returns the string encoding of the payment address
// associated with the Address value. See the comment on String
// for how this method differs from String.
EncodeAddress() string EncodeAddress() string
// ScriptAddress returns the raw bytes of the address to be used // ScriptAddress returns the raw bytes of the address to be used