Skip to content

Commit

Permalink
More efficient identity and multiplier weight to fee (paritytech#11226)
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc authored and godcodehunter committed Jun 22, 2022
1 parent 5a52827 commit 3a6135a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frame/support/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,10 @@ where
degree: 1,
})
}

fn calc(weight: &Weight) -> Self::Balance {
Self::Balance::saturated_from(*weight)
}
}

/// Implementor of [`WeightToFeePolynomial`] that uses a constant multiplier.
Expand Down Expand Up @@ -738,6 +742,10 @@ where
degree: 1,
})
}

fn calc(weight: &Weight) -> Self::Balance {
Self::Balance::saturated_from(*weight).saturating_mul(M::get())
}
}

/// A struct holding value for each `DispatchClass`.
Expand Down

0 comments on commit 3a6135a

Please sign in to comment.