fix: update relayer schema

This commit is contained in:
Danil Kovtonyuk 2022-08-02 14:47:28 +10:00
parent 767541ef61
commit 280eab5fca
No known key found for this signature in database
GPG Key ID: E72A919BF08C3746
3 changed files with 7 additions and 28 deletions

View File

@ -106,7 +106,6 @@ export default {
url: '', url: '',
address: '', address: '',
tornadoServiceFee: 0.0, tornadoServiceFee: 0.0,
miningServiceFee: 0.0,
ethPrices: { ethPrices: {
torn: '1' torn: '1'
} }

View File

@ -144,7 +144,6 @@ const statusSchema = {
required: ['dai', 'cdai', 'usdc', 'usdt', 'torn', 'wbtc'] required: ['dai', 'cdai', 'usdc', 'usdt', 'torn', 'wbtc']
}, },
tornadoServiceFee: { type: 'number', maximum: 20, minimum: 0 }, tornadoServiceFee: { type: 'number', maximum: 20, minimum: 0 },
miningServiceFee: { type: 'number', maximum: 20, minimum: 0 },
latestBlock: { type: 'number' }, latestBlock: { type: 'number' },
version: { type: 'string' }, version: { type: 'string' },
health: { health: {
@ -157,16 +156,7 @@ const statusSchema = {
}, },
currentQueue: { type: 'number' } currentQueue: { type: 'number' }
}, },
required: [ required: ['rewardAccount', 'instances', 'netId', 'ethPrices', 'tornadoServiceFee', 'version', 'health']
'rewardAccount',
'instances',
'netId',
'ethPrices',
'tornadoServiceFee',
'miningServiceFee',
'version',
'health'
]
} }
export { statusSchema } export { statusSchema }

View File

@ -70,7 +70,6 @@ export const state = () => {
name: '', name: '',
stakeBalance: 0, stakeBalance: 0,
tornadoServiceFee: 0.05, tornadoServiceFee: 0.05,
miningServiceFee: 0.05,
address: null, address: null,
ethPrices: { ethPrices: {
torn: '1' torn: '1'
@ -271,7 +270,6 @@ export const actions = {
ethPrices: response.data.ethPrices, ethPrices: response.data.ethPrices,
address: response.data.rewardAccount, address: response.data.rewardAccount,
currentQueue: response.data.currentQueue, currentQueue: response.data.currentQueue,
miningServiceFee: response.data.miningServiceFee,
tornadoServiceFee: response.data.tornadoServiceFee tornadoServiceFee: response.data.tornadoServiceFee
} }
} catch (e) { } catch (e) {
@ -310,8 +308,7 @@ export const actions = {
address, address,
ethPrices, ethPrices,
stakeBalance, stakeBalance,
tornadoServiceFee, tornadoServiceFee
miningServiceFee
} = pickWeightedRandomRelayer(statuses, netId) } = pickWeightedRandomRelayer(statuses, netId)
console.log('Selected relayer', name, tornadoServiceFee) console.log('Selected relayer', name, tornadoServiceFee)
@ -321,8 +318,7 @@ export const actions = {
ethPrices, ethPrices,
url: realUrl, url: realUrl,
stakeBalance, stakeBalance,
tornadoServiceFee, tornadoServiceFee
miningServiceFee
}) })
} catch { } catch {
console.error('Method pickRandomRelayer has not picked relayer') console.error('Method pickRandomRelayer has not picked relayer')
@ -393,15 +389,10 @@ export const actions = {
try { try {
const relayerData = await dispatch('getRelayerData', { url, name }) const relayerData = await dispatch('getRelayerData', { url, name })
const { const { error, isValid, realUrl, address, ethPrices, tornadoServiceFee } = await dispatch(
error, 'askRelayerStatus',
isValid, relayerData
realUrl, )
address,
ethPrices,
miningServiceFee,
tornadoServiceFee
} = await dispatch('askRelayerStatus', relayerData)
if (!isValid) { if (!isValid) {
return { error, isValid: false } return { error, isValid: false }
@ -413,7 +404,6 @@ export const actions = {
url: realUrl || '', url: realUrl || '',
address: address || '', address: address || '',
tornadoServiceFee: tornadoServiceFee || 0.0, tornadoServiceFee: tornadoServiceFee || 0.0,
miningServiceFee: miningServiceFee || 0.0,
ethPrices: ethPrices || { torn: '1' } ethPrices: ethPrices || { torn: '1' }
} }
} catch (err) { } catch (err) {