Refactor device status handling: replace SoftDrained and HardDrained with Drained #2586
+36
−104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request primarily unifies the device "drained" statuses in the smart contract codebase by replacing the previous
SoftDrainedandHardDrainedstatuses with a singleDrainedstatus. It also updates the logic and tests to reflect this simplification. Additionally, there are improvements to account creation in the global config processor for better clarity and correctness.Device Status Unification and Logic Updates:
SoftDrainedandHardDrainedwith a singleDrainedstatus in bothDeviceStatusandDeviceDesiredStatusenums, updating all associated conversion, display, and parsing logic accordingly. [1] [2] [3] [4] [5] [6] [7]process_update_deviceto only allow transitions betweenActivatedandDrained, removing the previous multi-step drained transitions.Test Updates:
Drainedstatus, removing tests forSoftDrainedandHardDrained, and adjusting test step numbering for clarity. [1] [2] [3] [4]Global Config Processor Improvements:
process_set_globalconfigby usingtry_acc_createinstead of the removedtry_create_account, and added a check to ensure the correct system program is passed in. [1] [2] [3] [4]Makefile Update:
test-sbftarget totestand updated it to usecargo testfor consistency.Testing Verification