fix: check for wallet tx batching support
This commit is contained in:
parent
73c0d09198
commit
8289c55acf
10 changed files with 77 additions and 26 deletions
|
|
@ -3,8 +3,10 @@ const _ = require('lodash/fp')
|
|||
const BN = require('../../../bn')
|
||||
const E = require('../../../error')
|
||||
const { utils: coinUtils } = require('lamassu-coins')
|
||||
const consoleLogLevel = require('console-log-level')
|
||||
|
||||
const NAME = 'FakeWallet'
|
||||
const BATCHABLE_COINS = ['BTC']
|
||||
|
||||
const SECONDS = 1000
|
||||
const PUBLISH_TIME = 3 * SECONDS
|
||||
|
|
@ -59,9 +61,6 @@ function sendCoins (account, tx, settings, operatorId) {
|
|||
})
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
function newAddress (account, info, tx, settings, operatorId) {
|
||||
=======
|
||||
function sendCoinsBatch (account, txs, cryptoCode) {
|
||||
sendCount = sendCount + txs.length
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
@ -81,7 +80,6 @@ function sendCoinsBatch (account, txs, cryptoCode) {
|
|||
}
|
||||
|
||||
function newAddress () {
|
||||
>>>>>>> feat: add transaction batching module
|
||||
t0 = Date.now()
|
||||
return Promise.resolve('<Fake address, don\'t send>')
|
||||
}
|
||||
|
|
@ -114,6 +112,10 @@ function getStatus (account, tx, requested, settings, operatorId) {
|
|||
return Promise.resolve({status: 'confirmed'})
|
||||
}
|
||||
|
||||
function supportsBatching (account, cryptoCode) {
|
||||
return Promise.resolve(_.includes(cryptoCode, BATCHABLE_COINS))
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
NAME,
|
||||
balance,
|
||||
|
|
@ -121,5 +123,6 @@ module.exports = {
|
|||
sendCoins,
|
||||
newAddress,
|
||||
getStatus,
|
||||
newFunding
|
||||
newFunding,
|
||||
supportsBatching
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue