From: Karol Rychlicki Date: Fri, 16 Jun 2017 17:30:15 +0000 (+0200) Subject: add dash testnet X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git;a=commitdiff_plain;h=c0386f3b78c31bc23c935603abe9ed9fafe300d4 add dash testnet --- diff --git a/bip39-standalone.html b/bip39-standalone.html index bcf020c..dd397ac 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html @@ -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() { diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js index dd5069c..7747d25 100644 --- a/src/js/bitcoinjs-extensions.js +++ b/src/js/bitcoinjs-extensions.js @@ -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, diff --git a/src/js/index.js b/src/js/index.js index bb20938..3b86e42 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -1113,6 +1113,13 @@ DOM.bip44coin.val(5); }, }, + { + name: "DASH Testnet", + onSelect: function() { + network = bitcoin.networks.dashtn; + DOM.bip44coin.val(1); + }, + }, { name: "Ethereum", onSelect: function() { diff --git a/tests.js b/tests.js index ecd9f9a..f346729 100644 --- 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) {