aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriancoleman <coleman.ian@gmail.com>2017-06-17 09:05:07 +1000
committerGitHub <noreply@github.com>2017-06-17 09:05:07 +1000
commitee42e5f7126b8cfe5e9035dde0e140e2f5879db8 (patch)
treecc4ddcd57e4e4538e18db66ab42f270fa4b101e3
parent56b1275f405f900872f95fc440c487fd478c3094 (diff)
parentc0386f3b78c31bc23c935603abe9ed9fafe300d4 (diff)
downloadBIP39-ee42e5f7126b8cfe5e9035dde0e140e2f5879db8.tar.gz
BIP39-ee42e5f7126b8cfe5e9035dde0e140e2f5879db8.tar.zst
BIP39-ee42e5f7126b8cfe5e9035dde0e140e2f5879db8.zip
Merge pull request #77 from krychlicki/dash_testnet
add dash testnet
-rw-r--r--bip39-standalone.html17
-rw-r--r--src/js/bitcoinjs-extensions.js10
-rw-r--r--src/js/index.js7
-rw-r--r--tests.js29
4 files changed, 63 insertions, 0 deletions
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 = {
19912 wif: 0xcc, 19912 wif: 0xcc,
19913}; 19913};
19914 19914
19915bitcoin.networks.dashtn = {
19916 bip32: {
19917 public: 0x043587cf,
19918 private: 0x04358394
19919 },
19920 pubKeyHash: 0x8c,
19921 scriptHash: 0x13,
19922 wif: 0xef,
19923};
19924
19915bitcoin.networks.game = { 19925bitcoin.networks.game = {
19916 bip32: { 19926 bip32: {
19917 public: 0x0488b21e, 19927 public: 0x0488b21e,
@@ -44838,6 +44848,13 @@ window.Entropy = new (function() {
44838 }, 44848 },
44839 }, 44849 },
44840 { 44850 {
44851 name: "DASH Testnet",
44852 onSelect: function() {
44853 network = bitcoin.networks.dashtn;
44854 DOM.bip44coin.val(1);
44855 },
44856 },
44857 {
44841 name: "Ethereum", 44858 name: "Ethereum",
44842 onSelect: function() { 44859 onSelect: function() {
44843 network = bitcoin.networks.bitcoin; 44860 network = bitcoin.networks.bitcoin;
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 = {
45 wif: 0xcc, 45 wif: 0xcc,
46}; 46};
47 47
48bitcoin.networks.dashtn = {
49 bip32: {
50 public: 0x043587cf,
51 private: 0x04358394
52 },
53 pubKeyHash: 0x8c,
54 scriptHash: 0x13,
55 wif: 0xef,
56};
57
48bitcoin.networks.game = { 58bitcoin.networks.game = {
49 bip32: { 59 bip32: {
50 public: 0x0488b21e, 60 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
@@ -1114,6 +1114,13 @@
1114 }, 1114 },
1115 }, 1115 },
1116 { 1116 {
1117 name: "DASH Testnet",
1118 onSelect: function() {
1119 network = bitcoin.networks.dashtn;
1120 DOM.bip44coin.val(1);
1121 },
1122 },
1123 {
1117 name: "Ethereum", 1124 name: "Ethereum",
1118 onSelect: function() { 1125 onSelect: function() {
1119 network = bitcoin.networks.bitcoin; 1126 network = bitcoin.networks.bitcoin;
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) {
601}); 601});
602}, 602},
603 603
604function() {
605page.open(url, function(status) {
606 // set the phrase and coin
607 var expected = "yaR52EN4oojdJfBgzWJTymC4uuCLPT29Gw";
608 page.evaluate(function() {
609 $(".phrase").val("abandon abandon ability");
610 $(".phrase").trigger("input");
611 $(".network option[selected]").removeAttr("selected");
612 $(".network option").filter(function() {
613 return $(this).html() == "DASH Testnet";
614 }).prop("selected", true);
615 $(".network").trigger("change");
616 });
617 // check the address is generated correctly
618 waitForGenerate(function() {
619 var actual = page.evaluate(function() {
620 return $(".address:first").text();
621 });
622 if (actual != expected) {
623 console.log("DASH Testnet address is incorrect");
624 console.log("Expected: " + expected);
625 console.log("Actual: " + actual);
626 fail();
627 }
628 next();
629 });
630});
631},
632
604// Network can be set to game 633// Network can be set to game
605function() { 634function() {
606page.open(url, function(status) { 635page.open(url, function(status) {