mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-22 00:52:01 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe37c3ca43 | ||
|
|
ff4ffab670 |
@@ -379,12 +379,14 @@ class Transaction {
|
||||
thisVin.tokenId = inTokenData.tokenId
|
||||
} else {
|
||||
thisVin.tokenQty = null
|
||||
thisVin.tokenQtyStr = null
|
||||
}
|
||||
} catch (err) {
|
||||
// If decodeOpReturn() throws an error, then this input is not
|
||||
// from an SLP transaction and can be ignored.
|
||||
// thisVin.tokenQty = null
|
||||
thisVin.tokenQty = null
|
||||
thisVin.tokenQtyStr = null
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,6 +351,10 @@ describe('#TransactionLib', () => {
|
||||
assert.property(result.vin[0], 'value')
|
||||
assert.property(result.vin[0], 'tokenQty')
|
||||
|
||||
// Assert that tokenIds and tokenQty are included in inputs.
|
||||
assert.property(result.vin[0], 'tokenId')
|
||||
assert.equal(result.vin[0].tokenQtyStr, '998834')
|
||||
|
||||
// Assert blockheight is added
|
||||
assert.equal(result.blockheight, 603424)
|
||||
})
|
||||
@@ -419,6 +423,12 @@ describe('#TransactionLib', () => {
|
||||
assert.equal(result.vin[0].tokenQty, 10000000)
|
||||
assert.equal(result.vin[1].tokenQty, null)
|
||||
|
||||
// Assert that tokenIds and tokenQty are included in inputs.
|
||||
assert.property(result.vin[0], 'tokenId')
|
||||
assert.equal(result.vin[0].tokenQtyStr, '10000000')
|
||||
assert.equal(result.vin[1].tokenQty, null)
|
||||
assert.equal(result.vin[1].tokenQtyStr, null)
|
||||
|
||||
// Assert blockheight is added
|
||||
assert.equal(result.blockheight, 543409)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user