@@ -520,22 +520,39 @@ def submit_tx_cbor(self, cbor: Union[bytes, str]) -> str:
520
520
521
521
try :
522
522
self ._run_command (
523
- ["transaction" , "submit" , "--tx-file" , tmp_tx_file .name ]
523
+ [
524
+ "latest" ,
525
+ "transaction" ,
526
+ "submit" ,
527
+ "--tx-file" ,
528
+ tmp_tx_file .name ,
529
+ ]
524
530
+ self ._network_args
525
531
)
526
- except CardanoCliError as err :
527
- raise TransactionFailedException (
528
- "Failed to submit transaction"
529
- ) from err
532
+ except CardanoCliError :
533
+ try :
534
+ self ._run_command (
535
+ ["transaction" , "submit" , "--tx-file" , tmp_tx_file .name ]
536
+ + self ._network_args
537
+ )
538
+ except CardanoCliError as err :
539
+ raise TransactionFailedException (
540
+ "Failed to submit transaction"
541
+ ) from err
530
542
531
543
# Get the transaction ID
532
544
try :
533
545
txid = self ._run_command (
534
- ["transaction" , "txid" , "--tx-file" , tmp_tx_file .name ]
546
+ ["latest" , " transaction" , "txid" , "--tx-file" , tmp_tx_file .name ]
535
547
)
536
- except CardanoCliError as err :
537
- raise PyCardanoException (
538
- f"Unable to get transaction id for { tmp_tx_file .name } "
539
- ) from err
548
+ except CardanoCliError :
549
+ try :
550
+ txid = self ._run_command (
551
+ ["transaction" , "txid" , "--tx-file" , tmp_tx_file .name ]
552
+ )
553
+ except CardanoCliError as err :
554
+ raise PyCardanoException (
555
+ f"Unable to get transaction id for { tmp_tx_file .name } "
556
+ ) from err
540
557
541
558
return txid
0 commit comments