]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Merge pull request #65 from mikeyb/game
authoriancoleman <coleman.ian@gmail.com>
Thu, 27 Apr 2017 23:16:29 +0000 (09:16 +1000)
committerGitHub <noreply@github.com>
Thu, 27 Apr 2017 23:16:29 +0000 (09:16 +1000)
Add GAME support

bip39-standalone.html
src/js/bitcoinjs-extensions.js
src/js/index.js
tests.js

index 1fd175d522fd845a95a80f3401afce3f5d818e7e..a7d6ce9dbb594de298cecfe9847a9b36af1340d6 100644 (file)
@@ -17896,6 +17896,16 @@ bitcoin.networks.dash = {
   wif: 0xcc,
 };
 
+bitcoin.networks.game = {
+  bip32: {
+    public: 0x0488b21e,
+    private: 0x0488ade4
+  },
+  pubKeyHash: 0x26,
+  scriptHash: 0x05,
+  wif: 0xa6,
+};
+
 bitcoin.networks.namecoin = {
   bip32: {
     public: 0x0488b21e,
@@ -42780,6 +42790,13 @@ window.Entropy = new (function() {
                 DOM.bip44coin.val(60);
             },
         },
+        {
+            name: "GAME",
+            onSelect: function() {
+                network = bitcoin.networks.game;
+                DOM.bip44coin.val(101);
+            },
+        },
         {
             name: "Jumbucks",
             onSelect: function() {
index b02d79fcce30564d2e08dad34d9fe8cb026ad31b..ed1bb09669adb80e42598e33e3f3c4d60ad18551 100644 (file)
@@ -45,6 +45,16 @@ bitcoin.networks.dash = {
   wif: 0xcc,
 };
 
+bitcoin.networks.game = {
+  bip32: {
+    public: 0x0488b21e,
+    private: 0x0488ade4
+  },
+  pubKeyHash: 0x26,
+  scriptHash: 0x05,
+  wif: 0xa6,
+};
+
 bitcoin.networks.namecoin = {
   bip32: {
     public: 0x0488b21e,
index 757d0881e248bbc771db5f3e140e54ce93a3a95d..8f825f46c80c459f38e34480280fa6b7f8c3215d 100644 (file)
                 DOM.bip44coin.val(60);
             },
         },
+        {
+            name: "GAME",
+            onSelect: function() {
+                network = bitcoin.networks.game;
+                DOM.bip44coin.val(101);
+            },
+        },
         {
             name: "Jumbucks",
             onSelect: function() {
index d55b8f4730379bb34a9591362939427a282266ce..49d42c3e049fc24bc500b1a7caac75a949e08ca2 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -571,6 +571,36 @@ page.open(url, function(status) {
 });
 },
 
+// Network can be set to game
+function() {
+page.open(url, function(status) {
+    // set the phrase and coin
+    var expected = "GSMY9bAp36cMR4zyT4uGVS7GFjpdXbao5Q";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+        $(".network option[selected]").removeAttr("selected");
+        $(".network option").filter(function() {
+            return $(this).html() == "GAME";
+        }).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("GAME address is incorrect");
+            console.log("Expected: " + expected);
+            console.log("Actual: " + actual);
+            fail();
+        }
+        next();
+    });
+});
+},
+
 // Network can be set to namecoin
 function() {
 page.open(url, function(status) {