1
1
import type { Agent } from '../../../../../agent/Agent'
2
2
import type { ConnectionRecord } from '../../../../connections/repository/ConnectionRecord'
3
- import type { ProposeProofOptions , AcceptProposalOptions } from '../../../ProofsApiOptions'
3
+ import type { AcceptProposalOptions , ProposeProofOptions } from '../../../ProofsApiOptions'
4
+ import type { IndyProofFormat } from '../../../formats/indy/IndyProofFormat'
4
5
import type { ProofRecord } from '../../../repository/ProofRecord'
6
+ import type { V1ProofService } from '../V1ProofService'
5
7
import type { PresentationPreview } from '../models/V1PresentationPreview'
6
8
7
9
import { setupProofsTest , waitForProofRecord } from '../../../../../../tests/helpers'
8
10
import testLogger from '../../../../../../tests/logger'
9
11
import { DidCommMessageRepository } from '../../../../../storage/didcomm'
10
- import { ProofProtocolVersion } from '../../../models/ProofProtocolVersion'
11
12
import { ProofState } from '../../../models/ProofState'
12
13
import { V1ProposePresentationMessage , V1RequestPresentationMessage } from '../messages'
13
14
@@ -39,9 +40,13 @@ describe('Present Proof', () => {
39
40
test ( `Alice Creates and sends Proof Proposal to Faber` , async ( ) => {
40
41
testLogger . test ( 'Alice sends proof proposal to Faber' )
41
42
42
- const proposeOptions : ProposeProofOptions = {
43
+ const faberProofRecordPromise = waitForProofRecord ( faberAgent , {
44
+ state : ProofState . ProposalReceived ,
45
+ } )
46
+
47
+ aliceProofRecord = await aliceAgent . proofs . proposeProof ( {
43
48
connectionId : aliceConnection . id ,
44
- protocolVersion : ProofProtocolVersion . V1 ,
49
+ protocolVersion : 'v1' ,
45
50
proofFormats : {
46
51
indy : {
47
52
name : 'ProofRequest' ,
@@ -52,14 +57,8 @@ describe('Present Proof', () => {
52
57
} ,
53
58
} ,
54
59
comment : 'V1 propose proof test' ,
55
- }
56
-
57
- const faberProofRecordPromise = waitForProofRecord ( faberAgent , {
58
- state : ProofState . ProposalReceived ,
59
60
} )
60
61
61
- aliceProofRecord = await aliceAgent . proofs . proposeProof ( proposeOptions )
62
-
63
62
testLogger . test ( 'Faber waits for presentation from Alice' )
64
63
faberProofRecord = await faberProofRecordPromise
65
64
@@ -102,7 +101,7 @@ describe('Present Proof', () => {
102
101
id : expect . anything ( ) ,
103
102
threadId : faberProofRecord . threadId ,
104
103
state : ProofState . ProposalReceived ,
105
- protocolVersion : ProofProtocolVersion . V1 ,
104
+ protocolVersion : 'v1' ,
106
105
} )
107
106
} )
108
107
@@ -150,7 +149,7 @@ describe('Present Proof', () => {
150
149
id : expect . anything ( ) ,
151
150
threadId : faberProofRecord . threadId ,
152
151
state : ProofState . RequestReceived ,
153
- protocolVersion : ProofProtocolVersion . V1 ,
152
+ protocolVersion : 'v1' ,
154
153
} )
155
154
} )
156
155
} )
0 commit comments