From ab0bf67c2c22fc3329f24062e2006f43f8f07d4d Mon Sep 17 00:00:00 2001 From: MarcoMandar Date: Wed, 28 Aug 2024 03:29:45 +0300 Subject: [PATCH 1/4] add distributionDeployer contract Signed-off-by: MarcoMandar --- components/DashboardFooter.vue | 5 +++++ nuxt.config.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/components/DashboardFooter.vue b/components/DashboardFooter.vue index b15ad95..89358f1 100755 --- a/components/DashboardFooter.vue +++ b/components/DashboardFooter.vue @@ -38,6 +38,11 @@ const contractLinks = [ address: config.public.registratorContract, type: 'evm', }, + { + name: 'Distribution Deployer', + address: config.public.distributionDeployer, + type: 'viewblock', + }, ]; const getLink = (address: string, type: string) => { diff --git a/nuxt.config.ts b/nuxt.config.ts index c157b5f..60868a1 100755 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -60,6 +60,7 @@ export default defineNuxtConfig({ distributionContract: 'VIOG7nxszQveNwhAwQAn-e9wfBmDDxW1_Q3sIaWFPRQ', metricsDeployer: 'x0cuVieEDTFjtxI5m5i22u2IMr-WpBiTS-Vir8U3dbw', registratorContract: '0xc148c615b87e63Dcc90e55d53B44172503cCe889', + distributionDeployer: 'G5tXjZS4SaMJNwOENZYgymvc6Zxp2Wws4Qf8wB0b', warpGateway: 'https://gw.warp.cc/gateway/v2', githubNewIssueUrl: 'https://github.com/ATOR-Development/ator-dashboard/issues/new', From 398544897764225b823ebe9cd2b94462376e58e3 Mon Sep 17 00:00:00 2001 From: MarcoMandar Date: Sat, 31 Aug 2024 04:40:11 +0300 Subject: [PATCH 2/4] remove familyVerified from claim function Signed-off-by: MarcoMandar --- composables/relay-registry/relay-registry.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/composables/relay-registry/relay-registry.ts b/composables/relay-registry/relay-registry.ts index e9aae6b..cb68b11 100755 --- a/composables/relay-registry/relay-registry.ts +++ b/composables/relay-registry/relay-registry.ts @@ -50,18 +50,6 @@ export class RelayRegistry { return null; } - if (!(await auth.familyVerified(fingerprint))) { - this.logger.error('Family not verified.'); - toast.add({ - id: 'family-not-verified', - icon: 'i-heroicons-information-circle', - title: 'Error', - description: 'Family not verified.', - color: 'amber', - }); - return null; - } - const warpSigner = await useWarpSigner(); if (!warpSigner) { this.logger.error('claim() relay registry warpSigner is null'); From 68a6a39f839f2bd60545aaefc68ed41ca9cb68d9 Mon Sep 17 00:00:00 2001 From: MarcoMandar Date: Sat, 31 Aug 2024 04:56:36 +0300 Subject: [PATCH 3/4] update Signed-off-by: MarcoMandar --- .../DataTableMyRelaysMobile.vue | 27 +++++++------------ constants/relay.ts | 5 ++++ 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/components/DataTableMyRelays/DataTableMyRelaysMobile.vue b/components/DataTableMyRelays/DataTableMyRelaysMobile.vue index 4c924d7..960b09f 100755 --- a/components/DataTableMyRelays/DataTableMyRelaysMobile.vue +++ b/components/DataTableMyRelays/DataTableMyRelaysMobile.vue @@ -457,16 +457,17 @@ const handleUnlockClick = async (fingerprint: string) => {
Relay Fingerprint
+
-
Consensus Weight
+
Observed Bandwidth
- {{ userStore?.relaysMeta?.[row.fingerprint]?.consensus_weight }} + {{ getObservedBandwidth(row.fingerprint) }} {
-
Observed Bandwidth
+
Previous Distribution
- - {{ getObservedBandwidth(row.fingerprint) }} - - - - Unable to fetch + + {{ + facilitatorStore?.distributionPerRelay?.[row.fingerprint] || '-' + }}
diff --git a/constants/relay.ts b/constants/relay.ts index b4b0c56..004abbf 100755 --- a/constants/relay.ts +++ b/constants/relay.ts @@ -20,10 +20,15 @@ const defaultColumns: { key: 'observedBandwidth', label: 'Observed Bandwith', }, + // { + // key: 'consensusWeight', + // label: 'Consensus Weight', + // }, { key: 'previousDistribution', label: 'Previous Distribution', }, + { key: 'lockStatus', label: 'Lock Status', From 17243bc9eec4d70b918f1cd4bc9472b8e9717c90 Mon Sep 17 00:00:00 2001 From: SuchJitter Date: Sun, 1 Sep 2024 15:40:11 +0200 Subject: [PATCH 4/4] verified hardware fixed --- composables/relayCache.ts | 1 + nuxt.config.ts | 2 +- stores/useUserStore.ts | 5 ++++- utils/warp.read.ts | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/composables/relayCache.ts b/composables/relayCache.ts index 8353707..ec55ab1 100755 --- a/composables/relayCache.ts +++ b/composables/relayCache.ts @@ -3,6 +3,7 @@ import Logger from '@/utils/logger'; interface RelayData { timestamp: number; data: { + verifiedHardware: { [key: string]: Number }; verified: { address: string; fingerprint: string; diff --git a/nuxt.config.ts b/nuxt.config.ts index 60868a1..4c37af7 100755 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -53,7 +53,7 @@ export default defineNuxtConfig({ runtimeConfig: { public: { walletConnectProjectId: 'f5e29d36441ccd0e2f5e3473d5a2021b', - relayRegistryAddress: 'XGkNTis1b5z0VzSLNyFwfjtZx-MypfqQ65JqLo9Wwww', + relayRegistryAddress: 'lCfdQe7AkQPpT5516nyEam4sEBsyPmjx_8uN9OxrzQA', facilitatorContract: '0x45F6b9757B36697EFd37e98883894e98025E58a6', sepoliaAtorTokenContract: '0x3F7D7e1161B4CbC172517a2957A13814f4a657A2', tokenContractMain: '0x0f7b3f5a8fed821c5eb60049538a548db2d479ce', diff --git a/stores/useUserStore.ts b/stores/useUserStore.ts index 2e64c43..6401754 100755 --- a/stores/useUserStore.ts +++ b/stores/useUserStore.ts @@ -252,8 +252,11 @@ export const useUserStore = defineStore('user', { await this.createRelayCache(); this.registrationCredits = cachedData.registrationCredits; } + // Check if the fingerprint has registration credits - const hasCredit = this.registrationCredits.includes(fingerprint); + const hasCredit = + this.registrationCredits.includes(fingerprint) || + cachedData.verifiedHardware[fingerprint] !== undefined; // Cache the result this.registrationCreditsCache[fingerprint] = hasCredit; diff --git a/utils/warp.read.ts b/utils/warp.read.ts index 6321ded..b09a8f4 100755 --- a/utils/warp.read.ts +++ b/utils/warp.read.ts @@ -9,6 +9,7 @@ type RelayData = { timestamp: number; data: { state: any; + verifiedHardware: { [key: string]: Number }; verified: [ { address: string; @@ -235,6 +236,7 @@ export const getAllRelays = async ( timestamp: Date.now(), data: { state: result.cachedValue.state, + verifiedHardware: result.cachedValue.state.verifiedHardware, verified: verifiedRelays as [ { address: string;