-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate blacklist token to use shared mutable (#5885)
Closes #4760 This fully migrates the `TokenBlacklist` contract to use a `SharedMutable` state variable instead of the slow updates tree. It mostly consists of deleting things we no longer need, like tree simulation, initialization, capsule creation and pushing, etc. The only relevant change is that `SharedMutable` does not allow for scheduling from private. This is trivially achievable though by making an internal public function that does this and then privately call it (which is what the slow tree did), but this hardly seemed relevant so I simply made the `set_roles` function public. --- ## Macros and Storage Slots This PR also references #5736, since it shows how that forces us to implement `Serialize` even when we don't need to. It also ends up being useless, since what we need to store is a `ScheduledValueChange<UserFlags>`, which has a serialize length of 3, and not a `UserFlags` (even though the state variable is `SharedMutable<UserFlags>`). It's a good example of state variables implementing custom data structures that may require storage separate from the underlying type. --------- Co-authored-by: ludamad <adam.domurad@gmail.com>
- Loading branch information
Showing
3 changed files
with
213 additions
and
460 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
Oops, something went wrong.