diff options
author | iancoleman <coleman.ian@gmail.com> | 2017-06-17 09:05:07 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-17 09:05:07 +1000 |
commit | ee42e5f7126b8cfe5e9035dde0e140e2f5879db8 (patch) | |
tree | cc4ddcd57e4e4538e18db66ab42f270fa4b101e3 | |
parent | 56b1275f405f900872f95fc440c487fd478c3094 (diff) | |
parent | c0386f3b78c31bc23c935603abe9ed9fafe300d4 (diff) | |
download | BIP39-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.html | 17 | ||||
-rw-r--r-- | src/js/bitcoinjs-extensions.js | 10 | ||||
-rw-r--r-- | src/js/index.js | 7 | ||||
-rw-r--r-- | tests.js | 29 |
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 | ||
19915 | bitcoin.networks.dashtn = { | ||
19916 | bip32: { | ||
19917 | public: 0x043587cf, | ||
19918 | private: 0x04358394 | ||
19919 | }, | ||
19920 | pubKeyHash: 0x8c, | ||
19921 | scriptHash: 0x13, | ||
19922 | wif: 0xef, | ||
19923 | }; | ||
19924 | |||
19915 | bitcoin.networks.game = { | 19925 | bitcoin.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 | ||
48 | bitcoin.networks.dashtn = { | ||
49 | bip32: { | ||
50 | public: 0x043587cf, | ||
51 | private: 0x04358394 | ||
52 | }, | ||
53 | pubKeyHash: 0x8c, | ||
54 | scriptHash: 0x13, | ||
55 | wif: 0xef, | ||
56 | }; | ||
57 | |||
48 | bitcoin.networks.game = { | 58 | bitcoin.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; |
@@ -601,6 +601,35 @@ page.open(url, function(status) { | |||
601 | }); | 601 | }); |
602 | }, | 602 | }, |
603 | 603 | ||
604 | function() { | ||
605 | page.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 |
605 | function() { | 634 | function() { |
606 | page.open(url, function(status) { | 635 | page.open(url, function(status) { |