Fixed unit and integration tests for balancesForAddress bulk and single

This commit is contained in:
Chris Troutner
2019-12-02 19:31:00 -08:00
parent c53b6e0940
commit 3e26fd2a89
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -524,7 +524,7 @@ async function balancesForAddressBulk(req, res, next) {
// Ensure the input is a valid BCH address.
try {
utils.toCashAddress(address)
bchjs.SLP.Address.toCashAddress(address)
} catch (err) {
res.status(400)
return res.json({
@@ -533,7 +533,7 @@ async function balancesForAddressBulk(req, res, next) {
}
// Prevent a common user error. Ensure they are using the correct network address.
const cashAddr = utils.toCashAddress(address)
const cashAddr = bchjs.SLP.Address.toCashAddress(address)
const networkIsValid = routeUtils.validateNetwork(cashAddr)
if (!networkIsValid) {
res.status(400)
@@ -552,7 +552,7 @@ async function balancesForAddressBulk(req, res, next) {
q: {
db: ["a"],
find: {
address: SLP.Address.toSLPAddress(address),
address: bchjs.SLP.Address.toSLPAddress(address),
token_balance: { $gte: 0 }
},
limit: 10000
+2 -2
View File
@@ -513,7 +513,7 @@ describe("#SLP", () => {
])
})
})
/*
describe("balancesForAddressBulk()", () => {
const balancesForAddressBulk =
slpRoute.testableComponents.balancesForAddressBulk
@@ -599,7 +599,7 @@ describe("#SLP", () => {
})
}
})
/*
describe("balancesForAddressByTokenID()", () => {
const balancesForAddressByTokenID =
slpRoute.testableComponents.balancesForAddressByTokenID