This removes the DSA method from the Address interface in favor of only
defining it on the specific concrete address implementations to which it
applies. It also modifies the remaining instances to remove the network
parameters since they are already available on the type.
Finnaly, it updates the example code accordingly.
This modifies DecodeAddress to accept the required network parameters
for the provided encoded address and return an error when the provided
address is for the wrong network.
This means that DecodeAddress will now return ErrUnknownAddressType if
the address being decoded is not for the provided network. This differs
from the previous behavior relied on globally-registered networks in
chaincfg to determine which network the encoded address was for followed
by requiring the caller to check if the address was for the specific
network it desired upon return.
It also updates the tests and example accordingly.
This adds a tested example for address decoding and removes the previous
non-functioning version of it from the pacakge documentation. The
previous example appers to have been missed when porting the code and
was no longer correct for Decred.
This merge commit adds the following code from the
github.com/decred/dcrutil package into a new
github.com/decred/dcrd/dcrutil package:
* Address handling
* Amount type
* AppDataDir func
* bitflags functions
* Block wrapper type
* Hash160 func
* Tx wrapper type
* WIF type
as well as all tests for this code.
The old github.com/decred/dcrutil/hdkeychain package has also been
merged and moved to github.com/decred/dcrd/dcrutil/hdkeychain.
dcrd packages have been updated to use the new packages and the dep
files have been updated for this change.