Remove deprecated anchoring functionality

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
Rūdolfs Ošiņš
2022-10-10 17:37:02 +02:00
parent aae40b0b32
commit 4bac3fcfdc
7 changed files with 1 additions and 64 deletions
-12
View File
@@ -310,18 +310,6 @@
<div class="desktop" />
{/if}
{/await}
{:else}
<!-- Project anchors -->
{#if profile.anchorsAccount}
<div class="label">Anchors</div>
<div class="desktop">
<Address {config} address={profile.anchorsAccount} />
</div>
<div class="mobile">
<Address compact {config} address={profile.anchorsAccount} />
</div>
<div class="desktop" />
{/if}
{/if}
<!-- Org Name/Profile -->
<div class="label">Profile</div>
-10
View File
@@ -149,16 +149,6 @@
value: r.profile.seed?.id ?? "",
editable: true,
},
{
name: "anchors",
label: "Anchors",
validate: "URN",
placeholder: "URN, eg. eip155:1:0x4a9cf21…",
description:
"URN under which associated project anchors can be found.",
value: r.profile.anchorsAccount ?? "",
editable: true,
},
];
state = { status: Status.Found, registration: r, owner };
} else {
-18
View File
@@ -22,7 +22,6 @@ export interface EnsProfile {
owner?: string;
address?: string;
seed?: Seed | InvalidSeed;
anchorsAccount?: string;
url?: string;
avatar?: string;
twitter?: string;
@@ -88,7 +87,6 @@ export async function getRegistration(
getText(resolver, "eth.radicle.seed.host"),
getText(resolver, "eth.radicle.seed.git"),
getText(resolver, "eth.radicle.seed.api"),
getText(resolver, "eth.radicle.anchors"),
getText(resolver, "com.twitter"),
getText(resolver, "com.github"),
]);
@@ -102,7 +100,6 @@ export async function getRegistration(
seedHost,
seedGit,
seedApi,
anchorsAccount,
twitter,
github,
] = meta.filter(isFulfilled).map(r => (r.value ? r.value : undefined));
@@ -112,7 +109,6 @@ export async function getRegistration(
id,
url,
avatar,
anchorsAccount,
address,
twitter,
github,
@@ -153,20 +149,6 @@ export async function getAvatar(
return getText(resolver, "avatar");
}
export async function getAnchorsAccount(
name: string,
config: Config,
resolver?: EnsResolver | null,
): Promise<string | null> {
name = name.toLowerCase();
resolver = resolver ?? (await getResolver(name, config));
if (!resolver) {
return null;
}
return getText(resolver, "eth.radicle.anchors");
}
export async function getSeed(
name: string,
config: Config,
-1
View File
@@ -46,7 +46,6 @@ export async function setRecords(
case "seed.host":
case "seed.git":
case "seed.api":
case "anchors":
calls.push(
iface.encodeFunctionData("setText", [
node,
-2
View File
@@ -185,8 +185,6 @@
"reverseRegistrar": ["function setName(string) returns (bytes32)"],
"org": [
"function owner() view returns (address)",
"function anchors(bytes32) view returns (uint32, bytes)",
"function anchor(bytes32, uint32, bytes)",
"function setOwner(address)",
"function setName(string, address) returns (bytes32)"
],
-17
View File
@@ -97,23 +97,6 @@ export class Profile {
return this.profile?.ens?.seed ?? null;
}
get anchorsAccount(): string | undefined {
const addr = this.profile?.ens?.anchorsAccount;
if (addr) {
const [namespace, reference, address] = addr.split(":");
const id = { chainId: { namespace, reference }, address };
// Ethereum address.
if (typeof id.chainId === "object" && id.chainId.namespace === "eip155") {
return id.address;
}
if (typeof id.chainId === "string" && /^eip155/.test(id.chainId)) {
return id.address;
}
}
}
// Get the name, and if not available, the address.
get nameOrAddress(): string {
return this.name ?? this.address;
+1 -4
View File
@@ -16,7 +16,6 @@ import { getAddress, getResolver } from "@app/base/registrations/registrar";
import {
getAvatar,
getSeed,
getAnchorsAccount,
getRegistration,
} from "@app/base/registrations/registrar";
import { ProfileType } from "@app/profile";
@@ -493,13 +492,12 @@ export async function resolveEnsProfile(
if (profileType === ProfileType.Project) {
promises.push(getSeed(name, config, resolver));
promises.push(getAnchorsAccount(name, config, resolver));
} else if (profileType === ProfileType.Minimal) {
promises.push(Promise.resolve(null));
}
const project = await Promise.allSettled(promises);
const [avatar, address, seed, anchorsAccount] =
const [avatar, address, seed] =
// Just checking for r.value equal null and casting to undefined,
// since resolver functions return null.
project.filter(isFulfilled).map(r => (r.value ? r.value : null));
@@ -509,7 +507,6 @@ export async function resolveEnsProfile(
avatar,
address,
seed,
anchorsAccount,
};
}
}