Add BCH - Bitcoin Cash network

This commit is contained in:
Ian Coleman
2017-08-06 07:58:58 +10:00
parent 7b742f87d3
commit daab55dc61
2 changed files with 38 additions and 0 deletions

View File

@@ -1166,6 +1166,14 @@
}
var networks = [
{
name: "BCH - Bitcoin Cash",
bip49available: false,
onSelect: function() {
network = bitcoinjs.bitcoin.networks.bitcoin;
setHdCoin(145);
},
},
{
name: "BTC - Bitcoin",
bip49available: true,

View File

@@ -872,6 +872,36 @@ page.open(url, function(status) {
});
},
// Network can be set to bitcoin cash
function() {
page.open(url, function(status) {
// set the phrase and coin
var expected = "1JKvb6wKtsjNoCRxpZ4DGrbniML7z5U16A";
page.evaluate(function() {
$(".phrase").val("abandon abandon ability");
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "BCH - Bitcoin Cash";
}).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("Bitcoin Cash address is incorrect");
console.log("Expected: " + expected);
console.log("Actual: " + actual);
fail();
}
next();
});
});
},
// BIP39 seed is set from phrase
function() {
page.open(url, function(status) {