fix(generateSendOpReturn2): Adding tokenQty for genesis transaction

This commit is contained in:
Chris Troutner
2020-05-31 17:40:16 -07:00
parent 5fc0d4b81e
commit b83648419e
3 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -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
View File
@@ -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
+1
View File
@@ -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])
})