-
Notifications
You must be signed in to change notification settings - Fork 358
feat(sdk,ffi): add CheckCodeSender::validate()
#5957
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
base: main
Are you sure you want to change the base?
Conversation
…ate check code without sending the value
CheckCodeSender::validate() to allow UI to valid…CheckCodeSender::validate()
CodSpeed Performance ReportMerging #5957 will degrade performances by 39.25%Comparing Summary
Benchmarks breakdown
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5957 +/- ##
==========================================
+ Coverage 88.51% 88.52% +0.01%
==========================================
Files 363 363
Lines 103469 103480 +11
Branches 103469 103480 +11
==========================================
+ Hits 91582 91603 +21
+ Misses 7533 7522 -11
- Partials 4354 4355 +1 ☔ View full report in Codecov by Sentry. |
|
I will add some test coverage to this. |
| /// Returns `true` if the code is valid, `false` otherwise. | ||
| pub fn validate(&self, check_code: u8) -> bool { | ||
| self.inner.validate(check_code) | ||
| } |
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 introducing a new method? The existing send could fail fast if the code is not correct after a local check.
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.
Actually it's probably not a good idea to never send the code. So maybe add a parameter to the send method like validate: Boolean?
This is quite equivalent, so feel free to ignore my comments ;)
The purpose of this is to allow the UI to validate the entered check code and provide user with the ability to retry entering the code.
he existing
send()function is one shot and does not allow for retries.This is for use in a scenario where the user has mistyped the code rather than where a MITM attack has been detected.
I'm not wedded to the
validate()name, so if something else is preferable I can change it.Signed-off-by: Hugh Nimmo-Smith [email protected]