Skip to content
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

Invalid argument error #1

Closed
j-ti opened this issue Jul 5, 2023 · 2 comments
Closed

Invalid argument error #1

j-ti opened this issue Jul 5, 2023 · 2 comments
Assignees

Comments

@j-ti
Copy link
Contributor

j-ti commented Jul 5, 2023

The current version compiles, the module can be imported, however when using the module, a invalid argument error appears. Which is most probably due to the wrong use of commands in this simple test case.

Plan: I now want to switch from the simple balance example test case to the actual BEST-Energy calls of the updated dependency.
Addresses: olisystems/BEST-Energy#40

Version 1 (current): Using parse from vec
Version 2: Use commands.rs definition to create a Command and insert it as paramter in Cli constructor

Output of Version 1

python run_integritee_cli.py
Run Cli
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { inner: ErrorInner { kind: UnknownArgument, context: [(InvalidArg, String("abc")), (Usage, String("USAGE:\n    balanced [OPTIONS] <SUBCOMMAND>"))], message: None, source: None, help_flag: Some("--help"), color_when: Auto, wait_on_exit: false, backtrace: None }, kind: UnknownArgument, info: ["abc"] }', src/lib.rs:18:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "run_integritee_cli.py", line 9, in <module>
    integritee_cli_py.run_cli(node_url, node_port, worker_url, trusted_worker_port, "balanced")
pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: Error { inner: ErrorInner { kind: UnknownArgument, context: [(InvalidArg, String("abc")), (Usage, String("USAGE:\n    balanced [OPTIONS] <SUBCOMMAND>"))], message: None, source: None, help_flag: Some("--help"), color_when: Auto, wait_on_exit: false, backtrace: None }, kind: UnknownArgument, info: ["abc"] }
@j-ti j-ti self-assigned this Jul 5, 2023
@j-ti
Copy link
Contributor Author

j-ti commented Jul 5, 2023

Verson2:
Currently it is not possible to directly use the trusted commands in src/lib.rs as trusted_base_cli is a private module, i.e.

# not possible
use integritee_cli::trusted_base_cli::commands;

@j-ti
Copy link
Contributor Author

j-ti commented Jul 19, 2023

Adopt version 2: Established by merge #2 including changes in dependency to make things public

@j-ti j-ti closed this as completed Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant