diff options
-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 | 30 |
4 files changed, 64 insertions, 0 deletions
diff --git a/bip39-standalone.html b/bip39-standalone.html index 1fd175d..a7d6ce9 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html | |||
@@ -17896,6 +17896,16 @@ bitcoin.networks.dash = { | |||
17896 | wif: 0xcc, | 17896 | wif: 0xcc, |
17897 | }; | 17897 | }; |
17898 | 17898 | ||
17899 | bitcoin.networks.game = { | ||
17900 | bip32: { | ||
17901 | public: 0x0488b21e, | ||
17902 | private: 0x0488ade4 | ||
17903 | }, | ||
17904 | pubKeyHash: 0x26, | ||
17905 | scriptHash: 0x05, | ||
17906 | wif: 0xa6, | ||
17907 | }; | ||
17908 | |||
17899 | bitcoin.networks.namecoin = { | 17909 | bitcoin.networks.namecoin = { |
17900 | bip32: { | 17910 | bip32: { |
17901 | public: 0x0488b21e, | 17911 | public: 0x0488b21e, |
@@ -42781,6 +42791,13 @@ window.Entropy = new (function() { | |||
42781 | }, | 42791 | }, |
42782 | }, | 42792 | }, |
42783 | { | 42793 | { |
42794 | name: "GAME", | ||
42795 | onSelect: function() { | ||
42796 | network = bitcoin.networks.game; | ||
42797 | DOM.bip44coin.val(101); | ||
42798 | }, | ||
42799 | }, | ||
42800 | { | ||
42784 | name: "Jumbucks", | 42801 | name: "Jumbucks", |
42785 | onSelect: function() { | 42802 | onSelect: function() { |
42786 | network = bitcoin.networks.jumbucks; | 42803 | network = bitcoin.networks.jumbucks; |
diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js index b02d79f..ed1bb09 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.game = { | ||
49 | bip32: { | ||
50 | public: 0x0488b21e, | ||
51 | private: 0x0488ade4 | ||
52 | }, | ||
53 | pubKeyHash: 0x26, | ||
54 | scriptHash: 0x05, | ||
55 | wif: 0xa6, | ||
56 | }; | ||
57 | |||
48 | bitcoin.networks.namecoin = { | 58 | bitcoin.networks.namecoin = { |
49 | bip32: { | 59 | bip32: { |
50 | public: 0x0488b21e, | 60 | public: 0x0488b21e, |
diff --git a/src/js/index.js b/src/js/index.js index 757d088..8f825f4 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -1114,6 +1114,13 @@ | |||
1114 | }, | 1114 | }, |
1115 | }, | 1115 | }, |
1116 | { | 1116 | { |
1117 | name: "GAME", | ||
1118 | onSelect: function() { | ||
1119 | network = bitcoin.networks.game; | ||
1120 | DOM.bip44coin.val(101); | ||
1121 | }, | ||
1122 | }, | ||
1123 | { | ||
1117 | name: "Jumbucks", | 1124 | name: "Jumbucks", |
1118 | onSelect: function() { | 1125 | onSelect: function() { |
1119 | network = bitcoin.networks.jumbucks; | 1126 | network = bitcoin.networks.jumbucks; |
@@ -571,6 +571,36 @@ page.open(url, function(status) { | |||
571 | }); | 571 | }); |
572 | }, | 572 | }, |
573 | 573 | ||
574 | // Network can be set to game | ||
575 | function() { | ||
576 | page.open(url, function(status) { | ||
577 | // set the phrase and coin | ||
578 | var expected = "GSMY9bAp36cMR4zyT4uGVS7GFjpdXbao5Q"; | ||
579 | page.evaluate(function() { | ||
580 | $(".phrase").val("abandon abandon ability"); | ||
581 | $(".phrase").trigger("input"); | ||
582 | $(".network option[selected]").removeAttr("selected"); | ||
583 | $(".network option").filter(function() { | ||
584 | return $(this).html() == "GAME"; | ||
585 | }).prop("selected", true); | ||
586 | $(".network").trigger("change"); | ||
587 | }); | ||
588 | // check the address is generated correctly | ||
589 | waitForGenerate(function() { | ||
590 | var actual = page.evaluate(function() { | ||
591 | return $(".address:first").text(); | ||
592 | }); | ||
593 | if (actual != expected) { | ||
594 | console.log("GAME address is incorrect"); | ||
595 | console.log("Expected: " + expected); | ||
596 | console.log("Actual: " + actual); | ||
597 | fail(); | ||
598 | } | ||
599 | next(); | ||
600 | }); | ||
601 | }); | ||
602 | }, | ||
603 | |||
574 | // Network can be set to namecoin | 604 | // Network can be set to namecoin |
575 | function() { | 605 | function() { |
576 | page.open(url, function(status) { | 606 | page.open(url, function(status) { |