fix(sortAllTxs): Renaming Electrumx.sort0ConfTxs to sortAllTxs

This commit is contained in:
Chris Troutner
2021-01-27 07:24:28 -08:00
parent 338788c46d
commit d8437cf3fb
3 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -369,12 +369,12 @@ describe('#ElectrumX', () => {
})
})
describe('#sort0ConfTxs', () => {
describe('#sortAllTxs', () => {
it('should GET transaction history for a single address', async () => {
const addr = 'bitcoincash:qpdh9s677ya8tnx7zdhfrn8qfyvy22wj4qa7nwqa5v'
const txs = await bchjs.Electrumx.transactions(addr)
const sortedTransactions = await bchjs.Electrumx.sort0ConfTxs(
const sortedTransactions = await bchjs.Electrumx.sortAllTxs(
txs.transactions
)
// console.log(
+4 -4
View File
@@ -456,12 +456,12 @@ describe('#ElectrumX', () => {
})
// These tests use mocked data that contains unconfirmed transactions.
describe('#sort0ConfTxs', () => {
describe('#sortAllTxs', () => {
it('should sort in ascending', async () => {
// Stub network calls
sandbox.stub(bchjs.Electrumx.blockchain, 'getBlockCount').resolves(672141)
const result = await bchjs.Electrumx.sort0ConfTxs(mockData.txHistoryWithUnconfirmed.transactions, 'ASCENDING')
const result = await bchjs.Electrumx.sortAllTxs(mockData.txHistoryWithUnconfirmed.transactions, 'ASCENDING')
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
assert.isBelow(result[0].height, result[1].height)
@@ -471,7 +471,7 @@ describe('#ElectrumX', () => {
// Stub network calls
sandbox.stub(bchjs.Electrumx.blockchain, 'getBlockCount').resolves(672141)
const result = await bchjs.Electrumx.sort0ConfTxs(mockData.txHistoryWithUnconfirmed.transactions)
const result = await bchjs.Electrumx.sortAllTxs(mockData.txHistoryWithUnconfirmed.transactions)
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
assert.isAbove(result[1].height, result[2].height)
@@ -482,7 +482,7 @@ describe('#ElectrumX', () => {
// Stub network calls
sandbox.stub(bchjs.Electrumx.blockchain, 'getBlockCount').resolves(672141)
await bchjs.Electrumx.sort0ConfTxs('abc')
await bchjs.Electrumx.sortAllTxs('abc')
assert.fail('Unexpected result')
} catch (err) {