From 7ff86d4c983f1e8c80b87b31acfd69fcf98c1b82 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Thu, 15 Sep 2016 13:10:50 +1000 Subject: [PATCH] Test derivation path changes for BIP32 root key --- tests.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests.js b/tests.js index 7c67b02..e5a40ae 100644 --- a/tests.js +++ b/tests.js @@ -1372,7 +1372,36 @@ page.open(url, function(status) { next(); }); }, + // Custom BIP32 root key is used when changing the derivation path +function() { +page.open(url, function(status) { + var expected = "1Nq2Wmu726XHCuGhctEtGmhxo3wzk5wZ1H"; + // set the root key + page.evaluate(function() { + $(".root-key").val("xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi").trigger("input"); + }); + waitForGenerate(function() { + // change the derivation path + page.evaluate(function() { + $("#account").val("1").trigger("input"); + }); + // check the bip32 root key is used for derivation, not the blank phrase + waitForGenerate(function() { + var actual = page.evaluate(function() { + return $(".address:first").text(); + }); + if (actual != expected) { + console.log("Changing the derivation path does not use BIP32 root key"); + console.log("Expected: " + expected); + console.log("Actual: " + actual); + fail(); + } + next(); + }); + }); +}); +}, // Incorrect mnemonic shows error // Incorrect word shows suggested replacement -- 2.41.0