custom weight function wrapper (#4158)

* custom weight function wrapper

* dox

* Better tests.

* remove u8 encoding

* Update frame/support/src/weights.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* fix pays fee

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Kian Paimani
2020-01-14 08:41:18 +01:00
committed by GitHub
parent 5c0bdd339f
commit 4a353f1e81
3 changed files with 73 additions and 4 deletions
-1
View File
@@ -1628,7 +1628,6 @@ impl<T: Trait> Module<T> {
/// For each element in the iterator the given number of points in u32 is added to the
/// validator, thus duplicates are handled.
pub fn reward_by_indices(validators_points: impl IntoIterator<Item = (u32, u32)>) {
// TODO: This can be optimised once #3302 is implemented.
let current_elected_len = <Module<T>>::current_elected().len() as u32;
CurrentEraPointsEarned::mutate(|rewards| {
-3
View File
@@ -649,9 +649,6 @@ fn pay_reporters<T: Trait>(
T::Slash::on_unbalanced(value_slashed);
}
// TODO: function for undoing a slash.
//
#[cfg(test)]
mod tests {
use super::*;