From 555a1584814112cd44df8ef45a2eb7076210a5dd Mon Sep 17 00:00:00 2001 From: Tasos Derisiotis <50984242+Eengineer1@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:49:40 +0200 Subject: [PATCH] fix: Removed redundant auth sigs + switch to optional per case --- src/agent/ICheqd.ts | 4 ++-- src/dkg-threshold/lit-protocol/v6.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/agent/ICheqd.ts b/src/agent/ICheqd.ts index 635d0ac..529ca37 100644 --- a/src/agent/ICheqd.ts +++ b/src/agent/ICheqd.ts @@ -6650,7 +6650,7 @@ export class Cheqd implements IAgentPlugin { } // validate dkgOptions - if (!options?.topArgs?.dkgOptions || !options.topArgs?.dkgOptions?.capacityDelegationAuthSignature) { + if (!options?.topArgs?.dkgOptions) { throw new Error('[did-provider-cheqd]: dkgOptions is required'); } @@ -6827,7 +6827,7 @@ export class Cheqd implements IAgentPlugin { } // validate dkgOptions - if (!options?.topArgs?.dkgOptions || !options.topArgs?.dkgOptions?.capacityDelegationAuthSignature) { + if (!options?.topArgs?.dkgOptions) { throw new Error('[did-provider-cheqd]: dkgOptions is required'); } diff --git a/src/dkg-threshold/lit-protocol/v6.ts b/src/dkg-threshold/lit-protocol/v6.ts index 65870dd..0d49237 100644 --- a/src/dkg-threshold/lit-protocol/v6.ts +++ b/src/dkg-threshold/lit-protocol/v6.ts @@ -168,7 +168,7 @@ export class LitProtocol { encryptedString: string, stringHash: string, unifiedAccessControlConditions: NonNullable, - capacityDelegationAuthSig: GenericAuthSig + capacityDelegationAuthSig?: GenericAuthSig ): Promise { // generate session signatures const sessionSigs = await this.client.getSessionSigs({ @@ -179,7 +179,7 @@ export class LitProtocol { ability: LitAbility.AccessControlConditionDecryption, }, ], - capabilityAuthSigs: [capacityDelegationAuthSig], + capabilityAuthSigs: capacityDelegationAuthSig ? [capacityDelegationAuthSig] : undefined, authNeededCallback: async ({}) => { // generate auth signature const authSig = await LitProtocol.generateAuthSignature(this.cosmosAuthWallet);