From 61ed16a9cefec8a9a9b7d7c41141e6ef10c3e3e1 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Wed, 14 Sep 2016 16:46:20 +1000 Subject: [PATCH] Test BIP32 root key being set by user --- tests.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests.js b/tests.js index 2800e6c..cef6e13 100644 --- a/tests.js +++ b/tests.js @@ -1291,6 +1291,28 @@ page.open(url, function(status) { }, // BIP32 root key can be set by the user +function() { +page.open(url, function(status) { + var expected = "1Di3Vp7tBWtyQaDABLAjfWtF6V7hYKJtug"; + // set the root key + page.evaluate(function() { + $(".root-key").val("xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi").trigger("input"); + }); + waitForGenerate(function() { + var actual = page.evaluate(function() { + return $(".address:first").text(); + }); + if (actual != expected) { + console.log("Passphrase results in wrong address"); + console.log("Expected: " + expected); + console.log("Actual: " + actual); + fail(); + } + next(); + }); +}); +}, + // Setting BIP32 root key clears the existing phrase, passphrase and seed // Clearing of phrase, passphrase and seed can be cancelled by user // Custom BIP32 root key is used when changing the derivation path