Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Remove deprecated anchoring functionality
Rūdolfs Ošiņš committed 3 years ago
commit 4bac3fcfdce5ec79ad4effe306cd07e3ad908317
parent aae40b0b3272600f209856e867c7c91bcccafb18
7 files changed +1 -64
modified src/Profile.svelte
@@ -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>
modified src/base/registrations/View.svelte
@@ -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 {
modified src/base/registrations/registrar.ts
@@ -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,
modified src/base/registrations/resolver.ts
@@ -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,
modified src/config.json
@@ -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)"
    ],
modified src/profile.ts
@@ -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;
modified src/utils.ts
@@ -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,
      };
    }
  }