Skip to content

transactions refactoring#550

Merged
popenta merged 2 commits intofeat/nextfrom
tx-refactoring
Sep 25, 2025
Merged

transactions refactoring#550
popenta merged 2 commits intofeat/nextfrom
tx-refactoring

Conversation

@popenta
Copy link
Collaborator

@popenta popenta commented Sep 24, 2025

No description provided.

@popenta popenta self-assigned this Sep 24, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the transactions module by replacing the TransactionsController class with the TransfersController from the MultiversX SDK. The refactoring removes a significant amount of custom transaction creation logic and delegates this functionality to the SDK's built-in controller.

  • Removes the custom TransactionsController class and its comprehensive test suite
  • Updates CLI transaction creation to use TransfersController with separate methods for native token transfers and token transfers
  • Adds validation to prevent providing both data and token transfers simultaneously

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
multiversx_sdk_cli/transactions.py Removes TransactionsController class and related imports
multiversx_sdk_cli/tests/test_transactions.py Completely removes test file for the deleted TransactionsController
multiversx_sdk_cli/tests/test_cli_transactions.py Adds test for data and token transfer validation
multiversx_sdk_cli/dns.py Updates to use TransfersController with new method signatures
multiversx_sdk_cli/cli_transactions.py Major refactoring to use TransfersController and new signing approach
Comments suppressed due to low confidence (1)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

tx_computer = TransactionComputer()
if tx.guardian and not tx_computer.has_options_set_for_guarded_transaction(tx):
raise BadUsage("Guardian wallet provided but the transaction has incorrect options.")
raise BadUsage("Guardian wallet provided but the transaction has incorrect options")
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

Missing period at the end of the error message to maintain consistency with error message formatting.

Suggested change
raise BadUsage("Guardian wallet provided but the transaction has incorrect options")
raise BadUsage("Guardian wallet provided but the transaction has incorrect options.")

Copilot uses AI. Check for mistakes.
Base automatically changed from remove-validators-wrapper to feat/next September 25, 2025 08:09
assert tx_json["gasLimit"] == 75000


def test_raise_error_when_data_and_transfers_provided(capsys: Any):
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@popenta popenta merged commit d5339bd into feat/next Sep 25, 2025
11 checks passed
@popenta popenta deleted the tx-refactoring branch September 25, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants