diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2016-08-23 19:59:57 +1000 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2016-08-23 19:59:57 +1000 |
commit | 06286adb0f27d33ed72189c326aeff7142cb73db (patch) | |
tree | 45e6fd50b8cd88af5d444d33ca5ddb178d5bc07d | |
parent | 39fd45bb13bd3174546af033a3c3dc87c3b2b2f0 (diff) | |
download | BIP39-06286adb0f27d33ed72189c326aeff7142cb73db.tar.gz BIP39-06286adb0f27d33ed72189c326aeff7142cb73db.tar.zst BIP39-06286adb0f27d33ed72189c326aeff7142cb73db.zip |
Test BIP44 purpose field
-rw-r--r-- | tests.js | 37 |
1 files changed, 34 insertions, 3 deletions
@@ -573,7 +573,7 @@ page.open(url, function(status) { | |||
573 | $(".phrase").val("abandon abandon ability"); | 573 | $(".phrase").val("abandon abandon ability"); |
574 | $(".phrase").trigger("input"); | 574 | $(".phrase").trigger("input"); |
575 | }); | 575 | }); |
576 | // check the derivation path of the first address | 576 | // check the BIP44 extended private key |
577 | waitForGenerate(function() { | 577 | waitForGenerate(function() { |
578 | var actual = page.evaluate(function() { | 578 | var actual = page.evaluate(function() { |
579 | return $(".extended-priv-key").val(); | 579 | return $(".extended-priv-key").val(); |
@@ -598,7 +598,7 @@ page.open(url, function(status) { | |||
598 | $(".phrase").val("abandon abandon ability"); | 598 | $(".phrase").val("abandon abandon ability"); |
599 | $(".phrase").trigger("input"); | 599 | $(".phrase").trigger("input"); |
600 | }); | 600 | }); |
601 | // check the derivation path of the first address | 601 | // check the BIP44 extended public key |
602 | waitForGenerate(function() { | 602 | waitForGenerate(function() { |
603 | var actual = page.evaluate(function() { | 603 | var actual = page.evaluate(function() { |
604 | return $(".extended-pub-key").val(); | 604 | return $(".extended-pub-key").val(); |
@@ -614,9 +614,40 @@ page.open(url, function(status) { | |||
614 | }); | 614 | }); |
615 | }, | 615 | }, |
616 | 616 | ||
617 | // BIP44 purpose field changes address list | ||
618 | function() { | ||
619 | page.open(url, function(status) { | ||
620 | // set the phrase | ||
621 | var expected = "1JbDzRJ2cDT8aat2xwKd6Pb2zzavow5MhF"; | ||
622 | page.evaluate(function() { | ||
623 | $(".phrase").val("abandon abandon ability"); | ||
624 | $(".phrase").trigger("input"); | ||
625 | }); | ||
626 | waitForGenerate(function() { | ||
627 | // change the bip44 purpose field to 45 | ||
628 | page.evaluate(function() { | ||
629 | $("#bip44 .purpose").val("45"); | ||
630 | $("#bip44 .purpose").trigger("input"); | ||
631 | }); | ||
632 | waitForGenerate(function() { | ||
633 | // check the address for the new derivation path | ||
634 | var actual = page.evaluate(function() { | ||
635 | return $(".address:first").text(); | ||
636 | }); | ||
637 | if (actual != expected) { | ||
638 | console.log("BIP44 purpose field generates incorrect address"); | ||
639 | console.log("Expected: " + expected); | ||
640 | console.log("Actual: " + actual); | ||
641 | fail(); | ||
642 | } | ||
643 | next(); | ||
644 | }); | ||
645 | }); | ||
646 | }); | ||
647 | }, | ||
648 | |||
617 | // TODO finish these tests | 649 | // TODO finish these tests |
618 | 650 | ||
619 | // BIP44 purpose field changes address list | ||
620 | // BIP44 coin field changes address list | 651 | // BIP44 coin field changes address list |
621 | // BIP44 account field changes address list | 652 | // BIP44 account field changes address list |
622 | // BIP44 external/internal field changes address list | 653 | // BIP44 external/internal field changes address list |