mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-10 01:47:27 +00:00
pallet-referenda: make the pallet instanceable (#11089)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
@@ -59,7 +59,7 @@ impl From<BeginDecidingBranch> for ServiceBranch {
|
||||
|
||||
impl ServiceBranch {
|
||||
/// Return the weight of the `nudge` function when it takes the branch denoted by `self`.
|
||||
pub fn weight_of_nudge<T: Config>(self) -> frame_support::weights::Weight {
|
||||
pub fn weight_of_nudge<T: Config<I>, I: 'static>(self) -> frame_support::weights::Weight {
|
||||
use ServiceBranch::*;
|
||||
match self {
|
||||
NoDeposit => T::WeightInfo::nudge_referendum_no_deposit(),
|
||||
@@ -81,7 +81,7 @@ impl ServiceBranch {
|
||||
}
|
||||
|
||||
/// Return the maximum possible weight of the `nudge` function.
|
||||
pub fn max_weight_of_nudge<T: Config>() -> frame_support::weights::Weight {
|
||||
pub fn max_weight_of_nudge<T: Config<I>, I: 'static>() -> frame_support::weights::Weight {
|
||||
0.max(T::WeightInfo::nudge_referendum_no_deposit())
|
||||
.max(T::WeightInfo::nudge_referendum_preparing())
|
||||
.max(T::WeightInfo::nudge_referendum_queued())
|
||||
@@ -101,7 +101,9 @@ impl ServiceBranch {
|
||||
|
||||
/// Return the weight of the `place_decision_deposit` function when it takes the branch denoted
|
||||
/// by `self`.
|
||||
pub fn weight_of_deposit<T: Config>(self) -> Option<frame_support::weights::Weight> {
|
||||
pub fn weight_of_deposit<T: Config<I>, I: 'static>(
|
||||
self,
|
||||
) -> Option<frame_support::weights::Weight> {
|
||||
use ServiceBranch::*;
|
||||
Some(match self {
|
||||
Preparing => T::WeightInfo::place_decision_deposit_preparing(),
|
||||
@@ -124,7 +126,7 @@ impl ServiceBranch {
|
||||
}
|
||||
|
||||
/// Return the maximum possible weight of the `place_decision_deposit` function.
|
||||
pub fn max_weight_of_deposit<T: Config>() -> frame_support::weights::Weight {
|
||||
pub fn max_weight_of_deposit<T: Config<I>, I: 'static>() -> frame_support::weights::Weight {
|
||||
0.max(T::WeightInfo::place_decision_deposit_preparing())
|
||||
.max(T::WeightInfo::place_decision_deposit_queued())
|
||||
.max(T::WeightInfo::place_decision_deposit_not_queued())
|
||||
@@ -154,7 +156,7 @@ impl From<BeginDecidingBranch> for OneFewerDecidingBranch {
|
||||
impl OneFewerDecidingBranch {
|
||||
/// Return the weight of the `one_fewer_deciding` function when it takes the branch denoted
|
||||
/// by `self`.
|
||||
pub fn weight<T: Config>(self) -> frame_support::weights::Weight {
|
||||
pub fn weight<T: Config<I>, I: 'static>(self) -> frame_support::weights::Weight {
|
||||
use OneFewerDecidingBranch::*;
|
||||
match self {
|
||||
QueueEmpty => T::WeightInfo::one_fewer_deciding_queue_empty(),
|
||||
@@ -164,7 +166,7 @@ impl OneFewerDecidingBranch {
|
||||
}
|
||||
|
||||
/// Return the maximum possible weight of the `one_fewer_deciding` function.
|
||||
pub fn max_weight<T: Config>() -> frame_support::weights::Weight {
|
||||
pub fn max_weight<T: Config<I>, I: 'static>() -> frame_support::weights::Weight {
|
||||
0.max(T::WeightInfo::one_fewer_deciding_queue_empty())
|
||||
.max(T::WeightInfo::one_fewer_deciding_passing())
|
||||
.max(T::WeightInfo::one_fewer_deciding_failing())
|
||||
|
||||
Reference in New Issue
Block a user