Skip to content

Commit

Permalink
fix(present-proof): do not take credentials as an input
Browse files Browse the repository at this point in the history
Signed-off-by: Berend Sliedrecht <[email protected]>
  • Loading branch information
berendsliedrecht committed Dec 21, 2023
1 parent 27fb71a commit 5551267
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export interface PresentationExchangeProofFormat extends ProofFormat {
presentationDefinition: PresentationDefinition
}

acceptRequest: {
credentials: Array<W3cCredentialRecord>
}
acceptRequest: never

getCredentialsForRequest: {
input: never
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,8 @@ export class PresentationExchangeProofFormatService implements ProofFormatServic

public async acceptRequest(
agentContext: AgentContext,
{ attachmentId, requestAttachment, proofFormats }: ProofFormatAcceptRequestOptions<PresentationExchangeProofFormat>
{ attachmentId, requestAttachment }: ProofFormatAcceptRequestOptions<PresentationExchangeProofFormat>
): Promise<ProofFormatCreateReturn> {
const presentationExchangeFormat = proofFormats?.presentationExchange

if (!presentationExchangeFormat) {
throw Error('Missing presentation exchange format in create request attachment format')
}

const ps = this.presentationExchangeService(agentContext)

const format = new ProofFormatSpec({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ describe('Presentation Exchange ProofFormatService', () => {
const { attachment, format } = await pexFormatService.acceptRequest(agent.context, {
proofRecord: mockProofRecord(),
requestAttachment,
proofFormats: { presentationExchange: { credentials: [mockCredentialRecord] } },
})

expect(attachment).toMatchObject({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,8 @@ describe('Present Proof', () => {
state: ProofState.PresentationReceived,
})

const {
proofFormats: { presentationExchange },
} = await proverAgent.proofs.selectCredentialsForRequest({
proofRecordId: proverProofExchangeRecord.id,
})

await proverAgent.proofs.acceptRequest({
proofRecordId: proverProofExchangeRecord.id,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
proofFormats: { presentationExchange: { credentials: presentationExchange! } },
})

// Verifier waits for the presentation from the Prover
Expand Down

0 comments on commit 5551267

Please sign in to comment.