@@ -280,33 +280,37 @@ def read_cardano_key_file(self, filepath) -> str:
280
280
def update_d_param (self , permissioned_candidates_count , registered_candidates_count ):
281
281
signing_key = self .config .nodes_config .governance_authority .mainchain_key
282
282
283
- tx_id = self .partner_chains_node .smart_contracts .update_d_param (
283
+ response = self .partner_chains_node .smart_contracts .update_d_param (
284
284
permissioned_candidates_count , registered_candidates_count , signing_key
285
285
)
286
+ tx_id = response .transaction_id
286
287
effective_in_mc_epoch = self ._effective_in_mc_epoch ()
287
288
288
- if tx_id and effective_in_mc_epoch :
289
+ if tx_id :
289
290
logger .info (
290
291
f"Update of D Param of P: { permissioned_candidates_count } and R: { registered_candidates_count } "
291
292
f" was successful and will take effect in { effective_in_mc_epoch } epoch. Transaction id: { tx_id } "
292
293
)
293
294
return True , effective_in_mc_epoch
294
295
else :
296
+ logger .error (f"Update of D Param failed, STDOUT: { response .stdout } , STDERR: { response .stderr } " )
295
297
return False , None
296
298
297
299
def upsert_permissioned_candidates (self , new_candidates_list ):
298
- txId = self .partner_chains_node .smart_contracts .upsert_permissioned_candidates (
300
+ response = self .partner_chains_node .smart_contracts .upsert_permissioned_candidates (
299
301
self .config .nodes_config .governance_authority .mainchain_key , new_candidates_list
300
302
)
303
+ tx_id = response .transaction_id
301
304
effective_in_mc_epoch = self ._effective_in_mc_epoch ()
302
305
303
- if txId and effective_in_mc_epoch :
306
+ if tx_id :
304
307
logger .info (
305
308
f"Success! New permissioned candidates are set and will be effective in "
306
- f"{ effective_in_mc_epoch } MC epoch. Transaction id: { txId } "
309
+ f"{ effective_in_mc_epoch } MC epoch. Transaction id: { tx_id } "
307
310
)
308
311
return True , effective_in_mc_epoch
309
312
else :
313
+ logger .error (f"Upsert permissioned candidates failed, STDOUT: { response .stdout } , STDERR: { response .stderr } " )
310
314
return False , None
311
315
312
316
def register_candidate (self , candidate_name ):
@@ -324,37 +328,45 @@ def register_candidate(self, candidate_name):
324
328
self .config .nodes_config .nodes [candidate_name ].grandpa_public_key ,
325
329
)
326
330
327
- txId = self .partner_chains_node .smart_contracts .register (
331
+ response = self .partner_chains_node .smart_contracts .register (
328
332
signatures ,
329
333
keys_files .cardano_payment_key ,
330
334
self .read_cardano_key_file (keys_files .spo_public_key ),
331
335
registration_utxo ,
332
336
)
337
+ tx_id = response .transaction_id
333
338
effective_in_mc_epoch = self ._effective_in_mc_epoch ()
334
339
335
- if txId and effective_in_mc_epoch :
340
+ if tx_id :
336
341
logger .info (
337
342
f"Registration of { candidate_name } was successful and will take effect in "
338
- f"{ effective_in_mc_epoch } MC epoch. Transaction id: { txId } "
343
+ f"{ effective_in_mc_epoch } MC epoch. Transaction id: { tx_id } "
339
344
)
340
345
return True , effective_in_mc_epoch
341
346
else :
347
+ logger .error (
348
+ f"Registration of { candidate_name } failed, STDOUT: { response .stdout } , STDERR: { response .stderr } "
349
+ )
342
350
return False , None
343
351
344
352
def deregister_candidate (self , candidate_name ):
345
353
keys_files = self .config .nodes_config .nodes [candidate_name ].keys_files
346
- txId = self .partner_chains_node .smart_contracts .deregister (
354
+ response = self .partner_chains_node .smart_contracts .deregister (
347
355
keys_files .cardano_payment_key , self .read_cardano_key_file (keys_files .spo_public_key )
348
356
)
357
+ tx_id = response .transaction_id
349
358
effective_in_mc_epoch = self ._effective_in_mc_epoch ()
350
359
351
- if txId and effective_in_mc_epoch :
360
+ if tx_id :
352
361
logger .info (
353
362
f"Deregistration of { candidate_name } was successful and will take effect in "
354
- f"{ effective_in_mc_epoch } MC epoch. Transaction id: { txId } "
363
+ f"{ effective_in_mc_epoch } MC epoch. Transaction id: { tx_id } "
355
364
)
356
365
return True , effective_in_mc_epoch
357
366
else :
367
+ logger .error (
368
+ f"Deregistration of { candidate_name } failed, STDOUT: { response .stdout } , STDERR: { response .stderr } "
369
+ )
358
370
return False , None
359
371
360
372
def get_pc_epoch (self ):
0 commit comments