mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
fix(generateSendOpReturn2): Adding tokenQty for genesis transaction
This commit is contained in:
@@ -119,7 +119,7 @@ class TokenType1 {
|
||||
totalTokens += tokenUtxos[i].tokenQty
|
||||
|
||||
const change = totalTokens - sendQty
|
||||
// console.log(`change: ${change}`)
|
||||
console.log(`change: ${change}`)
|
||||
|
||||
let script
|
||||
let outputs = 1
|
||||
|
||||
+6
-2
@@ -1531,10 +1531,14 @@ class Utils {
|
||||
// If this is a valid SLP UTXO, then return the decoded OP_RETURN data.
|
||||
else {
|
||||
// Minting Baton
|
||||
if (utxo.vout === slpData.mintBatonVout)
|
||||
if (utxo.vout === slpData.mintBatonVout) {
|
||||
utxo.tokenType = "minting-baton"
|
||||
}
|
||||
// Tokens
|
||||
else utxo.tokenType = "token"
|
||||
else {
|
||||
utxo.tokenType = "token"
|
||||
utxo.tokenQty = slpData.qty / Math.pow(10, slpData.decimals)
|
||||
}
|
||||
|
||||
utxo.tokenId = utxo.txid
|
||||
utxo.tokenTicker = slpData.ticker
|
||||
|
||||
@@ -2052,6 +2052,7 @@ describe("#SLP Utils", () => {
|
||||
|
||||
assert2.isArray(data)
|
||||
assert2.equal(data[0].tokenType, "token")
|
||||
assert2.equal(data[0].tokenQty, 100)
|
||||
assert2.equal(data[1].tokenType, "minting-baton")
|
||||
assert2.equal(false, data[2])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user