Removing Current

This commit is contained in:
Luis Fernando Molina committed 2020-11-20 14:17:04 +01:00
1 parent d6c5e91290
commit a4ed878fcd
4379 files changed

No files matched your search

@@ -0,0 +1,39 @@
'use strict'
// ----------------------------------------------------------------------------
const log = require ('ololog')
, ansi = require ('ansicolor').nice
, chai = require ('chai')
, expect = chai.expect
, assert = chai.assert
, testTransaction = require ('./test.transaction.js')
/* ------------------------------------------------------------------------ */
module.exports = async (exchange, code) => {
if (exchange.has.fetchTransactions) {
// log ('fetching transactions...')
let transactions = await exchange.fetchTransactions (code)
log ('fetched', transactions.length.toString ().green, 'transactions, asserting each...')
assert (transactions instanceof Array)
let now = Date.now ()
for (let i = 0; i < transactions.length; i++) {
let transaction = transactions[i]
testTransaction (exchange, transaction, code, now)
}
// log (asTable (transactions))
} else {
log ('fetching transactions not supported')
}
}