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

Try to make a genuine test fail #6

Open
pythcoiner opened this issue May 7, 2024 · 4 comments
Open

Try to make a genuine test fail #6

pythcoiner opened this issue May 7, 2024 · 4 comments

Comments

@pythcoiner
Copy link
Contributor

          > or i miss something

Yes. :) If the device fails the check, the Ledger API would return an error (well, i hope, i guess we could test this by messing with the data transmitted) and query_via_websocket would propagate this error:

} else if msg.query == "success" {
return Ok(());
} else if msg.query == "error" {
return Err(
format!("Got an 'error' query on the ws. Full message: {}.", text).into(),
);

Originally posted by @darosior in #5 (comment)

@pythcoiner
Copy link
Contributor Author

@darosior should we then change the return type of genuine_check() from

Result<(), Box<dyn error::Error>> 
       ^^

to

Result<bool, Box<dyn error::Error>>
       ^^^^ 

?

@darosior
Copy link
Owner

darosior commented May 7, 2024 via email

@pythcoiner
Copy link
Contributor Author

pythcoiner commented May 7, 2024

when the device is not genuine, but yeah the function is genuine_check() and not is_genuine() so your way makes sense

@darosior
Copy link
Owner

darosior commented May 7, 2024 via email

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

2 participants