Skip to content

Commit

Permalink
update satisfies presentation definition (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirahsapong authored Mar 19, 2024
1 parent 3bb1ddf commit bcf5bfb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/Web5/Credentials/PresentationExchange.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ public enum PresentationExchange {
vcJWTs: [String],
presentationDefinition: PresentationDefinitionV2
) throws -> Void {
let inputDescriptorToVcMap = try selectCredentials(vcJWTs: vcJWTs, presentationDefinition: presentationDefinition)
guard inputDescriptorToVcMap.count == presentationDefinition.inputDescriptors.count else {
let inputDescriptorToVcMap = try mapInputDescriptorsToVCs(vcJWTList: vcJWTs, presentationDefinition: presentationDefinition)
let inputDescriptorToVcFlatMap = inputDescriptorToVcMap.flatMap { $0.value }
guard inputDescriptorToVcFlatMap.count == presentationDefinition.inputDescriptors.count else {
throw Error.missingDescriptors(presentationDefinition.inputDescriptors.count, inputDescriptorToVcMap.count)
}
}
Expand Down

0 comments on commit bcf5bfb

Please sign in to comment.