]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Network order is alphabetical.
authorIan Coleman <coleman.ian@gmail.com>
Tue, 21 Feb 2017 01:35:10 +0000 (12:35 +1100)
committerIan Coleman <coleman.ian@gmail.com>
Tue, 21 Feb 2017 01:38:32 +0000 (12:38 +1100)
Closes #56

bip39-standalone.html
src/js/index.js
tests.js

index ee26c14a93595e47ff32f432ce4faf39b5995846..43b588a395b00182d3edb426705842b68784cd63 100644 (file)
@@ -42309,10 +42309,10 @@ window.Entropy = new (function() {
             },
         },
         {
-            name: "Litecoin",
+            name: "CLAM",
             onSelect: function() {
-                network = bitcoin.networks.litecoin;
-                DOM.bip44coin.val(2);
+                network = bitcoin.networks.clam;
+                DOM.bip44coin.val(23);
             },
         },
         {
@@ -42323,73 +42323,73 @@ window.Entropy = new (function() {
             },
         },
         {
-            name: "ShadowCash",
+            name: "DASH",
             onSelect: function() {
-                network = bitcoin.networks.shadow;
-                DOM.bip44coin.val(35);
+                network = bitcoin.networks.dash;
+                DOM.bip44coin.val(5);
             },
         },
         {
-            name: "ShadowCash Testnet",
+            name: "Ethereum",
             onSelect: function() {
-                network = bitcoin.networks.shadowtn;
-                DOM.bip44coin.val(1);
+                network = bitcoin.networks.bitcoin;
+                DOM.bip44coin.val(60);
             },
         },
         {
-            name: "Viacoin",
+            name: "Jumbucks",
             onSelect: function() {
-                network = bitcoin.networks.viacoin;
-                DOM.bip44coin.val(14);
+                network = bitcoin.networks.jumbucks;
+                DOM.bip44coin.val(26);
             },
         },
         {
-            name: "Viacoin Testnet",
+            name: "Litecoin",
             onSelect: function() {
-                network = bitcoin.networks.viacointestnet;
-                DOM.bip44coin.val(1);
+                network = bitcoin.networks.litecoin;
+                DOM.bip44coin.val(2);
             },
         },
         {
-            name: "Jumbucks",
+            name: "Namecoin",
             onSelect: function() {
-                network = bitcoin.networks.jumbucks;
-                DOM.bip44coin.val(26);
+                network = bitcoin.networks.namecoin;
+                DOM.bip44coin.val(7);
             },
         },
         {
-            name: "CLAM",
+            name: "Peercoin",
             onSelect: function() {
-                network = bitcoin.networks.clam;
-                DOM.bip44coin.val(23);
+                network = bitcoin.networks.peercoin;
+                DOM.bip44coin.val(6);
             },
         },
         {
-            name: "DASH",
+            name: "ShadowCash",
             onSelect: function() {
-                network = bitcoin.networks.dash;
-                DOM.bip44coin.val(5);
+                network = bitcoin.networks.shadow;
+                DOM.bip44coin.val(35);
             },
         },
         {
-            name: "Namecoin",
+            name: "ShadowCash Testnet",
             onSelect: function() {
-                network = bitcoin.networks.namecoin;
-                DOM.bip44coin.val(7);
+                network = bitcoin.networks.shadowtn;
+                DOM.bip44coin.val(1);
             },
         },
         {
-            name: "Peercoin",
+            name: "Viacoin",
             onSelect: function() {
-                network = bitcoin.networks.peercoin;
-                DOM.bip44coin.val(6);
+                network = bitcoin.networks.viacoin;
+                DOM.bip44coin.val(14);
             },
         },
         {
-            name: "Ethereum",
+            name: "Viacoin Testnet",
             onSelect: function() {
-                network = bitcoin.networks.bitcoin;
-                DOM.bip44coin.val(60);
+                network = bitcoin.networks.viacointestnet;
+                DOM.bip44coin.val(1);
             },
         },
     ]
