Commit Graph

7 Commits

Author SHA1 Message Date
Dave Collins
ed43e59df5
release: Introduce dcrutil v2 module. 2019-06-19 12:09:19 -05:00
Dave Collins
9b753598df
dcrutil: Update to use chaincfg/v2 module. 2019-06-19 12:09:18 -05:00
Dave Collins
54cd596803
dcrutil: Remove DSA from Address interface.
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.
2019-06-19 12:09:13 -05:00
Dave Collins
0ba5ac74e5
dcrutil: Require network on address decode.
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.
2019-06-19 12:09:12 -05:00
Dave Collins
2142c4037c
dcrutil: Make docs example testable and correct it.
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.
2019-06-19 12:09:10 -05:00
Josh Rickmar
6842aa006d Merge remaining dcrutil code into a dcrd package.
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.
2017-10-11 22:06:36 -04:00
Josh Rickmar
8564843206 Import dcrutil repo under dcrutil directory. 2017-10-11 21:29:08 -04:00