New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bitcoin

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcoin - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

test/config

21

lib/jsonrpc.js

@@ -62,6 +62,21 @@ var util = require('util');

response.on('end', function() {
var decoded = JSON.parse(buffer);
try {
var decoded = JSON.parse(buffer);
} catch (e) {
if (response.statusCode !== 200) {
errback({
code: -32602,
message: 'Invalid params, response status code: ' + response.statusCode
});
} else {
errback({
code: -32603,
message: 'Problem parsing JSON response from server'
});
}
return;
}
if(decoded.hasOwnProperty('error') && decoded.error != null) {
if (errback)
errback(decoded.error)
errback(decoded.error);
} else if(decoded.hasOwnProperty('result')) {

@@ -163,4 +178,2 @@ if (callback)

console.log(decoded);
// Check for the required fields, and if they aren't there, then

@@ -167,0 +180,0 @@ // dispatch to the handleInvalidRequest function.

2

package.json
{
"name": "bitcoin",
"description": "Communicate with bitcoind via JSON-RPC",
"version": "1.1.4",
"version": "1.1.5",
"main": "./lib/bitcoin",

@@ -6,0 +6,0 @@ "keywords": [

@@ -6,3 +6,3 @@ var path = require('path');

var test = {
account: "test"
account: 'test'
};

@@ -143,7 +143,7 @@

},
"creating a bitcoin related error": {
'creating a bitcoin related error': {
topic: function(client) {
client.cmd('nomethod', this.callback);
},
"should create non-null err in callback": function(err, expectedValue) {
'should create non-null err in callback': function(err, expectedValue) {
assert.deepEqual(err, {

@@ -154,6 +154,28 @@ code: -32601,

assert.equal(expectedValue, undefined);
}
}
}
},
},
},
'invalid credentials': {
topic: function() {
return new bitcoin.Client(config.host, config.port, 'baduser', 'badpwd');
},
'should still return client object': function(client) {
assert.equal(typeof client, 'object');
assert.equal(client.host, config.host);
assert.equal(client.port, config.port);
assert.equal(client.user, 'baduser');
assert.equal(client.pass, 'badpwd');
},
'will return status 401 with html': {
topic: function(client) {
client.getDifficulty(this.callback);
},
'and should be able to handle it': function(err, difficulty) {
assert.isNotNull(err);
assert.isObject(err);
assert.equal(difficulty, undefined);
},
},
},
}).export(module);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc