Commit 2d786084 authored by Zhenzhen Zhan's avatar Zhenzhen Zhan
Browse files

Fix a bug that VersionGuard conflicts with bitpay bitcore

parent df3a7ae3
......@@ -6,14 +6,14 @@ 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 found. ' +
'Please make sure to require bitcore-lib and check that submodules do' +
' not also include their own bitcore-lib dependency.';
var message = 'More than one instance of bitcore-lib-crown found. ' +
'Please make sure to require bitcore-lib-crown and check that submodules do' +
' not also include their own bitcore-lib-crown dependency.';
throw new Error(message);
}
};
bitcore.versionGuard(global._bitcore);
global._bitcore = bitcore.version;
bitcore.versionGuard(global._bitcoreCrown);
global._bitcoreCrown = bitcore.version;
// crypto
bitcore.crypto = {};
......
{
"name": "bitcore-lib-crown",
"version": "0.3.1",
"version": "0.3.2",
"publishConfig": {
"tag": "next"
},
......
......@@ -4,8 +4,8 @@ var should = require('chai').should();
var bitcore = require('../');
describe('#versionGuard', function() {
it('global._bitcore should be defined', function() {
should.equal(global._bitcore, bitcore.version);
it('global._bitcoreCrown should be defined', function() {
should.equal(global._bitcoreCrown, bitcore.version);
});
it('throw an error if version is already defined', function() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment