-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: stellar contract info * commands require network when network no… #1676
Conversation
Currently your solution isn't correct. Clap parses commands and runs the corresponding "run" method. So in the case of this PR stellar-cli/cmd/soroban-cli/src/commands/contract/info/shared.rs Lines 61 to 91 in 3f06e1d
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just some small nits for removing extra new lines
Co-authored-by: Willem Wyndham <willem@wyndham.tech>
Co-authored-by: Willem Wyndham <willem@wyndham.tech>
Co-authored-by: Willem Wyndham <willem@wyndham.tech>
Co-authored-by: Willem Wyndham <willem@wyndham.tech>
I'm pretty sure this won't work unless arguments are changed. From what I know Clap will parse arguments first, and we have network as one of the arguments, so I don't think this issue will be resolved with this PR
|
@Ifropc I fixed it so that clap doesn't require network options at all. This should fix this and make commands like |
@willemneal I think we can go with that approach, the only downside is that now arguments are no longer validated by clap. So we now will need to make sure we do the proper validation and give a good error message (e.g. current error message is not descriptive enough)
|
@Ifropc FYI you can do |
Fixed in #1698 |
@Ifropc We still need this PR because it moves the network resolution after checking if there is a wasm arg. |
Oh you are right sorry missed that |
…t required
#1653
What
Additional logic for checking network requirement
If WASM file is provided, don't require network arguments
Why
The current implementation of the stellar contract info commands requires network parameters (e.g., --rpc-url, --network-passphrase, --network) even when users are working with local files such as WebAssembly (.wasm) files. This requirement can lead to unnecessary errors and confusion for users who are only looking to interact with local resources.
This change introduces conditional checks in the command handling logic to ensure that network parameters are only enforced when they are actually needed
Known limitations
User Documentation: Existing documentation may need updates to clarify the new behavior of the commands concerning local .wasm file interactions. It is essential to ensure users are aware that network parameters are optional in these cases.