Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions multiversx_sdk_cli/cli_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging
import sys
from argparse import FileType
from copy import deepcopy
from functools import cache
from getpass import getpass
from pathlib import Path
Expand Down Expand Up @@ -862,6 +863,8 @@ def alter_transaction_and_sign_again_if_needed(
sender: IAccount,
guardian_and_relayer_data: GuardianRelayerData,
):
initial_tx = deepcopy(tx)

set_options_for_hash_signing_if_needed(
transaction=tx,
guardian=guardian_and_relayer_data.guardian,
Expand All @@ -870,6 +873,7 @@ def alter_transaction_and_sign_again_if_needed(

altered = _alter_version_and_options_if_provided(
args=args,
initial_tx=initial_tx,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming inconsistency, tx vs. transaction.

transaction=tx,
)

Expand All @@ -883,13 +887,20 @@ def alter_transaction_and_sign_again_if_needed(

def _alter_version_and_options_if_provided(
args: Any,
initial_tx: Transaction,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming inconsistency.

transaction: Transaction,
) -> bool:
"""Alters the transaction version and options if they are provided in args.
Returns True if any alteration was made, False otherwise.
"""
altered = False

if initial_tx.version != transaction.version:
altered = True

if initial_tx.options != transaction.options:
altered = True
Comment on lines +898 to +902
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic checks for changes between initial_tx and transaction before any explicit alterations are made. This creates a redundant check since at this point in the function, transaction should be identical to initial_tx. Consider moving these checks after the explicit alteration logic (lines 904-910) to properly detect all changes.

Copilot uses AI. Check for mistakes.

if args.version != DEFAULT_TX_VERSION and transaction.version != args.version:
transaction.version = args.version
altered = True
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "multiversx-sdk-cli"
version = "11.2.0"
version = "11.2.1"
authors = [
{ name="MultiversX" },
]
Expand Down
Loading