forked from tornadocash/classic-ui
fix: update relayer schema
This commit is contained in:
parent
767541ef61
commit
280eab5fca
@ -106,7 +106,6 @@ export default {
|
||||
url: '',
|
||||
address: '',
|
||||
tornadoServiceFee: 0.0,
|
||||
miningServiceFee: 0.0,
|
||||
ethPrices: {
|
||||
torn: '1'
|
||||
}
|
||||
|
@ -144,7 +144,6 @@ const statusSchema = {
|
||||
required: ['dai', 'cdai', 'usdc', 'usdt', 'torn', 'wbtc']
|
||||
},
|
||||
tornadoServiceFee: { type: 'number', maximum: 20, minimum: 0 },
|
||||
miningServiceFee: { type: 'number', maximum: 20, minimum: 0 },
|
||||
latestBlock: { type: 'number' },
|
||||
version: { type: 'string' },
|
||||
health: {
|
||||
@ -157,16 +156,7 @@ const statusSchema = {
|
||||
},
|
||||
currentQueue: { type: 'number' }
|
||||
},
|
||||
required: [
|
||||
'rewardAccount',
|
||||
'instances',
|
||||
'netId',
|
||||
'ethPrices',
|
||||
'tornadoServiceFee',
|
||||
'miningServiceFee',
|
||||
'version',
|
||||
'health'
|
||||
]
|
||||
required: ['rewardAccount', 'instances', 'netId', 'ethPrices', 'tornadoServiceFee', 'version', 'health']
|
||||
}
|
||||
|
||||
export { statusSchema }
|
||||
|
@ -70,7 +70,6 @@ export const state = () => {
|
||||
name: '',
|
||||
stakeBalance: 0,
|
||||
tornadoServiceFee: 0.05,
|
||||
miningServiceFee: 0.05,
|
||||
address: null,
|
||||
ethPrices: {
|
||||
torn: '1'
|
||||
@ -271,7 +270,6 @@ export const actions = {
|
||||
ethPrices: response.data.ethPrices,
|
||||
address: response.data.rewardAccount,
|
||||
currentQueue: response.data.currentQueue,
|
||||
miningServiceFee: response.data.miningServiceFee,
|
||||
tornadoServiceFee: response.data.tornadoServiceFee
|
||||
}
|
||||
} catch (e) {
|
||||
@ -310,8 +308,7 @@ export const actions = {
|
||||
address,
|
||||
ethPrices,
|
||||
stakeBalance,
|
||||
tornadoServiceFee,
|
||||
miningServiceFee
|
||||
tornadoServiceFee
|
||||
} = pickWeightedRandomRelayer(statuses, netId)
|
||||
|
||||
console.log('Selected relayer', name, tornadoServiceFee)
|
||||
@ -321,8 +318,7 @@ export const actions = {
|
||||
ethPrices,
|
||||
url: realUrl,
|
||||
stakeBalance,
|
||||
tornadoServiceFee,
|
||||
miningServiceFee
|
||||
tornadoServiceFee
|
||||
})
|
||||
} catch {
|
||||
console.error('Method pickRandomRelayer has not picked relayer')
|
||||
@ -393,15 +389,10 @@ export const actions = {
|
||||
try {
|
||||
const relayerData = await dispatch('getRelayerData', { url, name })
|
||||
|
||||
const {
|
||||
error,
|
||||
isValid,
|
||||
realUrl,
|
||||
address,
|
||||
ethPrices,
|
||||
miningServiceFee,
|
||||
tornadoServiceFee
|
||||
} = await dispatch('askRelayerStatus', relayerData)
|
||||
const { error, isValid, realUrl, address, ethPrices, tornadoServiceFee } = await dispatch(
|
||||
'askRelayerStatus',
|
||||
relayerData
|
||||
)
|
||||
|
||||
if (!isValid) {
|
||||
return { error, isValid: false }
|
||||
@ -413,7 +404,6 @@ export const actions = {
|
||||
url: realUrl || '',
|
||||
address: address || '',
|
||||
tornadoServiceFee: tornadoServiceFee || 0.0,
|
||||
miningServiceFee: miningServiceFee || 0.0,
|
||||
ethPrices: ethPrices || { torn: '1' }
|
||||
}
|
||||
} catch (err) {
|
||||
|
Loading…
Reference in New Issue
Block a user