Skip to content

Conversation

@dcousens
Copy link
Contributor

This pull request extracts the test vectors out of test/base58.js and test/base58check.js and puts them inside test/fixtures.
This extraction of the test vectors should allow for easier verification against test integrity with the reference client tests: https://github.com/bitcoin/bitcoin/blob/master/src/test/data/base58_encode_decode.json, https://github.com/bitcoin/bitcoin/blob/master/src/test/data/base58_keys_valid.json and https://github.com/bitcoin/bitcoin/blob/master/src/test/data/base58_keys_invalid.json.

This pull request also fixes a minor bug in the Address tests which were not properly testing against the malformed data.

Lastly, the Address tests now verify against the same malformed base58 as the base58 tests.
This is arguably a demonstration of how lightweight the Address.fromBase58Check wrapper really is, but I couldn't think of a reason why they shouldn't share the same invalid test vectors.

@dcousens dcousens changed the title Base58 test cleanup and extracted vectors Base58 test cleanup and Bitcoin core test vectors Apr 20, 2014
@dcousens dcousens changed the title Base58 test cleanup and Bitcoin core test vectors Base58 test cleanup and extracted vectors Apr 20, 2014
@kyledrake
Copy link
Contributor

+1

kyledrake added a commit that referenced this pull request Apr 21, 2014
Base58 test cleanup and extracted vectors
@kyledrake kyledrake merged commit 1349ab2 into bitcoinjs:master Apr 21, 2014
@dcousens dcousens deleted the b58clean branch April 21, 2014 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants