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
Implementing MaxEncodedLen for generate_solution_type
#11032
Merged
paritytech-processbot
merged 34 commits into
paritytech:master
from
georgesdib:election-solution-bounded
Mar 23, 2022
Merged
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
605c893
Move `sp-npos-elections-solution-type`
020cd99
Fixing tests
676923d
Fixing tests
7c31687
Fixing cargo.toml for std configuration
79538d2
Implementing `MaxEncodedLen`
4dac1d2
Full implementation of `max_encoded_len`
38dc2fa
Fixing implementation bug
d034a12
Merge branch 'paritytech:master' into election-solution-bounded-move
georgesdib bb71738
fmt
dbf082b
Merge branch 'paritytech:master' into election-solution-bounded-move
georgesdib 4ba1eea
Committing suggested changes
4fb9569
Merge branch 'election-solution-bounded-move' of https://github.com/g…
a076c9b
Removing unneeded imports
505f5aa
Implementing `MaxEncodedLen`
dff988d
Full implementation of `max_encoded_len`
4c37fbb
Fixing implementation bug
2a6f778
rebase
45d778c
Move `NposSolution` to frame
e9db59e
Merge branch 'master' into support-to-frame
626878d
Implementing `MaxEncodedLen`
d57cd90
Full implementation of `max_encoded_len`
6759535
Fixing implementation bug
563d00d
Merge branch 'election-solution-bounded' of https://github.com/george…
64b083a
Fixing test
529b5cd
Merge master
5b01e89
Removing unneeded dependencies
51dd862
Merge master
6848ce1
`VoterSnapshotPerBlock` -> `MaxElectingVoters`
0883324
rename `SizeBound` to `MaxVoters`
d3b06c6
Removing TODO and change bound
0cd8944
renaming `size_bound` to `max_voters`
38c0cf5
Enabling tests for `solution-type`
084e586
Adding tests for `MaxEncodedLen` of solution_type
0578224
Better rustdocs. Better indenting and comments.
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
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
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
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
10 changes: 10 additions & 0 deletions
10
frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.rs
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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| use frame_election_provider_solution_type::generate_solution_type; | ||
|
|
||
| generate_solution_type!(pub struct TestSolution::< | ||
| VoterIndex = u16, | ||
| TargetIndex = u8, | ||
| Accuracy = Perbill, | ||
| frame_support::traits::ConstU32::<10>, | ||
| >(8)); | ||
|
|
||
| fn main() {} |
5 changes: 5 additions & 0 deletions
5
frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.stderr
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| error: Expected binding: `MaxVoters = ...` | ||
| --> tests/ui/fail/missing_size_bound.rs:7:2 | ||
| | | ||
| 7 | frame_support::traits::ConstU32::<10>, | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
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
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
Oops, something went wrong.
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.