Compare commits

...
5 Commits
Author SHA1 Message Date
Chris Troutner a515334a94 Merge pull request #76 from Permissionless-Software-Foundation/ct-unstable
fix(bch-js): Bumping to version 4.0.0
2020-12-05 21:02:45 -08:00
Chris Troutner 6be1369182 Updating package-lock 2020-12-05 20:59:05 -08:00
Chris Troutner 6455522ba6 fix(bch-js): Bumping to version 4.0.0 2020-12-05 20:56:35 -08:00
Chris Troutner d9a8999239 Merge pull request #75 from Permissionless-Software-Foundation/ct-unstable
fix(validateBulk): Handling corner case in SLP Utils validateBulk
2020-12-05 20:17:26 -08:00
Chris Troutner ae0f556f75 fix(validateBulk): Handling corner case in SLP Utils validateBulk 2020-12-05 20:16:09 -08:00
3 changed files with 936 additions and 2532 deletions
+911 -2529
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -28,7 +28,7 @@
"node": ">=10.15.1"
},
"dependencies": {
"@psf/bch-js": "^3.7.1",
"@psf/bch-js": "^4.0.0",
"apidoc": "^0.23.0",
"axios": "^0.19.0",
"bitcore-lib-cash": "^8.20.3",
@@ -75,7 +75,7 @@
"proxyquire": "^2.1.0",
"request": "^2.88.0",
"request-promise": "^4.2.2",
"semantic-release": "^17.0.0",
"semantic-release": "^17.3.0",
"sinon": "^9.0.0",
"standard": "^14.3.1",
"typescript": "^3.1.4"
+23 -1
View File
@@ -1040,6 +1040,15 @@ class Slp {
})
}
})
} else {
// Corner case: No results were returned from SLPDB. Mark each entry
// as 'null'
for (let i = 0; i < txids.length; i++) {
formattedTokens.push({
txid: txids[i],
valid: null
})
}
}
// Catch a corner case of repeated txids. SLPDB will remove redundent TXIDs,
@@ -1423,7 +1432,7 @@ class Slp {
let formattedTokens = []
// Combine the arrays. Why? Generally there is nothing in the u array.
// Combine the confirmed and unconfirmed collections.
const concatArray = tokenRes.data.c.concat(tokenRes.data.u)
const tokenIds = []
@@ -1457,6 +1466,15 @@ class Slp {
})
}
})
} else {
// Corner case: No results were returned from SLPDB. Mark each entry
// as 'null'
for (let i = 0; i < txids.length; i++) {
formattedTokens.push({
txid: txids[i],
valid: null
})
}
}
// Catch a corner case of repeated txids. SLPDB will remove redundent TXIDs,
@@ -1476,6 +1494,10 @@ class Slp {
formattedTokens = newOutput
}
// console.log(
// `formattedTokens: ${JSON.stringify(formattedTokens, null, 2)}`
// )
// Put the output array in the same order as the input array.
const outAry = []
for (let i = 0; i < txids.length; i++) {