Skip to content

Commit 1ac3c1d

Browse files
authored
fix(cheqd): Allow overriding contexts on update operation (#2314)
Signed-off-by: DaevMithran <[email protected]>
1 parent 1810764 commit 1ac3c1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/cheqd/src/dids/CheqdDidRegistrar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ export class CheqdDidRegistrar implements DidRegistrar {
462462
if (response.code !== 0) {
463463
throw new Error(`${response.rawLog}`)
464464
}
465-
// Collect all contexts from the didDic into a set
466-
const contextSet = this.collectAllContexts(didDocument)
465+
// Collect all contexts, override existing context if provided
466+
const contextSet = this.collectAllContexts(options.didDocument || didDocument)
467467
// Add Cheqd default context to the did document
468468
didDocument.context = Array.from(contextSet.add(DID_V1_CONTEXT_URL))
469469
// Save the did so we know we created it and can issue with it

0 commit comments

Comments
 (0)