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

cc-assetid-encoder

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cc-assetid-encoder - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

2

assetIdEncoder.js

@@ -31,3 +31,3 @@ var cs = require('coinstring')

if (typeof bitcoinTransaction.cc_data[0].lockStatus === 'undefined') throw new Error('Missing Lock Status data')
var lockStatus = bitcoinTransaction.cc_data.lockStatus
var lockStatus = bitcoinTransaction.cc_data[0].lockStatus
var firstInput = bitcoinTransaction.vin[0]

@@ -34,0 +34,0 @@ if (lockStatus) return createId(firstInput.txid + '-' + firstInput.vout, LOCKEPADDING)

{
"name": "cc-assetid-encoder",
"version": "0.3.0",
"version": "0.3.1",
"description": "Creates an Asset Id for Issuance transaction",

@@ -5,0 +5,0 @@ "main": "assetIdEncoder.js",

@@ -80,3 +80,3 @@ var assetId = require(__dirname + '/../assetIdEncoder')

it('should return Locked asset ID', function (done) {
bitcoinTransaction.cc_data.lockStatus = true
bitcoinTransaction.cc_data[0].lockStatus = true
assetId2 = assetId(bitcoinTransaction)

@@ -167,2 +167,19 @@ assert.equal(assetId2[0], 'L', 'Should be Locked')

it('should return Locked asset ID', function (done) {
bitcoinTransaction = {
'cc_data': [{
'type': 'issuance',
'lockStatus': true
}],
'vin': [{
'txid': '0f45f38a8bcd8331877267e0f3f5f8a4b3c716165e40db4eee34d52759ad954f',
'vout': 2
}]
}
assetId3 = assetId(bitcoinTransaction)
assert.equal(assetId3[0], 'L', 'Should be Locked')
// console.log(assetId3)
done()
})
it('should return Unlocked asset ID from testnet script address', function (done) {

@@ -169,0 +186,0 @@ bitcoinTransaction = {

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