Skip to content
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
5 changes: 3 additions & 2 deletions packages/bitcore-build/wdio.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

/* eslint-disable @typescript-eslint/no-require-imports */
const fs = require('fs');
const os = require('os');
const path = require('path');
Expand Down Expand Up @@ -162,7 +162,7 @@ module.exports.config = {
// See the full list at http://mochajs.org/
mochaOpts: {
ui: 'bdd',
timeout: 240000
timeout: 300000
},

//
Expand Down Expand Up @@ -322,6 +322,7 @@ module.exports.config = {
* @param {Array.<Object>} capabilities list of capabilities details
* @param {<Object>} results object containing test results
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
onComplete: function(exitCode, config, capabilities, results) {
try {
fs.rmSync(chromeUserDataDirRoot, { recursive: true, force: true });
Expand Down
8 changes: 5 additions & 3 deletions packages/bitcore-lib-cash/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ var bitcore = module.exports;

// module information
bitcore.version = 'v' + require('./package.json').version;

bitcore.versionGuard = function(version) {
if (version !== undefined) {
var message = 'More than one instance of bitcore-lib-cash found. ' +
'Please make sure to require bitcore-lib and check that submodules do' +
' not also include their own bitcore-lib dependency.';
const message = 'More than one instance of bitcore-lib-cash found. ' +
'Please make sure to require bitcore-lib-cash and check that submodules do' +
' not also include their own bitcore-lib-cash dependency.';
throw new Error(message);
}
};
Expand Down Expand Up @@ -64,6 +65,7 @@ bitcore.Unit = require('./lib/unit');
bitcore.deps = {};
bitcore.deps.bnjs = require('bn.js');
bitcore.deps.bs58 = require('bs58');

bitcore.deps.Buffer = Buffer;
bitcore.deps.elliptic = require('elliptic');
bitcore.deps._ = require('lodash');
Expand Down
14 changes: 7 additions & 7 deletions packages/bitcore-lib-cash/lib/crypto/hash.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
'use strict';

var crypto = require('crypto');
var nodeCrypto = require('crypto');
var BufferUtil = require('../util/buffer');
var $ = require('../util/preconditions');

var Hash = module.exports;

Hash.sha1 = function(buf) {
$.checkArgument(BufferUtil.isBuffer(buf));
return crypto.createHash('sha1').update(buf).digest();
return nodeCrypto.createHash('sha1').update(buf).digest();
};

Hash.sha1.blocksize = 512;

Hash.sha256 = function(buf) {
$.checkArgument(BufferUtil.isBuffer(buf));
return crypto.createHash('sha256').update(buf).digest();
return nodeCrypto.createHash('sha256').update(buf).digest();
};

Hash.sha256.blocksize = 512;
Expand All @@ -27,7 +27,7 @@ Hash.sha256sha256 = function(buf) {

Hash.ripemd160 = function(buf) {
$.checkArgument(BufferUtil.isBuffer(buf));
return crypto.createHash('ripemd160').update(buf).digest();
return nodeCrypto.createHash('ripemd160').update(buf).digest();
};

Hash.sha256ripemd160 = function(buf) {
Expand All @@ -37,14 +37,14 @@ Hash.sha256ripemd160 = function(buf) {

Hash.sha512 = function(buf) {
$.checkArgument(BufferUtil.isBuffer(buf));
return crypto.createHash('sha512').update(buf).digest();
return nodeCrypto.createHash('sha512').update(buf).digest();
};

Hash.sha512.blocksize = 1024;

Hash.hmac = function(hashf, data, key) {
//http://en.wikipedia.org/wiki/Hash-based_message_authentication_code
//http://tools.ietf.org/html/rfc4868#section-2
// http://en.wikipedia.org/wiki/Hash-based_message_authentication_code
// http://tools.ietf.org/html/rfc4868#section-2
$.checkArgument(BufferUtil.isBuffer(data));
$.checkArgument(BufferUtil.isBuffer(key));
$.checkArgument(hashf.blocksize);
Expand Down
Loading