hyperledger-archives / indy-sdk

indy-sdk
https://wiki.hyperledger.org/display/indy
Apache License 2.0
668 stars 735 forks source link

getCredDef() returns broken SchemaId (seqNo instead of txnId) #2570

Closed sschulz-t closed 9 months ago

sschulz-t commented 1 year ago

I am trying to use the schemId that the getCredDef() call returns. However, it looks like it does return the wrong data as it returns the transaction sequence number instead of a valid schema id.

Example: see credential definition ALHKQ3EsBZXotKxt7N8bfn:2:employee:0.1 in transaction 12816 http://greenlight.bcovrin.vonx.io/browse/domain?page=1282#12816 "txnMetadata": { "seqNo": 12816, "txnId": "ALHKQ3EsBZXotKxt7N8bfn:2:employee:0.1", "txnTime": 1673021978 }, When I call getCredDef(..., 'ALHKQ3EsBZXotKxt7N8bfn:2:employee:0.1') i will get schemaId = 12816 which is wrong.

I would expect schemaId = "ALHKQ3EsBZXotKxt7N8bfn:2:employee:0.1".

It looks like it is related to. This problem has also to do with the return of the seqNo instead of the proper schemaId. https://github.com/hyperledger/indy-sdk/issues/2349 https://jira.hyperledger.org/browse/IS-1566

Workaround until this is fixed (in nodejs):

const wrongSchemaId = 12816;
const req = await indy.buildGetTxnRequest(did, null, wrongSchemaId);
const res = await indy.submitRequest(poolHandle, req);
const realSchemaId = res.result.data.txnMetadata.txnId;