-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat(leaser): migrate leases in batches #99
Conversation
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.
May the 4th was not with us today. 😞
contracts/leaser/src/migrate.rs
Outdated
if leases_nb <= self.leases_left { | ||
self.leases_left -= leases_nb; |
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.
My point was that because of how we compile it, it will check again for underflow.
My general idea was to use if let Some(result) = self.leases_left.checked_sub(leases_nb) { ... } else { Some(Ok(customer.customer)) }
. Just to simplify the binary that will be generated.
No description provided.