Skip to content

Commit

Permalink
fix: bbs+ fixes and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Mar 10, 2023
1 parent efcbf2c commit fc228a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/vc-handler-ld-local/src/ld-suite-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export class LdSuiteLoader {
const veramoKeyType = obj.getSupportedVeramoKeyType()
const verificationType = obj.getSupportedVerificationType()
if (this.signatureMap[veramoKeyType]) {
throw Error(`Cannot register 2 suites for the same type ${veramoKeyType}`)
console.log(`Registered another signature suite ${obj} for key type: ${veramoKeyType} overriding the old one. Previous one: ${this.signatureMap[veramoKeyType]}`)
// throw Error(`Cannot register 2 suites for the same type ${veramoKeyType}`)
}
this.signatureMap[veramoKeyType] = obj
if (verificationType !== veramoKeyType) {
Expand All @@ -34,10 +35,10 @@ export class LdSuiteLoader {
}

getAllSignatureSuites(): SphereonLdSignature[] {
return Object.values(this.signatureMap)
return [...new Set(Object.values(this.signatureMap))]
}

getAllSignatureSuiteTypes(): string[] {
return Object.values(this.signatureMap).map((x) => x.getSupportedVerificationType())
return [...new Set(Object.values(this.signatureMap).map((x) => x.getSupportedVerificationType()))]
}
}

0 comments on commit fc228a2

Please sign in to comment.