From 280eab5fcaf066f20679a0860f785d1612e26f2a Mon Sep 17 00:00:00 2001 From: Danil Kovtonyuk Date: Tue, 2 Aug 2022 14:47:28 +1000 Subject: [PATCH] fix: update relayer schema --- components/settings/tabs/RelayerTab.vue | 1 - services/schema/relayer/default.js | 12 +----------- store/relayer.js | 22 ++++++---------------- 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/components/settings/tabs/RelayerTab.vue b/components/settings/tabs/RelayerTab.vue index 0c16124..06c1444 100644 --- a/components/settings/tabs/RelayerTab.vue +++ b/components/settings/tabs/RelayerTab.vue @@ -106,7 +106,6 @@ export default { url: '', address: '', tornadoServiceFee: 0.0, - miningServiceFee: 0.0, ethPrices: { torn: '1' } diff --git a/services/schema/relayer/default.js b/services/schema/relayer/default.js index 0372ba0..43934b5 100644 --- a/services/schema/relayer/default.js +++ b/services/schema/relayer/default.js @@ -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 } diff --git a/store/relayer.js b/store/relayer.js index a4919c4..0b7c725 100644 --- a/store/relayer.js +++ b/store/relayer.js @@ -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) {