🤖 Merge PR #63632 [@types/indy-sdk] fix indy proof request by @Amit-Padmani

* fix:indy proof request types to indy-sdk

Signed-off-by: Amit-Padmani <amit.padmani@ontario.ca>

* fix: test case added for indy proof request

Signed-off-by: Amit-Padmani <amit.padmani@ontario.ca>

Signed-off-by: Amit-Padmani <amit.padmani@ontario.ca>
This commit is contained in:
Amit-Padmani
2022-12-15 17:18:25 +05:30
committed by GitHub
parent c164d52894
commit 903d6d92b1
2 changed files with 14 additions and 1 deletions

View File

@@ -593,7 +593,7 @@ export interface IndyProofRequest {
requested_attributes: {
[key: string]: {
name?: string | undefined;
names?: string | undefined;
names?: string[] | undefined;
restrictions?: WalletQuery[] | undefined;
non_revoked?: NonRevokedInterval | undefined;
};

View File

@@ -78,6 +78,18 @@ const proofReq: indy.IndyProofRequest = {
},
non_revoked: { from: 80, to: 100 },
};
const proofRequestWithNamesArray: indy.IndyProofRequest = {
nonce: 'nonce',
name: 'proof_req_1',
version: '0.1',
requested_attributes: {
attr1_referent: { names: ['name', 'address'] },
},
requested_predicates: {
predicate1_referent: { name: 'age', p_type: '>=', p_value: 18 },
},
non_revoked: { from: 80, to: 100 },
};
const ledgerRejectResponse: indy.LedgerRejectResponse = {
op: 'REJECT',
reqId: 1615465027340221000,
@@ -287,6 +299,7 @@ indy.generateWalletKey({ seed: 'seed' });
indy.buildAttribRequest('myDid', 'myDid', null, { endpoint: 'value' }, null);
indy.buildGetAttribRequest(null, 'did', 'endpoint', null, null);
indy.proverGetCredentialsForProofReq(10, proofReq);
indy.proverGetCredentialsForProofReq(10, proofRequestWithNamesArray);
indy.proverSearchCredentialsForProofReq(10, proofReq, {});
indy.proverFetchCredentialsForProofReq(10, 'attr1_referent', 100);
indy.proverCloseCredentialsSearchForProofReq(10);