Skip to content

Commit

Permalink
Merge pull request #339 from multiversx/link-txs-to-explorer
Browse files Browse the repository at this point in the history
Add url to transactions in the explorer
  • Loading branch information
popenta authored Sep 26, 2023
2 parents c692b1a + 476a99d commit fc377ec
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion multiversx_sdk_cli/cli_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from multiversx_sdk_cli.ledger.ledger_functions import do_get_ledger_address
from multiversx_sdk_cli.simulation import Simulator
from multiversx_sdk_cli.transactions import send_and_wait_for_result
from multiversx_sdk_cli.utils import log_explorer_transaction
from multiversx_sdk_cli.ux import show_warning


Expand Down Expand Up @@ -274,8 +275,16 @@ def send_or_simulate(tx: ITransaction, args: Any, dump_output: bool = True) -> C
simulation = Simulator(proxy).run(tx)
output_builder.set_simulation_results(simulation)
finally:
output_transaction = output_builder.build()

if dump_output:
utils.dump_out_json(output_builder.build(), outfile=outfile)
utils.dump_out_json(output_transaction, outfile=outfile)

if send_only:
log_explorer_transaction(
chain=output_transaction["emittedTransaction"]["chainID"],
transaction_hash=output_transaction["emittedTransactionHash"]
)

return output_builder

Expand Down

0 comments on commit fc377ec

Please sign in to comment.