fix(tests): Fixing broken integration test

This commit is contained in:
Chris Troutner
2022-03-10 16:38:41 -08:00
parent 34b9cefb65
commit 56bc942e87
2 changed files with 12 additions and 20 deletions
+3 -3
View File
@@ -138,7 +138,7 @@ class PsfSlpIndexer {
if (typeof address === 'string') { if (typeof address === 'string') {
const response = await axios.post( const response = await axios.post(
`${this.restURL}psf/slp/address`, `${this.restURL}psf/slp/address`,
{ address}, { address },
this.axiosOptions this.axiosOptions
) )
return response.data return response.data
@@ -202,7 +202,7 @@ class PsfSlpIndexer {
if (typeof tokenId === 'string') { if (typeof tokenId === 'string') {
const response = await axios.post( const response = await axios.post(
`${this.restURL}psf/slp/token`, `${this.restURL}psf/slp/token`,
{ tokenId, withTxHistory}, { tokenId, withTxHistory },
this.axiosOptions this.axiosOptions
) )
return response.data return response.data
@@ -292,7 +292,7 @@ class PsfSlpIndexer {
if (typeof txid === 'string') { if (typeof txid === 'string') {
const response = await axios.post( const response = await axios.post(
`${this.restURL}psf/slp/txid`, `${this.restURL}psf/slp/txid`,
{ txid}, { txid },
this.axiosOptions this.axiosOptions
) )
return response.data return response.data
@@ -126,43 +126,35 @@ describe('#UTXO', () => {
it('should hydrate token UTXOs', async () => { it('should hydrate token UTXOs', async () => {
const utxos = [ const utxos = [
{ {
txid: txid: '384e1b8197e8de7d38f98317af2cf5f6bcb50007c46943b3498a6fab6e8aeb7c',
'384e1b8197e8de7d38f98317af2cf5f6bcb50007c46943b3498a6fab6e8aeb7c',
vout: 1, vout: 1,
type: 'token', type: 'token',
qty: '10000000', qty: '10000000',
tokenId: tokenId: 'a436c8e1b6bee3d701c6044d190f76f774be83c36de8d34a988af4489e86dd37',
'a436c8e1b6bee3d701c6044d190f76f774be83c36de8d34a988af4489e86dd37',
address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m' address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m'
}, },
{ {
txid: txid: '4fc789405d58ec612c69eba29aa56cf0c7f228349801114138424eb68df4479d',
'4fc789405d58ec612c69eba29aa56cf0c7f228349801114138424eb68df4479d',
vout: 1, vout: 1,
type: 'token', type: 'token',
qty: '100000000', qty: '100000000',
tokenId: tokenId: 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb',
'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb',
address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m' address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m'
}, },
{ {
txid: txid: '42054bba4d69bfe7801ece0cffc754194b04239034fdfe9dbe321ef76c9a2d93',
'42054bba4d69bfe7801ece0cffc754194b04239034fdfe9dbe321ef76c9a2d93',
vout: 5, vout: 5,
type: 'token', type: 'token',
qty: '4764', qty: '4764',
tokenId: tokenId: 'f05faf13a29c7f5e54ab921750aafb6afaa953db863bd2cf432e918661d4132f',
'f05faf13a29c7f5e54ab921750aafb6afaa953db863bd2cf432e918661d4132f',
address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m' address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m'
}, },
{ {
txid: txid: '06938d0a0d15aa76524ffe61fe111d6d2b2ea9dd8dcd4c7c7744614ced370861',
'06938d0a0d15aa76524ffe61fe111d6d2b2ea9dd8dcd4c7c7744614ced370861',
vout: 5, vout: 5,
type: 'token', type: 'token',
qty: '238', qty: '238',
tokenId: tokenId: 'f05faf13a29c7f5e54ab921750aafb6afaa953db863bd2cf432e918661d4132f',
'f05faf13a29c7f5e54ab921750aafb6afaa953db863bd2cf432e918661d4132f',
address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m' address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m'
} }
] ]
@@ -226,7 +218,7 @@ describe('#UTXO', () => {
const result = await bchjs.Utxo.get(addr) const result = await bchjs.Utxo.get(addr)
// console.log(`result: ${JSON.stringify(result, null, 2)}`) // console.log(`result: ${JSON.stringify(result, null, 2)}`)
assert.isAbove(result.nullUtxos.length, 0) assert.equal(result.nullUtxos.length, 0)
}) })
}) })
}) })