Skip to content

Commit

Permalink
fix: Add context only for linkedDomains
Browse files Browse the repository at this point in the history
  • Loading branch information
DaevMithran committed Sep 10, 2024
1 parent 96f14e8 commit 0774252
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/did.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
SpecValidationResult,
VerificationMethods,
DIDDocumentWithMetadata,
ServiceType,
} from '../types.js';
import {
MsgCreateDidDoc,
Expand Down Expand Up @@ -547,7 +548,7 @@ export class DIDModule extends AbstractCheqdSDKModule {

const context = (function () {
if (
protobufDidDocument.service.length &&
protobufDidDocument.service.find((s) => s.serviceType === ServiceType.LinkedDomains) &&
!protobufDidDocument.context.includes(contexts.DIFDIDConfiguration)
)
protobufDidDocument.context.push(contexts.DIFDIDConfiguration);
Expand Down
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ export const ISignInputs = {
return object.some((x) => 'privateKeyHex' in x);
},
};

export enum ServiceType {
LinkedDomains = 'LinkedDomains',
}

0 comments on commit 0774252

Please sign in to comment.