From ec60b6624a5f84943ffb6e6be8b3af9c2274097b Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Tue, 23 Aug 2016 16:32:42 +1000 Subject: [PATCH] Test bip32 root key as generated from mnemonic --- tests.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests.js b/tests.js index e534532..f5ce6d3 100644 --- a/tests.js +++ b/tests.js @@ -440,6 +440,31 @@ page.open(url, function(status) { }, // BIP32 root key is set from phrase +function() { +page.open(url, function(status) { + // set the phrase + var expected = "xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi"; + page.evaluate(function() { + $(".phrase").val("abandon abandon ability"); + $(".phrase").trigger("input"); + }); + // check the address is generated correctly + setTimeout(function() { + var actual = page.evaluate(function() { + return $(".root-key").val(); + }); + if (actual != expected) { + console.log("Root key is incorrectly generated from mnemonic"); + console.log("Expected: " + expected); + console.log("Actual: " + actual); + fail(); + } + next(); + }, 1000); +}); +}, + +// TODO finish these tests // Tabs show correct addresses when changed -- 2.41.0