]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Add CRW - Crown
authormikeyb <mike@mikes.email>
Sat, 1 Jul 2017 22:38:46 +0000 (15:38 -0700)
committermikeyb <mike@mikes.email>
Sat, 1 Jul 2017 22:38:46 +0000 (15:38 -0700)
bip39-standalone.html
src/js/bitcoinjs-extensions.js
src/js/index.js
tests.js

index d3a8d339f6f7ae3bbfb570b0f617a9320edea910..1468fae17742a597eb23b67225b3b5837f4392c9 100644 (file)
@@ -19902,6 +19902,16 @@ bitcoin.networks.clam = {
   wif: 0x85,
 };
 
+bitcoin.networks.crown = {
+  bip32: {
+    public: 0x0488b21e,
+    private: 0x0488ade4
+  },
+  pubKeyHash: 0x00,
+  scriptHash: 0x05,
+  wif: 0x80,
+};
+
 bitcoin.networks.dash = {
   bip32: {
     public: 0x0488b21e,
@@ -44811,6 +44821,13 @@ window.Entropy = new (function() {
                 DOM.bip44coin.val(23);
             },
         },
+        {
+            name: "CRW - Crown",
+            onSelect: function() {
+                network = bitcoin.networks.crown;
+                DOM.bip44coin.val(72);
+            },
+        },
         {
             name: "Dogecoin",
             onSelect: function() {
index 7747d25bfcba6734543b841734fccfe3e8317c20..631af7e0e38766853c239dbc7dcd798dbd510e03 100644 (file)
@@ -35,6 +35,16 @@ bitcoin.networks.clam = {
   wif: 0x85,
 };
 
+bitcoin.networks.crown = {
+  bip32: {
+    public: 0x0488b21e,
+    private: 0x0488ade4
+  },
+  pubKeyHash: 0x00,
+  scriptHash: 0x05,
+  wif: 0x80,
+};
+
 bitcoin.networks.dash = {
   bip32: {
     public: 0x0488b21e,
index 2bb766de96f4ea6eb10d8630a45e5816aa380241..2b17515a28857bdafe84f31c95537ba365a31048 100644 (file)
                 DOM.bip44coin.val(23);
             },
         },
+        {
+            name: "CRW - Crown",
+            onSelect: function() {
+                network = bitcoin.networks.crown;
+                DOM.bip44coin.val(72);
+            },
+        },
         {
             name: "Dogecoin",
             onSelect: function() {
index c2f2cb5b2716543c24b699ac2d89ce0edb404182..e077a33a9446f575e827c23970d7039338b5ceef 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -571,6 +571,36 @@ page.open(url, function(status) {
 });
 },
 
+// Network can be set to crown
+function() {
+page.open(url, function(status) {
+    // set the phrase and coin
+    var expected = "18pWSwSUAQdiwMHUfFZB1fM2xue9X1FqE5";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+        $(".network option[selected]").removeAttr("selected");
+        $(".network option").filter(function() {
+            return $(this).html() == "CRW - Crown";
+        }).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("CRW address is incorrect");
+            console.log("Expected: " + expected);
+            console.log("Actual: " + actual);
+            fail();
+        }
+        next();
+    });
+});
+},
+
 // Network can be set to dash
 function() {
 page.open(url, function(status) {