Refactored delegation transactions#486
Merged
Merged
Conversation
Comment on lines
+763
to
+764
| if value < MINIMUM_AMOUNT_TO_DELEGATE: | ||
| errors.BadUserInput(f"Value must be greater than {MINIMUM_AMOUNT_TO_DELEGATE} (1 EGLD)") |
Contributor
There was a problem hiding this comment.
Check can be dropped 💭 (time-dependent).
Comment on lines
+873
to
+874
| if value < MINIMUM_AMOUNT_TO_DELEGATE: | ||
| errors.BadUserInput(f"Value must be greater than {MINIMUM_AMOUNT_TO_DELEGATE} (1 EGLD)") |
| from multiversx_sdk_cli.interfaces import IAccount | ||
| from multiversx_sdk_cli.validators.validators_file import ValidatorsFile | ||
|
|
||
| DELEGATION_MANAGER_SC_ADDRESS_HEX = "000000000000000000010000000000000000000000000000000000000004ffff" |
Contributor
There was a problem hiding this comment.
I think the constant is defined somewhere else, as well (when used for creating staking providers).
Collaborator
Author
There was a problem hiding this comment.
it is not defined anywhere else.
|
|
||
| def prepare_transaction_for_automatic_activation(self, owner: IAccount, args: Any) -> Transaction: | ||
| delegation_contract = Address.new_from_bech32(args.delegation_contract) | ||
| def prepare_transaction_for_automatic_activation( |
Contributor
There was a problem hiding this comment.
Heads-up: in Barnard, this might change (we'll see at that point):
|
|
||
| return tx | ||
|
|
||
| # will be replaced in the future once it's implemented in sdk-py |
danielailie
reviewed
Mar 3, 2025
|
|
||
| def add_new_nodes(args: Any): | ||
| ensure_arguments_are_provided_and_prepared(args) | ||
| validate_transaction_args(args) |
There was a problem hiding this comment.
can you extract this into a method because they are used in every method
danielailie
reviewed
Mar 3, 2025
| sender, nonce = prepare_sender(args) | ||
| guardian, guardian_address = prepare_guardian(args) | ||
| relayer, relayer_address = prepare_relayer(args) | ||
|
|
There was a problem hiding this comment.
Also can you extract this into a method maybe something like InitializeDelegationOperations
danielailie
reviewed
Mar 3, 2025
| @@ -369,66 +390,233 @@ def ensure_arguments_are_provided_and_prepared(args: Any): | |||
| cli_shared.prepare_nonce_in_args(args) | |||
|
|
|||
|
|
|||
There was a problem hiding this comment.
can you set the nonce on the sender and then use it from there?
andreibancioiu
approved these changes
Mar 3, 2025
danielailie
approved these changes
Mar 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.