@psf/bch-js 4.20.22 → 4.20.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/transaction.js +2 -0
- package/test/unit/transaction-unit.js +10 -0
package/package.json
CHANGED
package/src/transaction.js
CHANGED
|
@@ -379,12 +379,14 @@ class Transaction {
|
|
|
379
379
|
thisVin.tokenId = inTokenData.tokenId
|
|
380
380
|
} else {
|
|
381
381
|
thisVin.tokenQty = null
|
|
382
|
+
thisVin.tokenQtyStr = null
|
|
382
383
|
}
|
|
383
384
|
} catch (err) {
|
|
384
385
|
// If decodeOpReturn() throws an error, then this input is not
|
|
385
386
|
// from an SLP transaction and can be ignored.
|
|
386
387
|
// thisVin.tokenQty = null
|
|
387
388
|
thisVin.tokenQty = null
|
|
389
|
+
thisVin.tokenQtyStr = null
|
|
388
390
|
continue
|
|
389
391
|
}
|
|
390
392
|
}
|
|
@@ -351,6 +351,10 @@ describe('#TransactionLib', () => {
|
|
|
351
351
|
assert.property(result.vin[0], 'value')
|
|
352
352
|
assert.property(result.vin[0], 'tokenQty')
|
|
353
353
|
|
|
354
|
+
// Assert that tokenIds and tokenQty are included in inputs.
|
|
355
|
+
assert.property(result.vin[0], 'tokenId')
|
|
356
|
+
assert.equal(result.vin[0].tokenQtyStr, '998834')
|
|
357
|
+
|
|
354
358
|
// Assert blockheight is added
|
|
355
359
|
assert.equal(result.blockheight, 603424)
|
|
356
360
|
})
|
|
@@ -419,6 +423,12 @@ describe('#TransactionLib', () => {
|
|
|
419
423
|
assert.equal(result.vin[0].tokenQty, 10000000)
|
|
420
424
|
assert.equal(result.vin[1].tokenQty, null)
|
|
421
425
|
|
|
426
|
+
// Assert that tokenIds and tokenQty are included in inputs.
|
|
427
|
+
assert.property(result.vin[0], 'tokenId')
|
|
428
|
+
assert.equal(result.vin[0].tokenQtyStr, '10000000')
|
|
429
|
+
assert.equal(result.vin[1].tokenQty, null)
|
|
430
|
+
assert.equal(result.vin[1].tokenQtyStr, null)
|
|
431
|
+
|
|
422
432
|
// Assert blockheight is added
|
|
423
433
|
assert.equal(result.blockheight, 543409)
|
|
424
434
|
})
|