Make Address a fmt.Stringer.
This commit is contained in:
parent
5bcc7790a0
commit
fb4c64910d
1 changed files with 13 additions and 1 deletions
14
address.go
14
address.go
|
@ -55,7 +55,19 @@ func encodeAddress(hash160 []byte, netID byte) string {
|
|||
// enough that other kinds of addresses may be added in the future without
|
||||
// changing the decoding and encoding API.
|
||||
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
|
||||
|
||||
// ScriptAddress returns the raw bytes of the address to be used
|
||||
|
|
Loading…
Reference in a new issue