pallet_governance/
config.rs

1use codec::{Decode, Encode, MaxEncodedLen};
2use polkadot_sdk::{
3    frame_election_provider_support::Get, frame_support::DebugNoBound,
4    polkadot_sdk_frame::prelude::BlockNumberFor, sp_runtime::Percent,
5};
6use scale_info::TypeInfo;
7
8use crate::BalanceOf;
9
10#[derive(Clone, TypeInfo, Decode, Encode, PartialEq, Eq, DebugNoBound, MaxEncodedLen)]
11#[scale_info(skip_type_params(T))]
12pub struct GovernanceConfiguration<T: crate::Config> {
13    pub proposal_cost: BalanceOf<T>,
14    pub proposal_expiration: BlockNumberFor<T>,
15    pub agent_application_cost: BalanceOf<T>,
16    pub agent_application_expiration: BlockNumberFor<T>,
17    pub proposal_reward_treasury_allocation: Percent,
18    pub max_proposal_reward_treasury_allocation: BalanceOf<T>,
19    pub proposal_reward_interval: BlockNumberFor<T>,
20}
21
22impl<T: crate::Config> Default for GovernanceConfiguration<T> {
23    fn default() -> Self {
24        Self {
25            proposal_cost: T::DefaultProposalCost::get(),
26            proposal_expiration: T::DefaultProposalExpiration::get(), //130_000,
27            agent_application_cost: T::DefaultAgentApplicationCost::get(), /* 100_000_000_000_000_000_000, */
28            agent_application_expiration: T::DefaultAgentApplicationExpiration::get(), //2_000,
29            proposal_reward_treasury_allocation: T::DefaultProposalRewardTreasuryAllocation::get(), /* Percent::from_percent(2), */
30            max_proposal_reward_treasury_allocation:
31                T::DefaultMaxProposalRewardTreasuryAllocation::get(), /* 10_000_000_000_000_000_000_000, */
32            proposal_reward_interval: T::DefaultProposalRewardInterval::get(), //75_600,
33        }
34    }
35}