@@ -188,72 +188,6 @@ async def handle_connections(self, message):
188188 params = {"transaction_my_job" : connection_job_role },
189189 )
190190
191- async def handle_issue_credential (self , message ):
192- state = message .get ("state" )
193- credential_exchange_id = message ["credential_exchange_id" ]
194- prev_state = self .cred_state .get (credential_exchange_id )
195- if prev_state == state :
196- return # ignore
197- self .cred_state [credential_exchange_id ] = state
198-
199- self .log (
200- "Credential: state = {}, credential_exchange_id = {}" .format (
201- state ,
202- credential_exchange_id ,
203- )
204- )
205-
206- if state == "offer_received" :
207- log_status ("#15 After receiving credential offer, send credential request" )
208- await self .admin_POST (
209- f"/issue-credential/records/{ credential_exchange_id } /send-request"
210- )
211-
212- elif state == "credential_acked" :
213- cred_id = message ["credential_id" ]
214- self .log (f"Stored credential { cred_id } in wallet" )
215- log_status (f"#18.1 Stored credential { cred_id } in wallet" )
216- resp = await self .admin_GET (f"/credential/{ cred_id } " )
217- log_json (resp , label = "Credential details:" )
218- log_json (
219- message ["credential_request_metadata" ],
220- label = "Credential request metadata:" ,
221- )
222- self .log ("credential_id" , message ["credential_id" ])
223- self .log ("credential_definition_id" , message ["credential_definition_id" ])
224- self .log ("schema_id" , message ["schema_id" ])
225-
226- elif state == "request_received" :
227- log_status ("#17 Issue credential to X" )
228- # issue credentials based on the credential_definition_id
229- cred_attrs = self .cred_attrs [message ["credential_definition_id" ]]
230- cred_preview = {
231- "@type" : CRED_PREVIEW_TYPE ,
232- "attributes" : [{"name" : n , "value" : v } for (n , v ) in cred_attrs .items ()],
233- }
234- try :
235- cred_ex_rec = await self .admin_POST (
236- f"/issue-credential/records/{ credential_exchange_id } /issue" ,
237- {
238- "comment" : (
239- f"Issuing credential, exchange { credential_exchange_id } "
240- ),
241- "credential_preview" : cred_preview ,
242- },
243- )
244- rev_reg_id = cred_ex_rec .get ("revoc_reg_id" )
245- cred_rev_id = cred_ex_rec .get ("revocation_id" )
246- if rev_reg_id :
247- self .log (f"Revocation registry ID: { rev_reg_id } " )
248- if cred_rev_id :
249- self .log (f"Credential revocation ID: { cred_rev_id } " )
250- except ClientError :
251- pass
252-
253- elif state == "abandoned" :
254- log_status ("Credential exchange abandoned" )
255- self .log ("Problem report message:" , message .get ("error_msg" ))
256-
257191 async def handle_issue_credential_v2_0 (self , message ):
258192 state = message .get ("state" )
259193 cred_ex_id = message ["cred_ex_id" ]
@@ -833,7 +767,6 @@ async def initialize(
833767 create_endorser_agent : bool = False ,
834768 ):
835769 """Startup agent(s), register DID, schema, cred def as appropriate."""
836-
837770 if not the_agent :
838771 log_status (
839772 "#1 Provision an agent and wallet, get back configuration details"
@@ -1179,7 +1112,6 @@ async def verify_proof(self, proof_request):
11791112
11801113 async def terminate (self ):
11811114 """Shut down any running agents."""
1182-
11831115 terminated = True
11841116 try :
11851117 if self .endorser_agent :
@@ -1547,7 +1479,9 @@ async def create_agent_with_args(args, ident: str = None, extra_args: list = Non
15471479 if "aip" in args :
15481480 aip = int (args .aip )
15491481 if aip == 10 : # helpful message to flag legacy usage
1550- raise Exception ("Invalid value for aip, 10 is no longer supported. Use 20 instead." )
1482+ raise Exception (
1483+ "Invalid value for aip, 10 is no longer supported. Use 20 instead."
1484+ )
15511485 if aip != 20 :
15521486 raise Exception ("Invalid value for aip, should be 20" )
15531487 else :
@@ -1642,7 +1576,6 @@ async def test_main(
16421576 aip : str = 20 ,
16431577):
16441578 """Test to startup a couple of agents."""
1645-
16461579 faber_container = None
16471580 alice_container = None
16481581 try :
0 commit comments