Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authz temp #149

Merged
merged 28 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update txnHash Var
  • Loading branch information
Pratap2018 committed Aug 8, 2024
commit 8280549bc8fa89798ed0284e03dd27d274820b0e
27 changes: 12 additions & 15 deletions src/schema/services/schema.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,13 @@ export class SchemaService {
schemaId: signedSchema.id,
appId: appDetail.appId,
authorDid: author,
transactionHash: registeredSchema['transactionHash']
? registeredSchema['transactionHash']
: '',
transactionHash: '',
});
Logger.log('create() method: ends', 'SchemaService');

return {
schemaId: signedSchema.id,
transactionHash: registeredSchema['transactionHash']
? registeredSchema['transactionHash']
: '',
transactionHash: '',
};
} catch (error) {
Logger.error(
Expand Down Expand Up @@ -206,7 +202,7 @@ export class SchemaService {
async registerSchema(
registerSchemaDto: RegisterSchemaDto,
appDetail,
): Promise<{ transactionHash: string }> {
): Promise<any> {
Logger.log('registerSchema() method: starts....', 'SchemaService');

const { edvId, kmsId } = appDetail;
Expand All @@ -227,32 +223,33 @@ export class SchemaService {
}

const appMenemonic = await getAppMenemonic(kmsId);
const namespace = Namespace.testnet;
// const namespace = Namespace.testnet;
Logger.log('registerSchema() method: initialising hypersignSchema');

const hypersignSchema = await this.schemaSSIservice.initiateHypersignSchema(
appMenemonic,
namespace,
);
const registeredSchema = {} as { transactionHash: string };
// const hypersignSchema = await this.schemaSSIservice.initiateHypersignSchema(
// appMenemonic,
// namespace,
// );
schemaDocument['proof'] = schemaProof;
Logger.log('registerSchema() method: registering schema on the blockchain');
try {
// registeredSchema = await hypersignSchema.register({
// schema: schemaDocument,
// });

await this.txnService.sendSchemaTxn(
const ack = await this.txnService.sendSchemaTxn(
registerSchemaDto.schemaDocument,
registerSchemaDto.schemaProof,
appMenemonic,
);
if (ack == true) {
}
} catch (e) {
Logger.error('registerSchema() method: Error while registering schema');
throw new BadRequestException([e.message]);
}
Logger.log('registerSchema() method: ends....', 'SchemaService');

return { transactionHash: registeredSchema?.transactionHash };
return { status: 'Transaction sent' };
}
}
2 changes: 1 addition & 1 deletion src/tx-send-module/tx-send-module.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,6 @@ export class TxSendModuleService {
);

await this.invokeTxnController(address, granteeMnemonic);
console.log(sendToQueue1);
return sendToQueue1;
}
}
Loading