diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2017-02-24 09:56:18 +1100 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2017-02-24 09:56:18 +1100 |
commit | e6f08c6a6dbad7eaf07f5ccda777ba71fb298038 (patch) | |
tree | cb6386eef51aa478dfd107be00915aff7afbf444 | |
parent | 52d589ea8d14517813c2c41ba7f5c5b9f144821d (diff) | |
download | BIP39-e6f08c6a6dbad7eaf07f5ccda777ba71fb298038.tar.gz BIP39-e6f08c6a6dbad7eaf07f5ccda777ba71fb298038.tar.zst BIP39-e6f08c6a6dbad7eaf07f5ccda777ba71fb298038.zip |
Issue 58 test - bitcore bip32 derivation bug
Closes #58
-rw-r--r-- | tests.js | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -3550,6 +3550,38 @@ page.open(url, function(status) { | |||
3550 | }); | 3550 | }); |
3551 | }, | 3551 | }, |
3552 | 3552 | ||
3553 | // github issue 58 | ||
3554 | // https://github.com/iancoleman/bip39/issues/58 | ||
3555 | // bip32 derivation is correct, does not drop leading zeros | ||
3556 | // see also | ||
3557 | // https://medium.com/@alexberegszaszi/why-do-my-bip32-wallets-disagree-6f3254cc5846 | ||
3558 | function() { | ||
3559 | page.open(url, function(status) { | ||
3560 | // set the phrase and passphrase | ||
3561 | var expected = "17rxURoF96VhmkcEGCj5LNQkmN9HVhWb7F"; | ||
3562 | // Note that bitcore generates an incorrect address | ||
3563 | // 13EuKhffWkBE2KUwcbkbELZb1MpzbimJ3Y | ||
3564 | // see the medium.com link above for more details | ||
3565 | page.evaluate(function() { | ||
3566 | $(".phrase").val("fruit wave dwarf banana earth journey tattoo true farm silk olive fence"); | ||
3567 | $(".passphrase").val("banana").trigger("input"); | ||
3568 | }); | ||
3569 | // check the address is generated correctly | ||
3570 | waitForGenerate(function() { | ||
3571 | var actual = page.evaluate(function() { | ||
3572 | return $(".address:first").text(); | ||
3573 | }); | ||
3574 | if (actual != expected) { | ||
3575 | console.log("BIP32 derivation is incorrect"); | ||
3576 | console.log("Expected: " + expected); | ||
3577 | console.log("Actual: " + actual); | ||
3578 | fail(); | ||
3579 | } | ||
3580 | next(); | ||
3581 | }); | ||
3582 | }); | ||
3583 | }, | ||
3584 | |||
3553 | // If you wish to add more tests, do so here... | 3585 | // If you wish to add more tests, do so here... |
3554 | 3586 | ||
3555 | // Here is a blank test template | 3587 | // Here is a blank test template |