Perform args validation on command#485
Merged
Merged
Conversation
Base automatically changed from
switch-to-sdk-native-auth-client
to
feat/next
February 25, 2025 12:48
| raise InvalidArgumentsError("One of --relayer-pem, --relayer-keyfile, or --relayer-ledger must be provided") | ||
|
|
||
|
|
||
| def ensure_broadcast_args(args: Any): |
Contributor
There was a problem hiding this comment.
This is more like "validate_broadcast_args", since neither is required.
Collaborator
Author
There was a problem hiding this comment.
renamed to validate_broadcast_args.
| from multiversx_sdk_cli.errors import InvalidArgumentsError | ||
|
|
||
|
|
||
| def ensure_required_transaction_args_are_provided(args: Any): |
Contributor
There was a problem hiding this comment.
💡 Maybe we can use "validate" or "check" instead of "ensure"? Since the word "ensure" makes us think about required arguments.
| """Ensure that gas_limit is provided.""" | ||
| if hasattr(args, "gas_limit") and not args.gas_limit: | ||
| if hasattr(args, "estimate_gas") and not args.estimate_gas: | ||
| raise InvalidArgumentsError("If --gas-limit not provided, --estimate-gas must be provided") |
Contributor
There was a problem hiding this comment.
But we will drop --estimate-gas in the near future, right?
Collaborator
Author
There was a problem hiding this comment.
it's been already dropped in a future PR.
|
|
||
| if chain_id: | ||
| return chain_id | ||
| else: |
Contributor
There was a problem hiding this comment.
else statement can be dropped, and remaining lines unindent-ed.
andreibancioiu
approved these changes
Feb 27, 2025
mradian1
approved these changes
Feb 27, 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.