2019-05-06 14:12:53 +03:00
|
|
|
const baseConfig = require('./base.config')
|
2019-10-29 17:55:47 +03:00
|
|
|
const { ERC_TYPES } = require('../../commons')
|
2019-05-06 14:12:53 +03:00
|
|
|
|
|
|
|
const initialChecksJson = process.argv[3]
|
|
|
|
|
|
|
|
if (!initialChecksJson) {
|
|
|
|
throw new Error('initial check parameter was not provided.')
|
|
|
|
}
|
|
|
|
|
|
|
|
let initialChecks
|
|
|
|
try {
|
|
|
|
initialChecks = JSON.parse(initialChecksJson)
|
|
|
|
} catch (e) {
|
|
|
|
throw new Error('Error on decoding values from initial checks.')
|
|
|
|
}
|
|
|
|
|
|
|
|
if (baseConfig.id === 'erc-erc' && initialChecks.foreignERC === ERC_TYPES.ERC677) {
|
|
|
|
baseConfig.id = 'erc677-erc677'
|
|
|
|
}
|
|
|
|
|
|
|
|
const id = `${baseConfig.id}-affirmation-request`
|
|
|
|
|
2019-10-29 17:55:47 +03:00
|
|
|
module.exports = {
|
|
|
|
...baseConfig.bridgeConfig,
|
|
|
|
...baseConfig.foreignConfig,
|
|
|
|
event: 'UserRequestForAffirmation',
|
|
|
|
queue: 'home',
|
|
|
|
name: `watcher-${id}`,
|
|
|
|
id
|
|
|
|
}
|