]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - tests.js
Links and author changed to iancoleman
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / tests.js
index 1db6820796dbfcbb8e70ccc4edf7376c61e20fcd..4fd2ca5772a10977d48d0c5189e50fe36b4a9a09 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -1566,7 +1566,7 @@ page.open(url, function(status) {
 },
 
 // Github Issue 11: Default word length is 15
-// https://github.com/dcpos/bip39/issues/11
+// https://github.com/iancoleman/bip39/issues/11
 function() {
 page.open(url, function(status) {
     // get the word length
@@ -1583,7 +1583,7 @@ page.open(url, function(status) {
 
 
 // Github Issue 12: Generate more rows with private keys hidden
-// https://github.com/dcpos/bip39/issues/12
+// https://github.com/iancoleman/bip39/issues/12
 function() {
 page.open(url, function(status) {
     // set the phrase
@@ -1626,7 +1626,7 @@ page.open(url, function(status) {
 },
 
 // Github Issue 19: Mnemonic is not sensitive to whitespace
-// https://github.com/dcpos/bip39/issues/19
+// https://github.com/iancoleman/bip39/issues/19
 function() {
 page.open(url, function(status) {
     // set the phrase
@@ -1653,7 +1653,7 @@ page.open(url, function(status) {
 },
 
 // Github Issue 23: Part 1: Use correct derivation path when changing tabs
-// https://github.com/dcpos/bip39/issues/23
+// https://github.com/iancoleman/bip39/issues/23
 function() {
 page.open(url, function(status) {
     // 1) and 2) set the phrase
@@ -1701,7 +1701,7 @@ page.open(url, function(status) {
 },
 
 // Github Issue 23 Part 2: Coin selection in derivation path
-// https://github.com/dcpos/bip39/issues/23#issuecomment-238011920
+// https://github.com/iancoleman/bip39/issues/23#issuecomment-238011920
 function() {
 page.open(url, function(status) {
     // set the phrase
@@ -1732,7 +1732,66 @@ page.open(url, function(status) {
 },
 
 // Github Issue 26: When using a Root key derrived altcoins are incorrect
-// https://github.com/dcpos/bip39/issues/26
+// https://github.com/iancoleman/bip39/issues/26
+function() {
+page.open(url, function(status) {
+    // 1) 2) and 3) set the root key
+    page.evaluate(function() {
+        $(".root-key").val("xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi").trigger("input");
+    });
+    waitForGenerate(function() {
+        // 4) switch from bitcoin to viacoin
+        page.evaluate(function() {
+            $(".network").val("6").trigger("change");
+        });
+        waitForGenerate(function() {
+            // 5) ensure the derived address is correct
+            var expected = "Vq9Eq4N5SQnjqZvxtxzo7hZPW5XnyJsmXT";
+            var actual = page.evaluate(function() {
+                return $(".address:first").text();
+            });
+            if (actual != expected) {
+                console.log("Github Issue 26: address is incorrect when changing networks and using root-key to derive");
+                console.log("Expected: " + expected);
+                console.log("Actual: " + actual);
+                fail();
+            }
+            next();
+        });
+    });
+});
+},
+
+// If you wish to add more tests, do so here...
+
+// Here is a blank test template
+/*
+
+function() {
+page.open(url, function(status) {
+    // Do something on the page
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability").trigger("input");
+    });
+    waitForGenerate(function() {
+        // Check the result of doing the thing
+        var expected = "1Di3Vp7tBWtyQaDABLAjfWtF6V7hYKJtug";
+        var actual = page.evaluate(function() {
+            return $(".address:first").text();
+        });
+        if (actual != expected) {
+            console.log("A specific message about what failed");
+            console.log("Expected: " + expected);
+            console.log("Actual: " + actual);
+            fail();
+        }
+        // Run the next test
+        next();
+    });
+});
+},
+
+*/
 
 ];