Skip to content

Commit

Permalink
Solved the credential-def bug in endorsement (#181)
Browse files Browse the repository at this point in the history
Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>
  • Loading branch information
KulkarniShashank authored and KulkarniShashank committed Sep 11, 2024
1 parent 383f8d1 commit 66d06a0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/ecosystem/src/ecosystem.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export class EcosystemService {
* @param RequestSchemaEndorsement
* @returns
*/
async requestSchemaEndorsement(requestSchemaPayload:RequestSchemaEndorsement, orgId: number, ecosystemId: string): Promise<object> {
async requestSchemaEndorsement(requestSchemaPayload: RequestSchemaEndorsement, orgId: number, ecosystemId: string): Promise<object> {
try {
const getEcosystemLeadDetails = await this.ecosystemRepository.getEcosystemLeadDetails(ecosystemId);

Expand Down Expand Up @@ -424,7 +424,7 @@ export class EcosystemService {
}
}

async requestCredDeffEndorsement(requestCredDefPayload:RequestCredDeffEndorsement, orgId:number, ecosystemId:string): Promise<object> {
async requestCredDeffEndorsement(requestCredDefPayload: RequestCredDeffEndorsement, orgId: number, ecosystemId: string): Promise<object> {
try {

const getEcosystemLeadDetails = await this.ecosystemRepository.getEcosystemLeadDetails(ecosystemId);
Expand Down Expand Up @@ -477,6 +477,13 @@ export class EcosystemService {
throw new InternalServerErrorException(ResponseMessages.ecosystem.error.requestCredDefTransaction);
}

const requestBody = credDefTransactionRequest.message.credentialDefinitionState.credentialDefinition;

if (!requestBody) {
throw new NotFoundException(ResponseMessages.ecosystem.error.credentialDefinitionNotFound);
}

requestCredDefPayload["credentialDefinition"] = requestBody;
const schemaTransactionResponse = {
endorserDid: ecosystemLeadAgentDetails.orgDid,
authorDid: ecosystemMemberDetails.orgDid,
Expand Down

0 comments on commit 66d06a0

Please sign in to comment.