]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
add dash testnet
authorKarol Rychlicki <karol@dash.org>
Fri, 16 Jun 2017 17:30:15 +0000 (19:30 +0200)
committerKarol Rychlicki <karol@dash.org>
Fri, 16 Jun 2017 17:30:15 +0000 (19:30 +0200)
bip39-standalone.html
src/js/bitcoinjs-extensions.js
src/js/index.js
tests.js

index bcf020c798b22d23dc669659ee48a6405a35fe7f..dd397ac0a0ccfd452d57a6a9cfd0cff02f88d6c7 100644 (file)
@@ -19912,6 +19912,16 @@ bitcoin.networks.dash = {
   wif: 0xcc,
 };
 
+bitcoin.networks.dashtn = {
+  bip32: {
+    public: 0x043587cf,
+    private: 0x04358394
+  },
+  pubKeyHash: 0x8c,
+  scriptHash: 0x13,
+  wif: 0xef,
+};
+
 bitcoin.networks.game = {
   bip32: {
     public: 0x0488b21e,
@@ -44837,6 +44847,13 @@ window.Entropy = new (function() {
                 DOM.bip44coin.val(5);
             },
         },
+        {
+            name: "DASH Testnet",
+            onSelect: function() {
+                network = bitcoin.networks.dashtn;
+                DOM.bip44coin.val(1);
+            },
+        },
         {
             name: "Ethereum",
             onSelect: function() {
index dd5069cf1671e08f31f8c8e1b5f43980cdaaae37..7747d25bfcba6734543b841734fccfe3e8317c20 100644 (file)
@@ -45,6 +45,16 @@ bitcoin.networks.dash = {
   wif: 0xcc,
 };
 
+bitcoin.networks.dashtn = {
+  bip32: {
+    public: 0x043587cf,
+    private: 0x04358394
+  },
+  pubKeyHash: 0x8c,
+  scriptHash: 0x13,
+  wif: 0xef,
+};
+
 bitcoin.networks.game = {
   bip32: {
     public: 0x0488b21e,
index bb2093831200c7b021250c7b8c8114cd0f31d428..3b86e42fb3e8c2c11a8f3bee5fe8d32efb10ab79 100644 (file)
                 DOM.bip44coin.val(5);
             },
         },
+        {
+            name: "DASH Testnet",
+            onSelect: function() {
+                network = bitcoin.networks.dashtn;
+                DOM.bip44coin.val(1);
+            },
+        },
         {
             name: "Ethereum",
             onSelect: function() {
index ecd9f9a85648acc46100d63bd6d275eb620872ed..f346729f00e0a0e0bb8012aa6bd46b1556db40c2 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -601,6 +601,35 @@ page.open(url, function(status) {
 });
 },
 
+function() {
+page.open(url, function(status) {
+    // set the phrase and coin
+    var expected = "yaR52EN4oojdJfBgzWJTymC4uuCLPT29Gw";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+        $(".network option[selected]").removeAttr("selected");
+        $(".network option").filter(function() {
+            return $(this).html() == "DASH 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("DASH Testnet address is incorrect");
+            console.log("Expected: " + expected);
+            console.log("Actual: " + actual);
+            fail();
+        }
+        next();
+    });
+});
+},
+
 // Network can be set to game
 function() {
 page.open(url, function(status) {