Skip to content

Commit 1bf84be

Browse files
Arthur-Kamauclaude
andcommitted
fix: server identity uses personal claim name instead of AquaFire Server
The SERVER_MNEMONIC wallet had pre-existing personal identity claims (name "kenn") which prevented createServerIdentity() from creating the proper "AquaFire Server" identity. The identity check now specifically looks for claim_context "Self issued server identity" so personal claims no longer block server identity creation or get linked into attestations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a9b28d1 commit 1bf84be

1 file changed

Lines changed: 8 additions & 28 deletions

File tree

api/src/utils/server_attest.ts

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export async function serverAttestation(identityClaimId: string, walletAddress:
7575
const genHash = getGenesisHash(aquaTree)
7676
if (genHash) {
7777
const genRevision = aquaTree.revisions[genHash]
78-
if (genRevision && genRevision["forms_type"] === "simple_claim") {
78+
if (genRevision && genRevision["forms_type"] === "simple_claim" && genRevision["forms_claim_context"] === "Self issued server identity") {
7979
serverIdentityAquaTree = aquaTree
8080
serverIdentityFileObjects = fileObjects
8181
break
@@ -259,36 +259,16 @@ export async function createServerIdentity() {
259259

260260
const res = await prisma.revision.findFirst({
261261
where: {
262-
AND: {
263-
previous: {
264-
equals: ""
265-
},
266-
revision_type: {
267-
equals: "form"
268-
},
269-
pubkey_hash: {
270-
startsWith: walletAddress
271-
}
272-
},
273-
},
274-
select: {
275-
AquaForms: {
276-
where: {
277-
AND: {
278-
key: {
279-
equals: "forms_type"
280-
},
281-
value: {
282-
equals: "simple_claim"
283-
}
284-
}
285-
}
286-
}
262+
previous: "",
263+
revision_type: "form",
264+
pubkey_hash: { startsWith: walletAddress },
265+
AND: [
266+
{ AquaForms: { some: { key: "forms_type", value: { equals: "simple_claim" } } } },
267+
{ AquaForms: { some: { key: "forms_claim_context", value: { equals: "Self issued server identity" } } } }
268+
]
287269
}
288270
})
289271

290-
console.log("Res: ", res)
291-
292272
if (res) {
293273
return
294274
}

0 commit comments

Comments
 (0)