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

@dashevo/dashcore-lib

Package Overview
Dependencies
Maintainers
7
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dashevo/dashcore-lib - npm Package Compare versions

Comparing version 0.20.5 to 0.20.6

52

lib/transaction/payload/coinbasepayload.js

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

var utils = require('../../util/js');
var BN = require('../../crypto/bn');

@@ -24,2 +25,5 @@ var isUnsignedInteger = utils.isUnsignedInteger;

* @property {string} merkleRootQuorums
* @property {number} bestCLHeight
* @property {Buffer} bestCLSignature
* @property {number} assetLockedAmount
*/

@@ -33,2 +37,5 @@

* @property {string} merkleRootQuorums
* @property {number} bestCLHeight
* @property {Buffer} bestCLSignature
* @property {number} assetLockedAmount
*/

@@ -66,2 +73,8 @@ function CoinbasePayload() {

if (payload.version >= 3) {
payload.bestCLHeight = payloadBufferReader.readVarintNum();
payload.bestCLSignature = payloadBufferReader.read(96);
payload.assetLockedAmount = payloadBufferReader.readUInt64LEBN();
}
if (!payloadBufferReader.finished()) {

@@ -91,2 +104,8 @@ throw new Error(

if (payload.version >= 3) {
payload.bestCLHeight = payloadJson.bestCLHeight;
payload.bestCLSignature = Buffer.from(payloadJson.bestCLSignature, 'hex');
payload.assetLockedAmount = payloadJson.assetLockedAmount;
}
payload.validate();

@@ -131,2 +150,24 @@ return payload;

}
if (this.version >= 3) {
Preconditions.checkArgument(
isUnsignedInteger(this.bestCLHeight),
'Expect bestCLHeight to be an unsigned integer'
);
Preconditions.checkArgument(
Buffer.isBuffer(this.bestCLSignature),
'Expect bestCLSignature to be a buffer'
);
Preconditions.checkArgument(
this.bestCLSignature.length === 96,
'Invalid bestCLSignature size'
);
Preconditions.checkArgument(
BN.isBN(this.assetLockedAmount),
'Expect assetLockedAmount to be an instance of BN'
);
Preconditions.checkArgument(
isUnsignedInteger(this.assetLockedAmount.toNumber()),
'Expect assetLockedAmount to be an unsigned integer'
);
}
return true;

@@ -149,2 +190,7 @@ };

}
if (this.version >= 3) {
json.bestCLHeight = this.bestCLHeight;
json.bestCLSignature = this.bestCLSignature.toString('hex');
json.assetLockedAmount = this.assetLockedAmount;
}
return json;

@@ -172,2 +218,8 @@ };

if (this.version >= 3) {
payloadBufferWriter.writeVarintNum(this.bestCLHeight);
payloadBufferWriter.write(this.bestCLSignature);
payloadBufferWriter.writeUInt64LEBN(new BN(this.assetLockedAmount));
}
return payloadBufferWriter.toBuffer();

@@ -174,0 +226,0 @@ };

2

package.json
{
"name": "@dashevo/dashcore-lib",
"version": "0.20.5",
"version": "0.20.6",
"description": "A pure and powerful JavaScript Dash library.",

@@ -5,0 +5,0 @@ "author": "Dash Core Group, Inc. <dev@dash.org>",

Sorry, the diff of this file is too big to display

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