-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(staking): outlined undelegate invariant checks
see: #4110 (comment) emitting tracing events makes the body of `check_and_execute` more verbose. in an effort to help maintain the pleasant quality of `anyhow::ensure` listing invariants we care about, this explores outlining that logic into helper methods of `Undelegate`. this is in some respects a little "louder", but makes the `check_and_execute` a succinct list of calls: ```rust // # Invariant: the undelegation must have been prepared for the current epoch. self.check_that_undelegate_was_prepared_for_current_epoch(&state) .await?; // # Invariant: The unbonded amount must be correctly computed. self.check_that_unbonded_amount_is_correctly_computed(&state) .await?; ``` NB: git doesn't handle this sort of code motion with grace. view this diff via side-by-side view, if possible.
- Loading branch information
Showing
1 changed file
with
74 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters