bitcoinjs/bitcoinjs-lib — pull request #203 by dcousens (2014-06-01 06:22:46+00:00)
Title: HDWallet tests and strict constructor

This pull request finally restricts the `HDWallet` constructor to a restrictive form that only accepts two prototypes (unfortunately not 1):

* `HDWallet :: BigInteger -> Buffer -> Network`, private
* `HDWallet :: ECPointFp -> Buffer -> Network`, public

It adds tests for these constructors, all the implied behaviour and overall adds tests for all the methods within `HDWallet`, including `getFingerprint`, `getIdentifier`, `getAddress` and `fromSeed*`.

Some of these features were tested in the `HDWallet` test vectors, but now these tests have been separated to better identify functionality, while still maintaining the same level of test coverage (if not more).

`HDWallet.getKeyVersion` was removed, it was returning the `pubKeyHash` and has no meaningful representation in the specification, so I saw no need to keep it.

I can't decide whether keeping `from/toBuffer` is a worthwhile decision, as I see no use case for it. The purpose of the Base58 export functions is that they have error checking and are human readable.
If it is decided that there is a use case for keeping them, then I'll be happy to put `to/fromHex` into `HDWallet` and put them under test respectively.