fix(ninsight): Fixing failing ninsight integration test

This commit is contained in:
Chris Troutner
2020-08-13 16:07:08 -07:00
parent 7f1b87215c
commit 8facfd69ac
2 changed files with 17 additions and 21 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ class Ninsight {
// Handle single address.
if (typeof address === "string") {
const response = await axios.post(
`${this.ninsightURL}/address/utxo/${address}`,
`${this.ninsightURL}/address/utxo`,
{
addresses: [address]
},
+16 -20
View File
@@ -12,30 +12,26 @@ describe(`#Ninsight`, () => {
describe(`#utxo`, () => {
it(`should GET utxos for a single address`, async () => {
try {
const addr = "bitcoincash:qqh793x9au6ehvh7r2zflzguanlme760wuzehgzjh9"
const addr = "bitcoincash:qqh793x9au6ehvh7r2zflzguanlme760wuzehgzjh9"
const result = await bchjs.Ninsight.utxo(addr)
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
const result = await bchjs.Ninsight.utxo(addr)
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
assert.property(result, "utxos")
assert.property(result, "legacyAddress")
assert.property(result, "cashAddress")
assert.property(result, "slpAddress")
assert.property(result, "scriptPubKey")
assert.property(result, "asm")
assert.property(result[0], "utxos")
assert.property(result[0], "legacyAddress")
assert.property(result[0], "cashAddress")
assert.property(result[0], "slpAddress")
assert.property(result[0], "scriptPubKey")
assert.property(result[0], "asm")
assert.isArray(result.utxos)
assert.isArray(result[0].utxos)
assert.property(result.utxos[0], "txid")
assert.property(result.utxos[0], "vout")
assert.property(result.utxos[0], "amount")
assert.property(result.utxos[0], "satoshis")
assert.property(result.utxos[0], "height")
assert.property(result.utxos[0], "confirmations")
} catch (err) {
console.error("Error in test: ", err)
}
assert.property(result[0].utxos[0], "txid")
assert.property(result[0].utxos[0], "vout")
assert.property(result[0].utxos[0], "amount")
assert.property(result[0].utxos[0], "satoshis")
assert.property(result[0].utxos[0], "height")
assert.property(result[0].utxos[0], "confirmations")
})
it(`should POST utxo details for an array of addresses`, async () => {