Remove Default derive from AccountMapEntry#8146
Merged
kskalski merged 1 commit intoanza-xyz:masterfrom Sep 23, 2025
Merged
Conversation
kskalski
commented
Sep 23, 2025
| { | ||
| // add an entry with an empty slot list | ||
| let val = Arc::new(AccountMapEntry::<u64>::default()); | ||
| let val = Arc::new(AccountMapEntry::<u64>::empty_for_tests()); |
Author
There was a problem hiding this comment.
We could possibly create entry with new(defaults...), but I think having function encapsulates this use case better and hides what exact values are used for initialization
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8146 +/- ##
=======================================
Coverage 83.0% 83.0%
=======================================
Files 826 826
Lines 362192 362199 +7
=======================================
+ Hits 300755 300761 +6
- Misses 61437 61438 +1 🚀 New features to boost your workflow:
|
brooksprumo
approved these changes
Sep 23, 2025
brooksprumo
left a comment
There was a problem hiding this comment.
![]()
I agree this shouldn't drive Default.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Default account map entry isn't really a valid value that production code creates to put into the map, there are just a few uses in tests that create artificial state.
Summary of Changes
Defaultderive fromAccountMapEntryempty_for_testsguarded withcfg(test)such that tests can still use a convenience function