Compare commits

...
10 Commits
Author SHA1 Message Date
Chris Troutner 42d88a149a Merge pull request #78 from Permissionless-Software-Foundation/ct-unstable
Updating bch-js for improvements to tokenUtxoDetails()
2020-12-06 20:01:01 -08:00
Chris Troutner 2e97430856 fix(bitcore-lib-cash): Upgrading to 8.23.1 to fix vulnerability 2020-12-06 19:56:30 -08:00
Chris Troutner 60bf587031 fix(bchjs): Bumping to v4.1.1 2020-12-06 19:50:00 -08:00
Chris Troutner 68d1226ded Merge pull request #77 from Permissionless-Software-Foundation/ct-unstable
fix(unit tests): Updating changing test value
2020-12-05 21:23:45 -08:00
Chris Troutner f6dc788492 fix(unit tests): Updating changing test value 2020-12-05 21:22:18 -08:00
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
4 changed files with 950 additions and 2560 deletions
+923 -2555
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -28,10 +28,10 @@
"node": ">=10.15.1" "node": ">=10.15.1"
}, },
"dependencies": { "dependencies": {
"@psf/bch-js": "^3.7.1", "@psf/bch-js": "^4.1.1",
"apidoc": "^0.23.0", "apidoc": "^0.23.0",
"axios": "^0.19.0", "axios": "^0.19.0",
"bitcore-lib-cash": "^8.20.3", "bitcore-lib-cash": "^8.23.1",
"body-parser": "^1.18.3", "body-parser": "^1.18.3",
"cookie-parser": "~1.4.3", "cookie-parser": "~1.4.3",
"cors": "^2.8.3", "cors": "^2.8.3",
@@ -75,7 +75,7 @@
"proxyquire": "^2.1.0", "proxyquire": "^2.1.0",
"request": "^2.88.0", "request": "^2.88.0",
"request-promise": "^4.2.2", "request-promise": "^4.2.2",
"semantic-release": "^17.0.0", "semantic-release": "^17.3.0",
"sinon": "^9.0.0", "sinon": "^9.0.0",
"standard": "^14.3.1", "standard": "^14.3.1",
"typescript": "^3.1.4" "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, // Catch a corner case of repeated txids. SLPDB will remove redundent TXIDs,
@@ -1423,7 +1432,7 @@ class Slp {
let formattedTokens = [] 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 concatArray = tokenRes.data.c.concat(tokenRes.data.u)
const tokenIds = [] 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, // Catch a corner case of repeated txids. SLPDB will remove redundent TXIDs,
@@ -1476,6 +1494,10 @@ class Slp {
formattedTokens = newOutput formattedTokens = newOutput
} }
// console.log(
// `formattedTokens: ${JSON.stringify(formattedTokens, null, 2)}`
// )
// Put the output array in the same order as the input array. // Put the output array in the same order as the input array.
const outAry = [] const outAry = []
for (let i = 0; i < txids.length; i++) { for (let i = 0; i < txids.length; i++) {
+1 -1
View File
@@ -732,7 +732,7 @@ describe('#SLP', () => {
// Note: This should change from null to true once SLPDB finishes indexing. // Note: This should change from null to true once SLPDB finishes indexing.
assert.equal(result[4].txid, txids[4]) assert.equal(result[4].txid, txids[4])
assert.equal(result[4].valid, null) assert.equal(result[4].valid, true)
assert.equal(result[5].txid, txids[5]) assert.equal(result[5].txid, txids[5])
assert.equal(result[5].valid, null) assert.equal(result[5].valid, null)