Skip to content

Commit

Permalink
fix(anoncreds): wrong key name for predicates in proof object (#1517)
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Auer <martin.auer97@gmail.com>
  • Loading branch information
auer-martin authored Jul 26, 2023
1 parent 6795426 commit d895c78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/anoncreds/src/models/exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export interface AnonCredsProof {
>
self_attested_attrs: Record<string, string>

requested_predicates: Record<string, { sub_proof_index: number }>
predicates: Record<string, { sub_proof_index: number }>
}
// TODO: extend types for proof property
proof: any

Check warning on line 93 in packages/anoncreds/src/models/exchange.ts

View workflow job for this annotation

GitHub Actions / Validate

Unexpected any. Specify a different type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export class IndySdkHolderService implements AnonCredsHolderService {
indyProof,
})

return indyProof
// FIXME IndyProof if badly typed in indy-sdk. It contains a `requested_predicates` property, which should be `predicates`.
return indyProof as unknown as AnonCredsProof
} catch (error) {
agentContext.config.logger.error(`Error creating Indy Proof`, {
error,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AnonCredsVerifierService, VerifyProofOptions } from '@aries-framework/anoncreds'
import type { AnonCredsProof, AnonCredsVerifierService, VerifyProofOptions } from '@aries-framework/anoncreds'
import type { AgentContext } from '@aries-framework/core'
import type { CredentialDefs, Schemas, RevocRegDefs, RevRegs, IndyProofRequest, IndyProof } from 'indy-sdk'

Expand Down Expand Up @@ -82,7 +82,8 @@ export class IndySdkVerifierService implements AnonCredsVerifierService {

return await this.indySdk.verifierVerifyProof(
options.proofRequest as IndyProofRequest,
options.proof as IndyProof,
// FIXME IndyProof if badly typed in indy-sdk. It contains a `requested_predicates` property, which should be `predicates`.
options.proof as unknown as IndyProof,
indySchemas,
indyCredentialDefinitions,
indyRevocationDefinitions,
Expand Down

0 comments on commit d895c78

Please sign in to comment.