Skip to content

Commit

Permalink
fix: PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Javier Ribó Labrador <[email protected]>
  • Loading branch information
elribonazo committed May 29, 2024
1 parent 301301e commit 0463cd2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions src/domain/buildingBlocks/Pollux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ export interface Pollux {
): Promise<CredentialRequestTuple>;
extractCredentialFormatFromMessage(message: Message): CredentialType;

createPresentationSubmission<Type extends CredentialType = CredentialType.JWT>(
presentationDefinition: PresentationDefinitionRequest<Type>,
createPresentationSubmission(
presentationDefinition: PresentationDefinitionRequest<CredentialType.JWT>,
credential: Credential,
privateKey: PrivateKey | LinkSecret
): Promise<PresentationSubmission<Type>>

privateKey: PrivateKey
): Promise<PresentationSubmission<CredentialType.JWT>>
createPresentationSubmission(
presentationDefinition: PresentationDefinitionRequest<CredentialType.AnonCreds>,
credential: Credential,
privateKey: LinkSecret
): Promise<PresentationSubmission<CredentialType.AnonCreds>>

/**
* Process a PresentationSubmission, resolve the issuer did and verify the credential and the holder signature
Expand Down
2 changes: 1 addition & 1 deletion src/edge-agent/Agent.Credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export class AgentCredentials implements AgentCredentialsClass {
if (!storedLinkSecret) {
throw new Error("Link secret not found.");
}
const presentationSubmission = await this.pollux.createPresentationSubmission<CredentialType.AnonCreds>(
const presentationSubmission = await this.pollux.createPresentationSubmission(
request.toJSON(),
credential,
storedLinkSecret
Expand Down
2 changes: 1 addition & 1 deletion src/mercury/Mercury.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ export default class Mercury implements MercuryInterface {
async sendMessageParseMessage(
message: Domain.Message
): Promise<Domain.Message | undefined> {
const responseBody = await this.sendMessage<any>(message);
try {
const responseBody = await this.sendMessage<any>(message);
const responseJSON = JSON.stringify(responseBody);
return await this.unpackMessage(responseJSON);
} catch (err) {
Expand Down

0 comments on commit 0463cd2

Please sign in to comment.