]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Test hardened addresses
authorIan Coleman <coleman.ian@gmail.com>
Wed, 24 Aug 2016 09:49:24 +0000 (19:49 +1000)
committerIan Coleman <coleman.ian@gmail.com>
Wed, 24 Aug 2016 09:49:24 +0000 (19:49 +1000)
tests.js

index 83c99d9a0c3729d88692c9e0c548161e35efe18d..c9189a73268d6d890d6c8fba21cae3692ce5c68e 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -906,6 +906,43 @@ page.open(url, function(status) {
 },
 
 // Derivation path for address can be hardened
+function() {
+page.open(url, function(status) {
+    // set the phrase
+    var expected = "18exLzUv7kfpiXRzmCjFDoC9qwNLFyvwyd";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+    });
+    // change tabs
+    waitForGenerate(function() {
+        page.evaluate(function() {
+            $("#bip32-tab a").click();
+        });
+        waitForGenerate(function() {
+            // select the hardened addresses option
+            page.evaluate(function() {
+                $(".hardened-addresses").prop("checked", true);
+                $(".hardened-addresses").trigger("change");
+            });
+            waitForGenerate(function() {
+                // check the generated address is hardened
+                var actual = page.evaluate(function() {
+                    return $(".address:first").text();
+                });
+                if (actual != expected) {
+                    console.log("Hardened address is incorrect");
+                    console.log("Expected: " + expected);
+                    console.log("Actual: " + actual);
+                    fail();
+                }
+                next();
+            });
+        });
+    });
+});
+},
+
 // Derivation path visibility can be toggled
 // Address is shown
 // Addresses are shown in order of derivation path