Testing new validation calls against BCHN and BCHA

This commit is contained in:
Chris Troutner
2020-12-05 11:02:44 -08:00
parent f2c0cd6feb
commit d61ea0831a
3 changed files with 12 additions and 5 deletions
+3 -1
View File
@@ -990,6 +990,7 @@ class Slp {
const s = JSON.stringify(query) const s = JSON.stringify(query)
const b64 = Buffer.from(s).toString('base64') const b64 = Buffer.from(s).toString('base64')
const url = `${process.env.SLPDB_URL}q/${b64}` const url = `${process.env.SLPDB_URL}q/${b64}`
// console.log('url: ', url)
const options = _this.generateCredentials() const options = _this.generateCredentials()
@@ -1390,6 +1391,7 @@ class Slp {
const s = JSON.stringify(query) const s = JSON.stringify(query)
const b64 = Buffer.from(s).toString('base64') const b64 = Buffer.from(s).toString('base64')
const url = `${process.env.SLPDB_WHITELIST_URL}q/${b64}` const url = `${process.env.SLPDB_WHITELIST_URL}q/${b64}`
// console.log('url: ', url)
const options = _this.generateCredentials() const options = _this.generateCredentials()
@@ -1458,7 +1460,7 @@ class Slp {
res.status(200) res.status(200)
return res.json(formattedTokens) return res.json(formattedTokens)
} catch (err) { } catch (err) {
wlogger.error('Error in slp.ts/validateBulk().', err) wlogger.error('Error in slp.js/validate3Bulk().', err)
return _this.errorHandler(err, res) return _this.errorHandler(err, res)
} }
+8 -3
View File
@@ -8,6 +8,14 @@ export NETWORK=mainnet
# SLPDB # SLPDB
export SLPDB_URL=http://<SLPDB IP>:12300/ export SLPDB_URL=http://<SLPDB IP>:12300/
export SLPDB_PASS=somelongpassword
# Use the same address as SLPDB_URL if you don't have a separate whitelist server.
export SLPDB_WHITELIST_URL=http://<SLPDB IP>:12300/
# slp-api alternative SLP validator using slp-validate:
# https://github.com/Permissionless-Software-Foundation/slp-api
export SLP_API_URL=http://10.0.0.5:5001/
# Blockbook # Blockbook
export BLOCKBOOK_URL=https://<Blockbook IP>:9131/ export BLOCKBOOK_URL=https://<Blockbook IP>:9131/
@@ -23,9 +31,6 @@ export TOKENSECRET=somelongpassword
# So that bch-api can call bch-js locally. # So that bch-api can call bch-js locally.
export LOCAL_RESTURL=http://127.0.0.1:3000/v3/ export LOCAL_RESTURL=http://127.0.0.1:3000/v3/
# slp-api alternative SLP validator.
export SLP_API_URL=http://10.0.0.5:5001/
# Basic Authentication password # Basic Authentication password
export PRO_PASS=somerandomepassword:someotherrandompassword:aThirdPassword export PRO_PASS=somerandomepassword:someotherrandompassword:aThirdPassword
+1 -1
View File
@@ -513,7 +513,7 @@ describe('#SLP', () => {
req.params.txid = txid req.params.txid = txid
const result = await slpRoute.validate3Single(req, res) const result = await slpRoute.validate3Single(req, res)
// console.log(`result: ${JSON.stringify(result, null, 2)}`) console.log(`result: ${JSON.stringify(result, null, 2)}`)
assert.equal(result.txid, txid) assert.equal(result.txid, txid)
assert.equal(result.valid, false) assert.equal(result.valid, false)