Introduce srml/scored-pool (#3381)
* Introduce srml/scored-pool
* Bump impl_version
* Apply suggestions from code review
Co-Authored-By:
Bastian Köcher <bkchr@users.noreply.github.com>
* Remove unnecessary pub use
* Remove unnecessary import
* Adapt to InitializeMembers
* Bump impl_version
* Implement remarks (shortens code)
* Improve complexity of score()
Search and remove and search again for the
new spot and insert then => O(2LogN).
* Get rid of a clone()
* Reduce complexity of issue_candidacy()
* Add CandidateScored event + Improve comments
* Fix naming
* Use Lookup instead of AccountId as param
* Use set_members_sorted instead of computing diff
* Remove function which is only used during genesis
* Get rid of rev() by changing sort order of Pool
* Rename issue_candidacy to submit_candidacy
* Shorten code
* Remove find_in_pool() and have transactor submit index
* Remove unnecessary dependency
* Improve error messages
* Improve naming
* Improve comments
* Make code clearer wrt which receiver to invoke
* Adapt to new system trait
* Refactor to request CandidateDeposit only once
* Refactor to request Pool only once
* Improve structure and comments
Showing
- substrate/Cargo.lock 15 additions, 0 deletionssubstrate/Cargo.lock
- substrate/Cargo.toml 1 addition, 0 deletionssubstrate/Cargo.toml
- substrate/core/sr-std/src/lib.rs 1 addition, 1 deletionsubstrate/core/sr-std/src/lib.rs
- substrate/node/runtime/src/lib.rs 1 addition, 1 deletionsubstrate/node/runtime/src/lib.rs
- substrate/srml/scored-pool/Cargo.toml 30 additions, 0 deletionssubstrate/srml/scored-pool/Cargo.toml
- substrate/srml/scored-pool/src/lib.rs 457 additions, 0 deletionssubstrate/srml/scored-pool/src/lib.rs
- substrate/srml/scored-pool/src/mock.rs 177 additions, 0 deletionssubstrate/srml/scored-pool/src/mock.rs
- substrate/srml/scored-pool/src/tests.rs 283 additions, 0 deletionssubstrate/srml/scored-pool/src/tests.rs
Please register or sign in to comment