Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Overwinter transactions #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"name": "bitcore-lib-zcash",
"main": "./bitcore-lib-zcash.min.js",
"version": "0.13.19",
"name": "bitcore-lib-zclassic",
"main": "./bitcore-lib-zclassic.min.js",
"version": "0.13.19-zclassic",
"homepage": "http://bitcore.io",
"authors": [
"BitPay, Inc.",
"Jack Grigg"
],
"description": "A pure, powerful core for your zcash project.",
"description": "A pure, powerful bitcore-lib for Zclassic.",
"moduleType": [
"globals"
],
"keywords": [
"zcash",
"zclassic",
"bitcore",
"bitcoin",
"btc",
"satoshi"
],
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


var bitcoreTasks = require('bitcore-build-zcash');
var bitcoreTasks = require('bitcore-build-zclassic');

bitcoreTasks('lib');
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ var bitcore = module.exports;
bitcore.version = 'v' + require('./package.json').version;
bitcore.versionGuard = function(version) {
if (version !== undefined) {
var message = 'More than one instance of bitcore-lib-zcash found. ' +
'Please make sure to require bitcore-lib-zcash and check that submodules do' +
' not also include their own bitcore-lib-zcash dependency.';
// TODO: put this back if we start versioning again
var message = 'More than one instance of bitcore-lib-zclassic found. ' +
'Please make sure to require bitcore-lib-zclassic and check that submodules do ' +
'not also include their own bitcore-lib-zclassic dependency.';
// TODO: put this back if we start versioning again (?)
//throw new Error(message);
}
};
Expand Down
15 changes: 10 additions & 5 deletions lib/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,17 @@ addNetwork({
zaddr: 0x169a,
zkey: 0xab36,
networkMagic: 0x24e92764,
port: 8233,
port: 8033,
dnsSeeds: [
'dnsseed.z.cash',
'dnsseed.str4d.xyz',
'dnsseed.znodes.org'
'na1.zclassic.org',
'na2.zclassic.org',
'na3.zclassic.org',
'eu1.zclassic.org',
'eu2.zclassic.org',
'eu3.zclassic.org',
'as1.zclassic.org',
'as2.zclassic.org',
'as3.zclassic.org'
]
});

Expand Down Expand Up @@ -179,7 +185,6 @@ var TESTNET = {
PORT: 18233,
NETWORK_MAGIC: BufferUtil.integerAsBuffer(0xfa1af9bf),
DNS_SEEDS: [
'dnsseed.testnet.z.cash',
]
};

Expand Down
10 changes: 5 additions & 5 deletions lib/uri.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ URI.isValid = function(arg, knownParams) {
};

/**
* Convert a bitcoin URI string into a simple object.
* Convert a BIP21 'bitcoin:' URI string into a simple object.
*
* @param {string} uri - A bitcoin URI string
* @throws {TypeError} Invalid bitcoin URI
Expand All @@ -110,8 +110,8 @@ URI.isValid = function(arg, knownParams) {
URI.parse = function(uri) {
var info = URL.parse(uri, true);

if (info.protocol !== 'zcash:') {
throw new TypeError('Invalid zcash URI');
if (info.protocol !== 'bitcoin:') {
throw new TypeError('Invalid BIP21 URI');
}

// workaround to host insensitiveness
Expand All @@ -135,7 +135,7 @@ URI.prototype._fromObject = function(obj) {
/* jshint maxcomplexity: 10 */

if (!Address.isValid(obj.address)) {
throw new TypeError('Invalid zcash address');
throw new TypeError('Invalid Zclassic address');
}

this.address = new Address(obj.address);
Expand Down Expand Up @@ -205,7 +205,7 @@ URI.prototype.toString = function() {
_.extend(query, this.extras);

return URL.format({
protocol: 'zcash:',
protocol: 'bitcoin:',
host: this.address,
query: query
});
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bitcore-lib-zcash",
"version": "0.13.19",
"description": "A pure and powerful JavaScript Zcash library.",
"name": "bitcore-lib-zclassic",
"version": "0.13.19-zclassic",
"description": "A pure and powerful JavaScript Zclassic bitcore library.",
"author": "BitPay <[email protected]>",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -61,11 +61,13 @@
}
],
"keywords": [
"zclassic",
"zcl",
"zcash",
"transaction",
"address",
"p2p",
"ecies",
"cryptocurrencies",
"cryptocurrency",
"blockchain",
"payment",
Expand All @@ -78,7 +80,7 @@
],
"repository": {
"type": "git",
"url": "https://github.com/str4d/bitcore-lib-zcash.git"
"url": "https://github.com/z-classic/bitcore-lib-zclassic.git"
},
"browser": {
"request": "browser-request"
Expand All @@ -92,7 +94,7 @@
"lodash": "=3.10.1"
},
"devDependencies": {
"bitcore-build-zcash": "str4d/bitcore-build-zcash",
"bitcore-build-zclassic": "z-classic/bitcore-build-zclassic",
"brfs": "^1.2.0",
"chai": "^1.10.0",
"gulp": "^3.8.10",
Expand Down
4 changes: 2 additions & 2 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<title>Mocha</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../node_modules/bitcore-build-zcash/node_modules/mocha/mocha.css" />
<link rel="stylesheet" href="../node_modules/bitcore-build-zclassic/node_modules/mocha/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<script src="../node_modules/bitcore-build-zcash/node_modules/mocha/mocha.js"></script>
<script src="../node_modules/bitcore-build-zclassic/node_modules/mocha/mocha.js"></script>
<script>mocha.setup('bdd')</script>
<script src="../tests.js"></script>
<script>
Expand Down