Skip to content

Commit

Permalink
remove missleading flag
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Jun 11, 2024
1 parent 8954698 commit 072f982
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion multiversx_sdk_cli/cli_delegation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
18 changes: 1 addition & 17 deletions multiversx_sdk_cli/delegation/staking_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from multiversx_sdk import (Address, DelegationTransactionsFactory,

Check warning on line 4 in multiversx_sdk_cli/delegation/staking_provider.py

View workflow job for this annotation

GitHub Actions / runner / mypy

[mypy] reported by reviewdog 🐶 See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports Raw Output: /home/runner/work/mx-sdk-py-cli/mx-sdk-py-cli/multiversx_sdk_cli/delegation/staking_provider.py:4:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
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
Expand Down Expand Up @@ -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] = []
Expand All @@ -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()

0 comments on commit 072f982

Please sign in to comment.