diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2016-10-05 12:36:18 +1100 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2016-10-05 12:36:18 +1100 |
commit | 558ef9ac0568b37c2167e94de2ac6c30d8110936 (patch) | |
tree | 0aeba29b6de3f5b44df228c4952ac25417e7d456 | |
parent | af4fd3a203b4148a13b8e3601036dc6105e7e7b8 (diff) | |
download | BIP39-558ef9ac0568b37c2167e94de2ac6c30d8110936.tar.gz BIP39-558ef9ac0568b37c2167e94de2ac6c30d8110936.tar.zst BIP39-558ef9ac0568b37c2167e94de2ac6c30d8110936.zip |
Test derivation from root key with other networks
-rw-r--r-- | tests.js | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -1733,6 +1733,34 @@ page.open(url, function(status) { | |||
1733 | 1733 | ||
1734 | // Github Issue 26: When using a Root key derrived altcoins are incorrect | 1734 | // Github Issue 26: When using a Root key derrived altcoins are incorrect |
1735 | // https://github.com/dcpos/bip39/issues/26 | 1735 | // https://github.com/dcpos/bip39/issues/26 |
1736 | function() { | ||
1737 | page.open(url, function(status) { | ||
1738 | // 1) 2) and 3) set the root key | ||
1739 | page.evaluate(function() { | ||
1740 | $(".root-key").val("xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi").trigger("input"); | ||
1741 | }); | ||
1742 | waitForGenerate(function() { | ||
1743 | // 4) switch from bitcoin to viacoin | ||
1744 | page.evaluate(function() { | ||
1745 | $(".network").val("6").trigger("change"); | ||
1746 | }); | ||
1747 | waitForGenerate(function() { | ||
1748 | // 5) ensure the derived address is correct | ||
1749 | var expected = "Vq9Eq4N5SQnjqZvxtxzo7hZPW5XnyJsmXT"; | ||
1750 | var actual = page.evaluate(function() { | ||
1751 | return $(".address:first").text(); | ||
1752 | }); | ||
1753 | if (actual != expected) { | ||
1754 | console.log("Github Issue 26: address is incorrect when changing networks and using root-key to derive"); | ||
1755 | console.log("Expected: " + expected); | ||
1756 | console.log("Actual: " + actual); | ||
1757 | fail(); | ||
1758 | } | ||
1759 | next(); | ||
1760 | }); | ||
1761 | }); | ||
1762 | }); | ||
1763 | }, | ||
1736 | 1764 | ||
1737 | ]; | 1765 | ]; |
1738 | 1766 | ||