mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-06-05 18:21:28 +02:00
chore: simplify and fix tests for production readiness
Removes redundant test file and updates comments for accuracy. Changes: - Remove src/lib/nip05.test.ts (tested nprofile decoding not used in implementation) - Update comments in grimoire-members.ts: - Change "@grimoire.pro" references to "@grimoire.rocks" - Remove outdated "verification badges" mentions - Clarify that members get "gradient styling" not badges The member system is now cleaner and production-ready with: - Hardcoded member pubkeys in grimoire-members.ts - NIP-05 verification served via public/.well-known/nostr.json - Gradient styling applied to member usernames via UserName component - Proper test coverage via grimoire-members.test.ts
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Grimoire Member System
|
||||
*
|
||||
* Defines special usernames for Grimoire project members with custom NIP-05 style identifiers.
|
||||
* Members get special visual styling and verification badges.
|
||||
* Members get special gradient styling to distinguish them visually.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -13,13 +13,13 @@ export interface GrimoireMember {
|
||||
username: string;
|
||||
/** Hex pubkey */
|
||||
pubkey: string;
|
||||
/** NIP-05 style identifier (e.g., "_@grimoire.pro") */
|
||||
/** NIP-05 style identifier (e.g., "_@grimoire.rocks") */
|
||||
nip05: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Official Grimoire project members
|
||||
* These users get special username styling and verification badges
|
||||
* These users get special gradient styling applied to their usernames
|
||||
*/
|
||||
export const GRIMOIRE_MEMBERS: readonly GrimoireMember[] = [
|
||||
{
|
||||
@@ -68,7 +68,7 @@ export function getGrimoireMember(pubkey: string): GrimoireMember | undefined {
|
||||
|
||||
/**
|
||||
* Get Grimoire member info by NIP-05 identifier
|
||||
* @param nip05 - NIP-05 identifier (e.g., "_@grimoire.pro")
|
||||
* @param nip05 - NIP-05 identifier (e.g., "_@grimoire.rocks")
|
||||
* @returns Member info or undefined
|
||||
*/
|
||||
export function getGrimoireMemberByNip05(
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { nip19 } from "nostr-tools";
|
||||
|
||||
describe("NIP-19 Decoding for Grimoire Members", () => {
|
||||
it("should decode nprofile for _ username", () => {
|
||||
const nprofile =
|
||||
"nprofile1qyg8wumn8ghj7mn0wd68ytnddakj7qg4waehxw309aex2mrp0yhxgctdw4eju6t09uq3vamnwvaz7tmhda6zumn0wd68ytnsv9e8g7f0qyfhwumn8ghj7am0wsh82arcduhx7mn99uq35amnwvaz7tms09exzmtfvshxv6tpw34xze3wvdhk6tcpzamhxue69uhhyetvv9ujuurjd9kkzmpwdejhgtcppemhxue69uhkummn9ekx7mp0qqsv37cd82nc3wdvunmvhykajlfl9ykmyk6un7fyvthkceyjvy5lhtcpnnnuw";
|
||||
const decoded = nip19.decode(nprofile);
|
||||
|
||||
expect(decoded.type).toBe("nprofile");
|
||||
if (decoded.type === "nprofile") {
|
||||
expect(decoded.data.pubkey).toBe(
|
||||
"c8fb0d3aa788b9ace4f6cb92dd97d3f292db25b5c9f92462ef6c64926129fbaf",
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it("should decode nprofile for verbiricha username", () => {
|
||||
const nprofile =
|
||||
"nprofile1qy28wumn8ghj7mrfva58gmnfdenjuun9vshszxnhwden5te0wpuhyctdd9jzuenfv96x5ctx9e3k7mf0qydhwumn8ghj7argv4nx7un9wd6zumn0wd68yvfwvdhk6tcpz9mhxue69uhkummnw3ezuamfdejj7qpq07jk7htfv243u0x5ynn43scq9wrxtaasmrwwa8lfu2ydwag6cx2qsan62z";
|
||||
const decoded = nip19.decode(nprofile);
|
||||
|
||||
expect(decoded.type).toBe("nprofile");
|
||||
if (decoded.type === "nprofile") {
|
||||
expect(decoded.data.pubkey).toBe(
|
||||
"7fa56f5d6962ab1e3cd424e758c3002b8665f7b0d8dcee9fe9e288d7751ac194",
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user