cc-assetid-encoder
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -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 = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12898
227