mirror of
https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service.git
synced 2026-09-21 16:52:03 -07:00
Working on unit tests
This commit is contained in:
@@ -38,7 +38,7 @@ class BCHUseCases {
|
||||
|
||||
// Get the transaction history for the list of addresses.
|
||||
const data = await this.bchjs.Electrumx.transactions([addr])
|
||||
// console.log(`data: ${JSON.stringify(data, null, 2)}`)
|
||||
console.log(`data: ${JSON.stringify(data, null, 2)}`)
|
||||
|
||||
if (!data.success) {
|
||||
throw new Error('Could not query Fulcrum indexer.')
|
||||
@@ -54,9 +54,9 @@ class BCHUseCases {
|
||||
|
||||
// Paginate the results
|
||||
const pagedResults = this.bchjs.Util.chunk100(txsArr)
|
||||
// console.log(
|
||||
// `pagedResults[page]: ${JSON.stringify(pagedResults[page], null, 2)}`
|
||||
// )
|
||||
console.log(
|
||||
`pagedResults[page]: ${JSON.stringify(pagedResults[page], null, 2)}`
|
||||
)
|
||||
|
||||
const retObj = {
|
||||
address: addr,
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
/*
|
||||
Mock data for use-cases/bch/index.js unit tests
|
||||
*/
|
||||
@@ -42,7 +42,9 @@ describe('#bch-use-case', () => {
|
||||
const rpcData = {
|
||||
payload: {
|
||||
params: {
|
||||
addresses: ['bitcoincash:thing']
|
||||
addresses: [
|
||||
'bitcoincash:qpdh9s677ya8tnx7zdhfrn8qfyvy22wj4qa7nwqa5v'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user