fixes
This commit is contained in:
parent
c19f48ef3f
commit
ed2de112a2
@ -1,7 +1,15 @@
|
|||||||
const baseConfig = require('./base.config')
|
const baseConfig = require('./base.config')
|
||||||
|
const { EXIT_CODES } = require('../src/utils/constants')
|
||||||
|
|
||||||
const id = `${baseConfig.id}-swap-tokens`
|
const id = `${baseConfig.id}-swap-tokens`
|
||||||
|
|
||||||
|
const workerRequired = baseConfig.id === 'erc-native'
|
||||||
|
|
||||||
|
if (!workerRequired) {
|
||||||
|
console.error(`Swap tokens worker not required for bridge mode ${process.env.ORACLE_BRIDGE_MODE}`)
|
||||||
|
process.exit(EXIT_CODES.WATCHER_NOT_REQUIRED)
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig.bridgeConfig,
|
...baseConfig.bridgeConfig,
|
||||||
...baseConfig.foreignConfig,
|
...baseConfig.foreignConfig,
|
||||||
|
@ -148,14 +148,14 @@ async function main({ sendToQueue, sendToWorker }) {
|
|||||||
logger.info(`Found ${events.length} ${config.event} events`)
|
logger.info(`Found ${events.length} ${config.event} events`)
|
||||||
|
|
||||||
if (events.length) {
|
if (events.length) {
|
||||||
|
if (sendToWorker) {
|
||||||
|
await sendToWorker({ blockNumber: toBlock.toString() })
|
||||||
|
}
|
||||||
|
|
||||||
const job = await processEvents(events, toBlock)
|
const job = await processEvents(events, toBlock)
|
||||||
logger.info('Transactions to send:', job.length)
|
logger.info('Transactions to send:', job.length)
|
||||||
|
|
||||||
if (job.length) {
|
if (job.length) {
|
||||||
if (sendToWorker) {
|
|
||||||
await sendToWorker({ blockNumber: toBlock.toString() })
|
|
||||||
}
|
|
||||||
|
|
||||||
await sendToQueue(job)
|
await sendToQueue(job)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user