Implementing MaxEncodedLen for generate_solution_type (#11032)

* Move `sp-npos-elections-solution-type`
to `frame-election-provider-support`
First stab at it, will need to amend some more stuff

* Fixing tests

* Fixing tests

* Fixing cargo.toml for std configuration

* Implementing `MaxEncodedLen`
on `generate_solution_type`

* Full implementation of `max_encoded_len`

* Fixing implementation bug
adding some comments and documentation

* fmt

* Committing suggested changes
renaming, and re exporting macro.

* Removing unneeded imports

* Implementing `MaxEncodedLen`
on `generate_solution_type`

* Full implementation of `max_encoded_len`

* Fixing implementation bug
adding some comments and documentation

* Move `NposSolution` to frame

* Implementing `MaxEncodedLen`
on `generate_solution_type`

* Full implementation of `max_encoded_len`

* Fixing implementation bug
adding some comments and documentation

* Fixing test

* Removing unneeded dependencies

* `VoterSnapshotPerBlock` -> `MaxElectingVoters`

* rename `SizeBound` to `MaxVoters`

* Removing TODO and change bound

* renaming `size_bound` to `max_voters`

* Enabling tests for `solution-type`
These got dropped off after the crate was moved from `sp_npos_elections`

* Adding tests for `MaxEncodedLen` of solution_type

* Better rustdocs. Better indenting and comments.
Removing unneeded imports in tests.
This commit is contained in:
Georges
2022-03-23 09:14:44 +00:00
committed by GitHub
parent a1008016b7
commit e0cef34921
20 changed files with 184 additions and 12 deletions
+3
View File
@@ -2167,6 +2167,7 @@ name = "frame-election-provider-solution-type"
version = "4.0.0-dev"
dependencies = [
"frame-election-provider-support",
"frame-support",
"parity-scale-codec",
"proc-macro-crate 1.1.3",
"proc-macro2",
@@ -2185,6 +2186,7 @@ dependencies = [
"frame-support",
"frame-system",
"parity-scale-codec",
"rand 0.7.3",
"scale-info",
"sp-arithmetic",
"sp-core",
@@ -2201,6 +2203,7 @@ dependencies = [
"clap 3.1.6",
"frame-election-provider-solution-type",
"frame-election-provider-support",
"frame-support",
"honggfuzz",
"parity-scale-codec",
"rand 0.8.4",