Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dashevo/dashd-rpc

Package Overview
Dependencies
Maintainers
7
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dashevo/dashd-rpc - npm Package Compare versions

Comparing version 2.3.1 to 2.3.2

8

lib/index.js

@@ -201,2 +201,3 @@ /* eslint-disable */

getBlockHeaders: 'str int bool',
getBlockStats: 'int_str obj',
getBlockTemplate: '',

@@ -335,2 +336,9 @@ getConnectionCount: '',

},
int_str(arg) {
if (typeof arg === 'number') {
return parseFloat(arg)
}
return arg.toString()
},
float(arg) {

@@ -337,0 +345,0 @@ return parseFloat(arg);

2

package.json
{
"name": "@dashevo/dashd-rpc",
"description": "Dash Client Library to connect to Dash Core (dashd) via RPC",
"version": "2.3.1",
"version": "2.3.2",
"author": {

@@ -6,0 +6,0 @@ "name": "Stephen Pair",

@@ -164,5 +164,4 @@ 'use strict';

it('should process object arguments', function(done) {
var client = new RpcClient({
it('should process int_str arguments', async () => {
const client = new RpcClient({
user: 'user',

@@ -173,9 +172,9 @@ pass: 'pass',

rejectUnauthorized: true,
disableAgent: false
disableAgent: false,
});
var requestStub = sinon.stub(client.protocol, 'request').callsFake(function(options, callback){
var res = new FakeResponse();
var req = new FakeRequest();
setImmediate(function(){
const requestStub = sinon.stub(client.protocol, 'request').callsFake(function(options, callback){
const res = new FakeResponse();
const req = new FakeRequest();
setImmediate(() => {
res.emit('data', req.data);

@@ -188,15 +187,15 @@ res.emit('end');

var obj = {'n28S35tqEMbt6vNad7A5K3mZ7vdn8dZ86X': 1};
async.eachSeries([obj, JSON.stringify(obj)], function(i, next) {
client.sendMany('account', i, function(error, parsedBuf) {
should.not.exist(error);
should.exist(parsedBuf);
parsedBuf.params[1].should.have.property('n28S35tqEMbt6vNad7A5K3mZ7vdn8dZ86X', 1);
next();
});
}, function(err) {
requestStub.restore();
done();
});
const blockByHeight = await (new Promise((res) => client.getBlockStats(1, ['height'], (err, data) => res(data))));
should.exist(blockByHeight);
blockByHeight.params[0].should.equal(1);
blockByHeight.params[1].should.deep.equal(['height']);
const blockByHash = await (new Promise((res) => client.getBlockStats('fake_hash', ['height'], (err, data) => res(data))));
should.exist(blockByHash);
blockByHash.params[0].should.equal('fake_hash');
blockByHash.params[1].should.deep.equal(['height']);
requestStub.restore();
});

@@ -203,0 +202,0 @@

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