mirror of
https://github.com/Blah-IM/typescript-core.git
synced 2025-04-30 16:21:10 +00:00
fix: janky search & replace causes case error
This commit is contained in:
parent
25bab4374d
commit
465dfc7b3c
4 changed files with 14 additions and 14 deletions
|
@ -23,7 +23,7 @@ Deno.test("create identity", async () => {
|
|||
});
|
||||
|
||||
Deno.test("generate identity description", () => {
|
||||
identityDesc = identity.generateidentityDescription();
|
||||
identityDesc = identity.generateIdentityDescription();
|
||||
});
|
||||
|
||||
Deno.test("created identity act key signed correctly", async () => {
|
||||
|
@ -47,7 +47,7 @@ Deno.test("created identity profile signed correctly", async () => {
|
|||
});
|
||||
|
||||
Deno.test("parse identity description", async () => {
|
||||
identityFromFile = await BlahIdentity.fromidentityDescription(identityDesc);
|
||||
identityFromFile = await BlahIdentity.fromIdentityDescription(identityDesc);
|
||||
});
|
||||
|
||||
Deno.test("identity description profile sigs are properly verfied", async () => {
|
||||
|
@ -56,7 +56,7 @@ Deno.test("identity description profile sigs are properly verfied", async () =>
|
|||
profile: { ...identityDesc.profile, sig: "_ obviously not a valid sig _" },
|
||||
};
|
||||
const identityWithProfileInvalidProfileSig = await BlahIdentity
|
||||
.fromidentityDescription(
|
||||
.fromIdentityDescription(
|
||||
identityDescWithProfileInvalidProfileSig,
|
||||
);
|
||||
expect(identityWithProfileInvalidProfileSig.profileSigValid).toBe(false);
|
||||
|
@ -73,7 +73,7 @@ Deno.test("identity description act key sigs are properly verfied", async () =>
|
|||
],
|
||||
};
|
||||
const identityWithActKeyInvalidActKeySig = await BlahIdentity
|
||||
.fromidentityDescription(
|
||||
.fromIdentityDescription(
|
||||
identityDescWithActKeyInvalidActKeySig,
|
||||
);
|
||||
expect(identityWithActKeyInvalidActKeySig.actKeys[0].isSigValid).toBe(false);
|
||||
|
@ -82,7 +82,7 @@ Deno.test("identity description act key sigs are properly verfied", async () =>
|
|||
Deno.test("add a second act key", async () => {
|
||||
const actKeyPair2 = await BlahKeyPair.generate();
|
||||
await identity.addActKey(actKeyPair2, { comment: "test" });
|
||||
identityDesc = identity.generateidentityDescription();
|
||||
identityDesc = identity.generateIdentityDescription();
|
||||
|
||||
const record = await identity.idPublicKey.verifyPayload(
|
||||
identityDesc.act_keys[1],
|
||||
|
@ -96,7 +96,7 @@ Deno.test("add a second act key", async () => {
|
|||
|
||||
Deno.test("update first act key", async () => {
|
||||
await identity.updateActKey(actKeyPair.id, { comment: "test2" });
|
||||
identityDesc = identity.generateidentityDescription();
|
||||
identityDesc = identity.generateIdentityDescription();
|
||||
|
||||
const record = await identity.idPublicKey.verifyPayload(
|
||||
identityDesc.act_keys[0],
|
||||
|
@ -120,7 +120,7 @@ Deno.test("update profile", async () => {
|
|||
};
|
||||
|
||||
await identity.updateProfile(newProfile);
|
||||
identityDesc = identity.generateidentityDescription();
|
||||
identityDesc = identity.generateIdentityDescription();
|
||||
|
||||
expect(identityDesc.profile.signee.payload).toEqual(newProfile);
|
||||
});
|
||||
|
|
|
@ -44,7 +44,7 @@ export class BlahIdentity {
|
|||
return this.internalActKeys;
|
||||
}
|
||||
|
||||
static async fromidentityDescription(
|
||||
static async fromIdentityDescription(
|
||||
identityDesc: unknown,
|
||||
idKeyPair?: BlahKeyPair,
|
||||
actingKeyPair?: BlahKeyPair,
|
||||
|
@ -110,7 +110,7 @@ export class BlahIdentity {
|
|||
return new BlahIdentity(idKeyPair, [actKey], profileRecord, true);
|
||||
}
|
||||
|
||||
generateidentityDescription(): BlahIdentityDescription {
|
||||
generateIdentityDescription(): BlahIdentityDescription {
|
||||
return blahIdentityDescriptionSchema.parse(
|
||||
{
|
||||
id_key: this.idPublicKey.id,
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
} from "./identityDescription.ts";
|
||||
import { assertTypeMatchesZodSchema } from "../test/utils.ts";
|
||||
|
||||
Deno.test("type BlahidentityDescription is accurate", () => {
|
||||
Deno.test("type BlahIdentityDescription is accurate", () => {
|
||||
assertTypeMatchesZodSchema<BlahIdentityDescription>(
|
||||
blahIdentityDescriptionSchema,
|
||||
);
|
||||
|
|
|
@ -11,11 +11,11 @@ export { type BlahProfile, blahProfileSchema };
|
|||
|
||||
import {
|
||||
type BlahIdentityDescription,
|
||||
blahIdentityDescriptionSchema as internalBlahidentityDescriptionSchema,
|
||||
blahIdentityDescriptionSchema as internalBlahIdentityDescriptionSchema,
|
||||
} from "./identityDescription.ts";
|
||||
const blahidentityDescriptionSchema: z.ZodType<BlahIdentityDescription> =
|
||||
internalBlahidentityDescriptionSchema;
|
||||
export { type BlahIdentityDescription, blahidentityDescriptionSchema };
|
||||
const blahIdentityDescriptionSchema: z.ZodType<BlahIdentityDescription> =
|
||||
internalBlahIdentityDescriptionSchema;
|
||||
export { type BlahIdentityDescription, blahIdentityDescriptionSchema };
|
||||
|
||||
import {
|
||||
type BlahActKeyRecord,
|
||||
|
|
Loading…
Add table
Reference in a new issue