index 29cf06beca3009f30fbda9ba79218dacaa5ebc2a..757d0881e248bbc771db5f3e140e54ce93a3a95d 100644 (file)
             },
         },
         {
-            name: "Litecoin",
+            name: "CLAM",
             onSelect: function() {
-                network = bitcoin.networks.litecoin;
-                DOM.bip44coin.val(2);
+                network = bitcoin.networks.clam;
+                DOM.bip44coin.val(23);
             },
         },
         {
             },
         },
         {
-            name: "ShadowCash",
+            name: "DASH",
             onSelect: function() {
-                network = bitcoin.networks.shadow;
-                DOM.bip44coin.val(35);
+                network = bitcoin.networks.dash;
+                DOM.bip44coin.val(5);
             },
         },
         {
-            name: "ShadowCash Testnet",
+            name: "Ethereum",
             onSelect: function() {
-                network = bitcoin.networks.shadowtn;
-                DOM.bip44coin.val(1);
+                network = bitcoin.networks.bitcoin;
+                DOM.bip44coin.val(60);
             },
         },
         {
-            name: "Viacoin",
+            name: "Jumbucks",
             onSelect: function() {
-                network = bitcoin.networks.viacoin;
-                DOM.bip44coin.val(14);
+                network = bitcoin.networks.jumbucks;
+                DOM.bip44coin.val(26);
             },
         },
         {
-            name: "Viacoin Testnet",
+            name: "Litecoin",
             onSelect: function() {
-                network = bitcoin.networks.viacointestnet;
-                DOM.bip44coin.val(1);
+                network = bitcoin.networks.litecoin;
+                DOM.bip44coin.val(2);
             },
         },
         {
-            name: "Jumbucks",
+            name: "Namecoin",
             onSelect: function() {
-                network = bitcoin.networks.jumbucks;
-                DOM.bip44coin.val(26);
+                network = bitcoin.networks.namecoin;
+                DOM.bip44coin.val(7);
             },
         },
         {
-            name: "CLAM",
+            name: "Peercoin",
             onSelect: function() {
-                network = bitcoin.networks.clam;
-                DOM.bip44coin.val(23);
+                network = bitcoin.networks.peercoin;
+                DOM.bip44coin.val(6);
             },
         },
         {
-            name: "DASH",
+            name: "ShadowCash",
             onSelect: function() {
-                network = bitcoin.networks.dash;
-                DOM.bip44coin.val(5);
+                network = bitcoin.networks.shadow;
+                DOM.bip44coin.val(35);
             },
         },
         {
-            name: "Namecoin",
+            name: "ShadowCash Testnet",
             onSelect: function() {
-                network = bitcoin.networks.namecoin;
-                DOM.bip44coin.val(7);
+                network = bitcoin.networks.shadowtn;
+                DOM.bip44coin.val(1);
             },
         },
         {
-            name: "Peercoin",
+            name: "Viacoin",
             onSelect: function() {
-                network = bitcoin.networks.peercoin;
-                DOM.bip44coin.val(6);
+                network = bitcoin.networks.viacoin;
+                DOM.bip44coin.val(14);
             },
         },
         {
-            name: "Ethereum",
+            name: "Viacoin Testnet",
             onSelect: function() {
-                network = bitcoin.networks.bitcoin;
-                DOM.bip44coin.val(60);
+                network = bitcoin.networks.viacointestnet;
+                DOM.bip44coin.val(1);
             },
         },
     ]
index debedab5aa1313c1197b6676a15081916ae10295..e9f0a3171373e6500271505d63343e4492652c22 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -280,7 +280,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=1]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "Bitcoin Testnet";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -308,7 +310,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=2]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "Litecoin";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -336,7 +340,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=3]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "Dogecoin";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -364,7 +370,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=4]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "ShadowCash";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -392,7 +400,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=5]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "ShadowCash Testnet";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -420,7 +430,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=6]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "Viacoin";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -448,7 +460,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=7]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "Viacoin Testnet";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -476,7 +490,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=8]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "Jumbucks";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -504,7 +520,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=9]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "CLAM";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -532,7 +550,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=10]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "DASH";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -560,7 +580,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=11]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "Namecoin";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -588,7 +610,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=12]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "Peercoin";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     // check the address is generated correctly
@@ -617,7 +641,9 @@ page.open(url, function(status) {
         $(".phrase").val("abandon abandon ability");
         $(".phrase").trigger("input");
         $(".network option[selected]").removeAttr("selected");
-        $(".network option[value=13]").prop("selected", true);
+        $(".network option").filter(function() {
+            return $(this).html() == "Ethereum";
+        }).prop("selected", true);
         $(".network").trigger("change");
     });
     waitForGenerate(function() {
@@ -1838,7 +1864,10 @@ page.open(url, function(status) {
         waitForGenerate(function() {
             // 4) switch from bitcoin to litecoin
             page.evaluate(function() {
-                $(".network").val("2").trigger("change");
+                $(".network option").filter(function() {
+                    return $(this).html() == "Litecoin";
+                }).prop("selected", true);
+                $(".network").trigger("change");
             });
             waitForGenerate(function() {
                 // 5) Check derivation path is displayed correctly
@@ -1881,7 +1910,10 @@ page.open(url, function(status) {
     waitForGenerate(function() {
         // switch from bitcoin to clam
         page.evaluate(function() {
-            $(".network").val("9").trigger("change");
+            $(".network option").filter(function() {
+                return $(this).html() == "CLAM";
+            }).prop("selected", true);
+            $(".network").trigger("change");
         });
         waitForGenerate(function() {
             // check derivation path is displayed correctly
@@ -1912,7 +1944,10 @@ page.open(url, function(status) {
     waitForGenerate(function() {
         // 4) switch from bitcoin to viacoin
         page.evaluate(function() {
-            $(".network").val("6").trigger("change");
+            $(".network option").filter(function() {
+                return $(this).html() == "Viacoin";
+            }).prop("selected", true);
+            $(".network").trigger("change");
         });
         waitForGenerate(function() {
             // 5) ensure the derived address is correct