This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Ensure data size of identity pallet is bounded #9168
Merged
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6bb2f4b
Ensure data size of identity pallet is bounded
KiChjang 228c939
Fix unit tests for identity pallet
KiChjang aee3907
Move identity pallet custom types into its own module
KiChjang 0ec33a2
Make use of NoBound family traits
KiChjang 86504cc
Fix identity pallet benchmarks
KiChjang f5d790e
Enumerate type imports
KiChjang d9fb577
Properly convert to BoundedVec in benchmarks
KiChjang 80d94b7
Re-export types
KiChjang ddf65ef
Use BoundedVec when storing sub identities
KiChjang 35d6fa7
Add generate_storage_info
KiChjang d2291f1
Manually implement MaxEncodedLen on select types
KiChjang cd87e24
Use ConstU32 instead of parameter_type
KiChjang cab3193
Leverage DefaultNoBound and add some comments
KiChjang 78814b6
Use max_encoded_len() instead of hardcoded constant
KiChjang be9954b
Merge remote-tracking branch 'origin/master' into kckyeung/bounded-id…
KiChjang c892b62
Use MaxEncodedLen in parity-scal-codec
KiChjang 36d917c
Add get_mut method for WeakBoundedVec
KiChjang 263c3f4
Use expect on an infallible operation
KiChjang 8d30b52
Rewrite as for loop
KiChjang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Ensure data size of identity pallet is bounded
- Loading branch information
commit 6bb2f4b93aafa4bbc408d10e0ed444f37db56151
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,6 +122,14 @@ impl<T, S> BoundedVec<T, S> { | |
| pub fn retain<F: FnMut(&T) -> bool>(&mut self, f: F) { | ||
| self.0.retain(f) | ||
| } | ||
|
|
||
| /// Exactly the same semantics as [`Vec::get_mut`]. | ||
| pub fn get_mut<I: SliceIndex<[T]>>( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There should also be the same addition to the |
||
| &mut self, | ||
| index: I, | ||
| ) -> Option<&mut <I as SliceIndex<[T]>>::Output> { | ||
| self.0.get_mut(index) | ||
| } | ||
| } | ||
|
|
||
| impl<T, S: Get<u32>> From<BoundedVec<T, S>> for Vec<T> { | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.