Skip to content

Commit

Permalink
chore: change namespace identifier to did to be less confusing
Browse files Browse the repository at this point in the history
Signed-off-by: Moriarty <[email protected]>
  • Loading branch information
Moriarty committed Aug 9, 2022
1 parent ae880a2 commit d92fdd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/modules/ledger/LedgerApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class LedgerApi {

const schemaId = generateSchemaId(did, schema.name, schema.version)

// Generate teh qualified ID
// Generate the qualified ID
const qualifiedIdentifier = getQualifiedIdentifierSchema(this.ledgerService.getDidIndyNamespace(), schema, schemaId)

// Try find the schema in the wallet
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/utils/indyIdentifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export function getLegacyIndySchemaId(qualifiedIdentifier: string) {
*
*/
export function schemaToQualifiedIndySchemaId(schema: SchemaTemplate | Schema, schemaId: string): string {
const namespaceIdentifier = didFromSchemaId(schemaId)
const didUrl = `${namespaceIdentifier}/anoncreds/v0/SCHEMA/${schema.name}/${schema.version}`
const did = didFromSchemaId(schemaId)
const didUrl = `${did}/anoncreds/v0/SCHEMA/${schema.name}/${schema.version}`
return didUrl
}

Expand All @@ -81,14 +81,14 @@ export function credDefToQualifiedIndyCredDefId(
credDefId: string,
credDef: Omit<CredentialDefinitionTemplate, 'signatureType'> | (CredDef & { schemaSeqNo?: string })
): string {
const namespaceIdentifier = didFromCredentialDefinitionId(credDefId)
const did = didFromCredentialDefinitionId(credDefId)
let seqNo
if ('schema' in credDef) {
seqNo = credDef.schema.seqNo
} else if ('schemaSeqNo' in credDef) {
seqNo = credDef.schemaSeqNo
}
return `${namespaceIdentifier}/anoncreds/v0/CLAIM_DEF/${seqNo}/${credDef.tag}`
return `${did}/anoncreds/v0/CLAIM_DEF/${seqNo}/${credDef.tag}`
}

export function getQualifiedIdentifierCredDef(
Expand Down

0 comments on commit d92fdd4

Please sign in to comment.