File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
acapy_agent/anoncreds/default/legacy_indy Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -358,10 +358,25 @@ async def get_credential_definition(
358358 {"ledger_id" : ledger_id },
359359 )
360360
361+ # Convert seqNo to schema_id if needed
362+ schema_id_from_cred_def = cred_def ["schemaId" ]
363+ if schema_id_from_cred_def .isdigit ():
364+ # schemaId is a seqNo, fetch the actual schema to get its ID
365+ try :
366+ schema = await ledger .fetch_schema_by_seq_no (
367+ int (schema_id_from_cred_def )
368+ )
369+ if schema and schema .get ("id" ):
370+ schema_id_from_cred_def = schema ["id" ]
371+ # If schema is None or missing id, fall back to seqNo
372+ except LedgerError :
373+ # If fetching fails, fall back to using seqNo as schemaId
374+ pass
375+
361376 cred_def_value = CredDefValue .deserialize (cred_def ["value" ])
362377 anoncreds_credential_definition = CredDef (
363378 issuer_id = cred_def ["id" ].split (":" )[0 ],
364- schema_id = cred_def [ "schemaId" ] ,
379+ schema_id = schema_id_from_cred_def ,
365380 type = cred_def ["type" ],
366381 tag = cred_def ["tag" ],
367382 value = cred_def_value ,
You can’t perform that action at this time.
0 commit comments