-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jason/NNS1-2935-6' into 'master'
refactor(nns): NNS1-2935 Refactor Neuron methods related to dissolve state and age into methods on the enum The main goal is to make the Neuron type have a dissolve_state_and_age member, instead of dissolve_state and aging_since_timestamp_seconds. Therefore the methods that mostly operate on the existing 2 fields are refactored into methods on the dissolve_state_and_age enum. In the next MRs, more methods will be moved in a similar way, and after no Neuron methods directly use the existing 2 fields, those 2 fields can be replaced by a single member dissolve_state_and_age easily. Other notes: 1. Some "deprecated\_..." methods are introduced to provide a temporary way of operating directly on those 2 fields, which will be no longer needed once https://gitlab.com/dfinity-lab/public/ic/-/merge_requests/18705 is merged. 2. The logic in increase_dissolve_delay is pretty complicated. Other than the tests added in this MR, the existing tests (in neuron/mod.rs) also helps make sure there is no regression. The new tests (against DissolveStateAndAge) are added based on the existing tests, and the existing tests will be deleted in the next MR. They are not deleted in this MR so that we can be more certain that the refactoring still pass those tests. See merge request dfinity-lab/public/ic!18732
- Loading branch information
Showing
16 changed files
with
713 additions
and
133 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
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
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
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
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
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
Oops, something went wrong.