Skip to content

Commit

Permalink
fix-status
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratap2018 committed Dec 26, 2024
1 parent 1c79fd5 commit 571b4c9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
8 changes: 7 additions & 1 deletion src/credential/services/credential.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ export class CredentialService {
updateCredenital?.credentialStatus,
updateCredenital?.proofValue,
appMenemonic,
appDetail,
);
} else {
updatedCredResult = await hypersignVC.updateCredentialStatus({
Expand Down Expand Up @@ -599,7 +600,12 @@ export class CredentialService {
);
}
if (await this.checkAllowence(address)) {
await this.txnService.sendVCTxn(credentialStatus, proof, appMenemonic);
await this.txnService.sendVCTxn(
credentialStatus,
proof,
appMenemonic,
appDetail,
);
} else {
registeredVC = await hypersignVC.registerCredentialStatus({
credentialStatus,
Expand Down
4 changes: 4 additions & 0 deletions src/did/services/did.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ export class DidService {
signInfos,
verificationMethodId,
appMenemonic,
appDetail,
);
} else {
registerDidDoc = await hypersignDid.register(params);
Expand Down Expand Up @@ -762,6 +763,7 @@ export class DidService {
finalSignInfos,
registerV2DidDto.signInfos,
appMenemonic,
appDetail,
);
} else {
registerDidDoc = await hypersignDid.registerByClientSpec({
Expand Down Expand Up @@ -1057,6 +1059,7 @@ export class DidService {
updatedDid.signInfos,
updatedDid.versionId,
appMenemonic,
appDetail,
);
}
} else {
Expand Down Expand Up @@ -1085,6 +1088,7 @@ export class DidService {
updatedDid.signInfos,
updatedDid.versionId,
appMenemonic,
appDetail,
);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/schema/services/schema.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class SchemaService {
generatedSchema,
signedSchema.proof,
appMenemonic,
appDetail,
);
} else {
registeredSchema = await hypersignSchema.register({
Expand Down Expand Up @@ -270,6 +271,7 @@ export class SchemaService {
registerSchemaDto.schemaDocument,
registerSchemaDto.schemaProof,
appMenemonic,
appDetail,
);
} else {
registeredSchema = await hypersignSchema.register({
Expand Down
36 changes: 25 additions & 11 deletions src/tx-send-module/tx-send-module.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class TxSendModuleService {
this.connect();
}

async invokeTxnController(address, granteeMnemonic) {
async invokeTxnController(address, granteeMnemonic, appDetail) {
const podENV = {
RMQ_URL: this.configService.get('RABBIT_MQ_URI'),
QUEUE_NAME: 'TXN_QUEUE_' + address,
Expand All @@ -43,6 +43,7 @@ export class TxSendModuleService {
ESTIMATE_GAS_PRICE: '155303',
podName: 'txn-dynamic',
granteeWalletAddress: address,
tenent: appDetail.subdomain,
};

await this.channel.assertQueue('GLOBAL_TXN_CONTROLLER_QUEUE', {
Expand Down Expand Up @@ -166,7 +167,7 @@ export class TxSendModuleService {
});
}

async sendUpdateVC(credentialStatus, proofValue, granteeMnemonic) {
async sendUpdateVC(credentialStatus, proofValue, granteeMnemonic, appDetail) {
if (!this.channel) {
await this.connect();
}
Expand Down Expand Up @@ -222,10 +223,15 @@ export class TxSendModuleService {
Buffer.from(JSON.stringify(data)),
);

await this.invokeTxnController(address, granteeMnemonic);
await this.invokeTxnController(address, granteeMnemonic, appDetail);
}

async sendVCTxn(credentialStatus, credentialStatusProof, granteeMnemonic) {
async sendVCTxn(
credentialStatus,
credentialStatusProof,
granteeMnemonic,
appDetail,
) {
if (!this.channel) {
await this.connect();
}
Expand Down Expand Up @@ -282,7 +288,7 @@ export class TxSendModuleService {
Buffer.from(JSON.stringify(data)),
);

await this.invokeTxnController(address, granteeMnemonic);
await this.invokeTxnController(address, granteeMnemonic, appDetail);
}

async prepareMsgUpdateDID(didDocument, signInfos, versionId, txAuthor) {
Expand All @@ -299,6 +305,7 @@ export class TxSendModuleService {
signInfos: any,
versionId: any,
granteeMnemonic: any,
appDetail,
) {
if (!this.channel) {
await this.connect();
Expand Down Expand Up @@ -352,7 +359,7 @@ export class TxSendModuleService {
Buffer.from(JSON.stringify(data)),
);

await this.invokeTxnController(address, granteeMnemonic);
await this.invokeTxnController(address, granteeMnemonic, appDetail);
}
prepareMsgDeactivateDID(
didDocument: any,
Expand All @@ -368,7 +375,13 @@ export class TxSendModuleService {
});
}

async sendDIDUpdate(didDocument, signInfos, versionId, granteeMnemonic) {
async sendDIDUpdate(
didDocument,
signInfos,
versionId,
granteeMnemonic,
appDetail,
) {
if (!this.channel) {
await this.connect();
}
Expand Down Expand Up @@ -420,14 +433,15 @@ export class TxSendModuleService {
Buffer.from(JSON.stringify(data)),
);

await this.invokeTxnController(address, granteeMnemonic);
await this.invokeTxnController(address, granteeMnemonic, appDetail);
}

async sendDIDTxn(
didDocument,
didDocumentSigned,
verificationMethodId,
granteeMnemonic,
appDetail,
) {
if (!this.channel) {
await this.connect();
Expand Down Expand Up @@ -479,7 +493,7 @@ export class TxSendModuleService {
Buffer.from(JSON.stringify(data)),
);

await this.invokeTxnController(address, granteeMnemonic);
await this.invokeTxnController(address, granteeMnemonic, appDetail);
}

prepareSchemaMsg(schema, proof, txAuthor) {
Expand All @@ -490,7 +504,7 @@ export class TxSendModuleService {
});
}

async sendSchemaTxn(schema, proof, granteeMnemonic) {
async sendSchemaTxn(schema, proof, granteeMnemonic, appDetail) {
if (!this.channel) {
await this.connect();
}
Expand Down Expand Up @@ -537,7 +551,7 @@ export class TxSendModuleService {
Buffer.from(JSON.stringify(data)),
);

await this.invokeTxnController(address, granteeMnemonic);
await this.invokeTxnController(address, granteeMnemonic, appDetail);
return sendToQueue1;
}
}

0 comments on commit 571b4c9

Please sign in to comment.