]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Test bip32 root key as generated from mnemonic
authorIan Coleman <coleman.ian@gmail.com>
Tue, 23 Aug 2016 06:32:42 +0000 (16:32 +1000)
committerIan Coleman <coleman.ian@gmail.com>
Tue, 23 Aug 2016 06:32:42 +0000 (16:32 +1000)
tests.js

index e534532c4856236f7cb492fe3b0132f9dc20a71c..f5ce6d3d64c26a7cdfbc16690d30891557848b53 100644 (file)
--- 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