aboutsummaryrefslogtreecommitdiff
path: root/tests.js
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2017-08-24 09:25:26 +1000
committerIan Coleman <coleman.ian@gmail.com>2017-08-24 09:37:21 +1000
commitb18eb97ae367e7eaa276a8ddbaaca3e158cf153d (patch)
tree0e83bbc1238bf04be067991ce2b922b658fc6548 /tests.js
parent88ea3e40eeed3b297899041dc590ca80c6a8b90a (diff)
downloadBIP39-b18eb97ae367e7eaa276a8ddbaaca3e158cf153d.tar.gz
BIP39-b18eb97ae367e7eaa276a8ddbaaca3e158cf153d.tar.zst
BIP39-b18eb97ae367e7eaa276a8ddbaaca3e158cf153d.zip
Show error when using xpub with hardened addresses
Diffstat (limited to 'tests.js')
-rw-r--r--tests.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests.js b/tests.js
index 1cf5b22..316a817 100644
--- a/tests.js
+++ b/tests.js
@@ -4185,6 +4185,37 @@ page.open(url, function(status) {
4185}); 4185});
4186}, 4186},
4187 4187
4188// Github issue 95
4189// error trying to generate addresses from xpub with hardened derivation
4190function() {
4191page.open(url, function(status) {
4192 // set the phrase
4193 page.evaluate(function() {
4194 // Use bip32 tab with hardened addresses
4195 $(".hardened-addresses").prop("checked", true);
4196 $("#bip32-tab a").click();
4197 // set xpub for account 0 of bip44 for 'abandon abandon ability'
4198 var bip44AccountXpub = "xpub6CzDCPbtLrrn4VpVbyyQLHbdSMpZoHN4iuW64VswCyEpfjM2mJGdaHJ2DyuZwtst96E16VvcERb8BBeJdHSCVmAq9RhtRQg6eAZFrTKCNqf";
4199 $("#root-key").val(bip44AccountXpub);
4200 $("#root-key").trigger("input");
4201 });
4202 waitForFeedback(function() {
4203 // check the error message shows
4204 var expected = "Hardened derivation path is invalid with xpub key";
4205 var actual = page.evaluate(function() {
4206 return $(".feedback").text();
4207 });
4208 if (actual != expected) {
4209 console.log("xpub key with hardened addresses does not show feedback");
4210 console.log("Expected: " + expected);
4211 console.log("Actual: " + actual);
4212 fail();
4213 }
4214 next();
4215 });
4216});
4217},
4218
4188// If you wish to add more tests, do so here... 4219// If you wish to add more tests, do so here...
4189 4220
4190// Here is a blank test template 4221// Here is a blank test template