Test bip32 root key as generated from mnemonic

This commit is contained in:
Ian Coleman
2016-08-23 16:32:42 +10:00
parent c196ad55d9
commit ec60b6624a

View File

@@ -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