-
Notifications
You must be signed in to change notification settings - Fork 60
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
rusk-wallet: Add stdout_format flag to binary #2700
base: master
Are you sure you want to change the base?
Conversation
What about situations where the wallet file is missing? Should the error be JSON wrapped to also be parsable? What if there's no stake for a given key? Should it return that as an error or just have all values default to zero? Since having no stake or rewards is equivalent to not having a key that stakes. |
@HDauven I added a |
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.
We should inform the user about the invalid eligibility
Add `to_json` for `RunResult` Remove duplicate code in main.rs
} else { | ||
writeln!(f, "> No active stake found for this key")?; |
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.
Why this has been removed?
if want_json { | ||
stdout_res = run_res.to_json(); |
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.
Can you put an if else and avoid to "run_res.to_string()"?
impl fmt::Display for RunResult<'_> { | ||
impl<'a> RunResult<'a> { | ||
/// Convert the ran result into json | ||
pub fn to_json(&self) -> String { |
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.
Why don't you implement serde::Serialize for RunResult?
Closes #2664
to_json
forRunResult
Fetch moonlight address
Find stake-info