Remove serialization from domain

This commit is contained in:
Jon Staab
2026-06-18 12:03:48 -07:00
parent fe5c11b00f
commit 0a08057786
6 changed files with 69 additions and 116 deletions
+1 -10
View File
@@ -54,7 +54,7 @@ describe("MuteList", () => {
const undecrypted = await MuteList.parse(event)
// We never decrypted, so the original ciphertext must survive untouched.
const template = await undecrypted.getTemplate(signer)
const template = await undecrypted.toTemplate(signer)
expect(template.content).toBe(event.content)
})
@@ -74,15 +74,6 @@ describe("MuteList", () => {
expect(rumor.content).not.toBe("")
})
it("serializes to JSON", async () => {
const list = MuteList.make().addPublicly(a).addPrivately(b)
const json = JSON.parse(JSON.stringify(list))
expect(json.kind).toBe(MUTES)
expect(json.publicTags).toEqual([["p", a]])
expect(json.privateTags).toEqual([["p", b]])
})
it("throws on the wrong kind", async () => {
const event = {kind: FOLLOWS, tags: [], content: "", pubkey: a} as TrustedEvent
@@ -61,12 +61,6 @@ describe("Profile", () => {
expect(profile.display()).toBe(displayPubkey(pubkey))
})
it("serializes to JSON", () => {
const profile = Profile.make({name: "alice"})
expect(JSON.parse(JSON.stringify(profile))).toEqual({name: "alice"})
})
it("throws on the wrong kind", () => {
expect(() => Profile.parse(makeEvent({kind: NOTE}))).toThrow()
})