From 072f982645e7e4dd8c343794f79aba06bccfa8e4 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 11 Jun 2024 12:32:05 +0300 Subject: [PATCH] remove missleading flag --- multiversx_sdk_cli/cli_delegation.py | 1 - .../delegation/staking_provider.py | 18 +----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/multiversx_sdk_cli/cli_delegation.py b/multiversx_sdk_cli/cli_delegation.py index b5601ed8..feecd36d 100644 --- a/multiversx_sdk_cli/cli_delegation.py +++ b/multiversx_sdk_cli/cli_delegation.py @@ -32,7 +32,6 @@ def setup_parser(args: List[str], subparsers: Any) -> Any: "Add new nodes must be called by the contract owner") sub.add_argument("--validators-file", required=True, help="a JSON file describing the Nodes") sub.add_argument("--delegation-contract", required=True, help="address of the delegation contract") - sub.add_argument("--using-delegation-manager", action="store_true", required=False, help="whether delegation contract was created using the Delegation Manager") _add_common_arguments(args, sub) sub.set_defaults(func=add_new_nodes) diff --git a/multiversx_sdk_cli/delegation/staking_provider.py b/multiversx_sdk_cli/delegation/staking_provider.py index 5b9de82c..e8244ea0 100644 --- a/multiversx_sdk_cli/delegation/staking_provider.py +++ b/multiversx_sdk_cli/delegation/staking_provider.py @@ -4,8 +4,6 @@ from multiversx_sdk import (Address, DelegationTransactionsFactory, ValidatorPublicKey) -from multiversx_sdk_cli.accounts import Account, LedgerAccount -from multiversx_sdk_cli.cli_password import load_password from multiversx_sdk_cli.errors import BadUsage from multiversx_sdk_cli.interfaces import IAddress, ITransaction from multiversx_sdk_cli.validators.validators_file import ValidatorsFile @@ -331,7 +329,7 @@ def _get_public_keys_and_signed_messages(self, args: Any) -> Tuple[List[Validato validators_file = ValidatorsFile(validators_file_path) signers = validators_file.load_signers() - pubkey = self._get_pubkey_to_be_signed(args) + pubkey = Address.new_from_bech32(args.delegation_contract).get_public_key() public_keys: List[ValidatorPublicKey] = [] signed_messages: List[bytes] = [] @@ -342,17 +340,3 @@ def _get_public_keys_and_signed_messages(self, args: Any) -> Tuple[List[Validato signed_messages.append(signed_message) return public_keys, signed_messages - - def _get_pubkey_to_be_signed(self, args: Any) -> bytes: - account = Account() - if args.using_delegation_manager: - account = Account(address=Address.new_from_bech32(args.delegation_contract)) - elif args.pem: - account = Account(pem_file=args.pem) - elif args.keyfile: - password = load_password(args) - account = Account(key_file=args.keyfile, password=password) - elif args.ledger: - account = LedgerAccount(account_index=args.ledger_account_index, address_index=args.ledger_address_index) - - return account.address.get_public_key()