mirror of
https://git.ghostchain.io/proxmio/ghost-node.git
synced 2025-12-27 19:29:56 +00:00
rustfmt casper runtime and fix typos
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
@@ -2,25 +2,34 @@ use super::*;
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{
|
||||
EitherOf, EitherOfDiverse, MapSuccess, OriginTrait, TryWithMorphedArg,
|
||||
tokens::pay::PayFromAccount,
|
||||
tokens::pay::PayFromAccount, EitherOf, EitherOfDiverse, MapSuccess, OriginTrait,
|
||||
TryWithMorphedArg,
|
||||
},
|
||||
};
|
||||
use frame_system::EnsureRootWithSuccess;
|
||||
use pallet_ranked_collective::EnsureOfRank;
|
||||
use sp_core::{ConstU128, ConstU32};
|
||||
use sp_runtime::traits::{ConstU16, TakeFirst};
|
||||
use pallet_ranked_collective::EnsureOfRank;
|
||||
|
||||
use crate::{
|
||||
// weights,
|
||||
RuntimeCall, RuntimeEvent, Scheduler, DAYS, CSPR, AccountId, Balance,
|
||||
TreasuryAccount, Balances, Preimage, Runtime,
|
||||
AccountId,
|
||||
Balance,
|
||||
Balances,
|
||||
Preimage,
|
||||
Runtime,
|
||||
// weights,
|
||||
RuntimeCall,
|
||||
RuntimeEvent,
|
||||
Scheduler,
|
||||
TreasuryAccount,
|
||||
CSPR,
|
||||
DAYS,
|
||||
};
|
||||
|
||||
mod origins;
|
||||
pub use origins::{
|
||||
pallet_cult_origins, Geniuses, Degens, Zombies, Skeletons, Ghosts,
|
||||
EnsureCanRetainAt, EnsureCanPromoteTo, EnsureCult, ToVoice, CultTreasurySpender,
|
||||
pallet_cult_origins, CultTreasurySpender, Degens, EnsureCanPromoteTo, EnsureCanRetainAt,
|
||||
EnsureCult, Geniuses, Ghosts, Skeletons, ToVoice, Zombies,
|
||||
};
|
||||
|
||||
mod tracks;
|
||||
@@ -45,14 +54,10 @@ parameter_types! {
|
||||
impl pallet_whitelist::Config for Runtime {
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type WhitelistOrigin = EitherOfDiverse<
|
||||
EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>,
|
||||
Skeletons,
|
||||
>;
|
||||
type DispatchWhitelistedOrigin = EitherOf<
|
||||
EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>,
|
||||
Geniuses,
|
||||
>;
|
||||
type WhitelistOrigin =
|
||||
EitherOfDiverse<EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>, Skeletons>;
|
||||
type DispatchWhitelistedOrigin =
|
||||
EitherOf<EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>, Geniuses>;
|
||||
type Preimages = Preimage;
|
||||
type WeightInfo = weights::pallet_whitelist::WeightInfo<Runtime>;
|
||||
}
|
||||
@@ -71,7 +76,7 @@ impl pallet_referenda::Config<CultReferendaInstance> for Runtime {
|
||||
type Scheduler = Scheduler;
|
||||
type Currency = Balances;
|
||||
type SubmitOrigin = EitherOf<
|
||||
pallet_ranked_collective::EnsureMember<Runtime, CultCollectiveInstance, 3>,
|
||||
pallet_ranked_collective::EnsureMember<Runtime, CultCollectiveInstance, 3>,
|
||||
MapSuccess<
|
||||
TryWithMorphedArg<
|
||||
RuntimeOrigin,
|
||||
@@ -81,7 +86,7 @@ impl pallet_referenda::Config<CultReferendaInstance> for Runtime {
|
||||
(AccountId, u16),
|
||||
>,
|
||||
TakeFirst,
|
||||
>
|
||||
>,
|
||||
>;
|
||||
type CancelOrigin = Skeletons;
|
||||
type KillOrigin = Ghosts;
|
||||
@@ -100,7 +105,7 @@ pub type CultCollectiveInstance = pallet_ranked_collective::Instance1;
|
||||
impl pallet_ranked_collective::Config<CultCollectiveInstance> for Runtime {
|
||||
type WeightInfo = weights::pallet_ranked_collective::WeightInfo<Runtime>;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
|
||||
|
||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||
type PromoteOrigin = frame_system::EnsureNever<pallet_ranked_collective::Rank>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
@@ -123,7 +128,7 @@ impl pallet_ranked_collective::Config<CultCollectiveInstance> for Runtime {
|
||||
type MinRankOfClass = tracks::MinRankOfClass;
|
||||
type MemberSwappedHandler = (crate::CultCore, crate::CultSalary);
|
||||
type VoteWeight = pallet_ranked_collective::Geometric;
|
||||
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type BenchmarkSetup = (crate::CultCore, crate::CultSalary);
|
||||
}
|
||||
@@ -135,10 +140,13 @@ impl pallet_core_fellowship::Config<CultCoreInstance> for Runtime {
|
||||
type Members = pallet_ranked_collective::Pallet<Runtime, CultCollectiveInstance>;
|
||||
type Balance = Balance;
|
||||
|
||||
type ParamsOrigin = EitherOf<EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>, Skeletons>;
|
||||
type ParamsOrigin =
|
||||
EitherOf<EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>, Skeletons>;
|
||||
type InductOrigin = EitherOf<EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>, Zombies>;
|
||||
type ApproveOrigin = EitherOf<EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>, EnsureCanRetainAt>;
|
||||
type PromoteOrigin = EitherOf<EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>, EnsureCanPromoteTo>;
|
||||
type ApproveOrigin =
|
||||
EitherOf<EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>, EnsureCanRetainAt>;
|
||||
type PromoteOrigin =
|
||||
EitherOf<EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>, EnsureCanPromoteTo>;
|
||||
|
||||
type EvidenceSize = ConstU32<65536>;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ pub use pallet_cult_origins::*;
|
||||
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet_cult_origins {
|
||||
use crate::{Balance, CSPR};
|
||||
use super::ranks;
|
||||
use crate::{Balance, CSPR};
|
||||
use frame_support::pallet_prelude::*;
|
||||
use pallet_ranked_collective::Rank;
|
||||
|
||||
@@ -114,7 +114,7 @@ pub mod pallet_cult_origins {
|
||||
}
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn try_successful_origin() -> Result<O, ()> {
|
||||
// By convention the more privileged origins go later,
|
||||
// By convention the more privileged origins go later,
|
||||
// so for greatest chance of success, we want the last one.
|
||||
let _result: Result<O, ()> = Err(());
|
||||
$(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::{Balance, BlockNumber, RuntimeOrigin, DAYS, CSPR, HOURS, MINUTES};
|
||||
use crate::{Balance, BlockNumber, RuntimeOrigin, CSPR, DAYS, HOURS, MINUTES};
|
||||
use pallet_ranked_collective::Rank;
|
||||
use sp_runtime::{traits::Convert, Perbill};
|
||||
|
||||
@@ -255,7 +255,6 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
|
||||
min_support: RETAIN_MIN_SUPPORT,
|
||||
},
|
||||
),
|
||||
|
||||
(
|
||||
constants::PROMOTE_TO_GENIUSES,
|
||||
pallet_referenda::TrackInfo {
|
||||
@@ -347,7 +346,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
// It is important that this is NOT availiable in production!
|
||||
let root: Self::RuntimeOrigin = frame_system::RawOrigin::Root.into();
|
||||
if &root == id {
|
||||
return Ok(tracks::GHOSTS)
|
||||
return Ok(tracks::GHOSTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user