]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - tests.js
Fix typo: s/litecoin/ripple
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / tests.js
index e6bd9c5ffa9c90d92a3362a05fe87823bf90478d..ecd9f9a85648acc46100d63bd6d275eb620872ed 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -351,7 +351,7 @@ page.open(url, function(status) {
             return $(".address:first").text();
         });
         if (actual != expected) {
-            console.log("Litecoin address is incorrect");
+            console.log("Ripple address is incorrect");
             console.log("Expected: " + expected);
             console.log("Actual: " + actual);
             fail();
@@ -725,7 +725,7 @@ page.open(url, function(status) {
         // this private key can be imported into
         // https://www.myetherwallet.com/#view-wallet-info
         // and it should correlate to the address above
-        var expected = "8f253078b73d7498302bb78c171b23ce7a8fb511987d2b2702b731638a4a15e7";
+        var expected = "0x8f253078b73d7498302bb78c171b23ce7a8fb511987d2b2702b731638a4a15e7";
         var actual = page.evaluate(function() {
             return $(".privkey:first").text();
         });
@@ -753,6 +753,66 @@ page.open(url, function(status) {
 });
 },
 
+// Network can be set to Slimcoin
+function() {
+page.open(url, function(status) {
+    // set the phrase and coin
+    var expected = "SNzPi1CafHFm3WWjRo43aMgiaEEj3ogjww";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+        $(".network option[selected]").removeAttr("selected");
+        $(".network option").filter(function() {
+            return $(this).html() == "Slimcoin";
+        }).prop("selected", true);
+        $(".network").trigger("change");
+    });
+    // check the address is generated correctly
+    waitForGenerate(function() {
+        var actual = page.evaluate(function() {
+            return $(".address:first").text();
+        });
+        if (actual != expected) {
+            console.log("Slimcoin address is incorrect");
+            console.log("Expected: " + expected);
+            console.log("Actual: " + actual);
+            fail();
+        }
+        next();
+    });
+});
+},
+
+// Network can be set to Slimcointn
+function() {
+page.open(url, function(status) {
+    // set the phrase and coin
+    var expected = "n3nMgWufTek5QQAr6uwMhg5xbzj8xqc4Dq";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+        $(".network option[selected]").removeAttr("selected");
+        $(".network option").filter(function() {
+            return $(this).html() == "Slimcoin Testnet";
+        }).prop("selected", true);
+        $(".network").trigger("change");
+    });
+    // check the address is generated correctly
+    waitForGenerate(function() {
+        var actual = page.evaluate(function() {
+            return $(".address:first").text();
+        });
+        if (actual != expected) {
+            console.log("Slimcoin testnet address is incorrect");
+            console.log("Expected: " + expected);
+            console.log("Actual: " + actual);
+            fail();
+        }
+        next();
+    });
+});
+},
+
 // BIP39 seed is set from phrase
 function() {
 page.open(url, function(status) {