Skip to content

Commit

Permalink
Merge pull request #70 from ATOR-Development/leggo/phase-1/dev
Browse files Browse the repository at this point in the history
add distributionDeployer contract
  • Loading branch information
SuchJitter committed Sep 1, 2024
2 parents 43888b4 + 17243bc commit fe1596d
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 32 deletions.
5 changes: 5 additions & 0 deletions components/DashboardFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
27 changes: 9 additions & 18 deletions components/DataTableMyRelays/DataTableMyRelaysMobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -457,16 +457,17 @@ const handleUnlockClick = async (fingerprint: string) => {
<div class="font-semibold">Relay Fingerprint</div>
<FingerprintDisplay :fingerprint="row.fingerprint" />
</div>
<div class="flex justify-between items-center mt-2">
<div class="font-semibold">Consensus Weight</div>
<div class="font-semibold">Observed Bandwidth</div>
<div>
<span
v-if="
userStore?.relaysMeta?.[row.fingerprint]?.consensus_weight !==
userStore?.relaysMeta?.[row.fingerprint]?.observed_bandwidth !==
undefined
"
>
{{ userStore?.relaysMeta?.[row.fingerprint]?.consensus_weight }}
{{ getObservedBandwidth(row.fingerprint) }}
</span>
<span v-else class="text-sm flex items-center gap-2">
<Icon
Expand All @@ -478,22 +479,12 @@ const handleUnlockClick = async (fingerprint: string) => {
</div>
</div>
<div class="flex justify-between items-center mt-2">
<div class="font-semibold">Observed Bandwidth</div>
<div class="font-semibold">Previous Distribution</div>
<div>
<span
v-if="
userStore?.relaysMeta?.[row.fingerprint]?.observed_bandwidth !==
undefined
"
>
{{ getObservedBandwidth(row.fingerprint) }}
</span>
<span v-else class="text-sm flex items-center gap-2">
<Icon
name="heroicons:exclamation-circle"
class="h-4 w-4 text-red-500"
/>
Unable to fetch
<span>
{{
facilitatorStore?.distributionPerRelay?.[row.fingerprint] || '-'
}}
</span>
</div>
</div>
Expand Down
12 changes: 0 additions & 12 deletions composables/relay-registry/relay-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions composables/relayCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Logger from '@/utils/logger';
interface RelayData {
timestamp: number;
data: {
verifiedHardware: { [key: string]: Number };
verified: {
address: string;
fingerprint: string;
Expand Down
5 changes: 5 additions & 0 deletions constants/relay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ export default defineNuxtConfig({
runtimeConfig: {
public: {
walletConnectProjectId: 'f5e29d36441ccd0e2f5e3473d5a2021b',
relayRegistryAddress: 'XGkNTis1b5z0VzSLNyFwfjtZx-MypfqQ65JqLo9Wwww',
relayRegistryAddress: 'lCfdQe7AkQPpT5516nyEam4sEBsyPmjx_8uN9OxrzQA',
facilitatorContract: '0x45F6b9757B36697EFd37e98883894e98025E58a6',
sepoliaAtorTokenContract: '0x3F7D7e1161B4CbC172517a2957A13814f4a657A2',
tokenContractMain: '0x0f7b3f5a8fed821c5eb60049538a548db2d479ce',
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',
Expand Down
5 changes: 4 additions & 1 deletion stores/useUserStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions utils/warp.read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type RelayData = {
timestamp: number;
data: {
state: any;
verifiedHardware: { [key: string]: Number };
verified: [
{
address: string;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fe1596d

Please sign in to comment.