X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests.js;h=3518aa04f601a6be921e1fee11cc06f167733586;hb=558ef9ac0568b37c2167e94de2ac6c30d8110936;hp=1db6820796dbfcbb8e70ccc4edf7376c61e20fcd;hpb=af4fd3a203b4148a13b8e3601036dc6105e7e7b8;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/tests.js b/tests.js index 1db6820..3518aa0 100644 --- a/tests.js +++ b/tests.js @@ -1733,6 +1733,34 @@ page.open(url, function(status) { // Github Issue 26: When using a Root key derrived altcoins are incorrect // https://github.com/dcpos/bip39/issues/26 +function() { +page.open(url, function(status) { + // 1) 2) and 3) set the root key + page.evaluate(function() { + $(".root-key").val("xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi").trigger("input"); + }); + waitForGenerate(function() { + // 4) switch from bitcoin to viacoin + page.evaluate(function() { + $(".network").val("6").trigger("change"); + }); + waitForGenerate(function() { + // 5) ensure the derived address is correct + var expected = "Vq9Eq4N5SQnjqZvxtxzo7hZPW5XnyJsmXT"; + var actual = page.evaluate(function() { + return $(".address:first").text(); + }); + if (actual != expected) { + console.log("Github Issue 26: address is incorrect when changing networks and using root-key to derive"); + console.log("Expected: " + expected); + console.log("Actual: " + actual); + fail(); + } + next(); + }); + }); +}); +}, ];