Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
add pallets to runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
amiyatulu committed Nov 29, 2023
1 parent 7f601f6 commit e1436ef
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions runtime/node-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ profile-validation = {default-features=false, path="../../pallets/profile-valida
shared-storage = {default-features=false, path="../../pallets/shared-storage"}
profile-validation-runtime-api = {default-features=false, path="../../pallets/profile-validation/profile-validation-runtime-api"}
positive-externality-validation = {default-features = false, path="../../pallets/positive-externality-validation"}
department-funding = {default-features = false, path="../../pallets/department-funding"}
project-tips = {default-features = false, path="../../pallets/project-tips"}


[build-dependencies]
Expand Down
33 changes: 22 additions & 11 deletions runtime/node-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ pub type Index = u32;
/// A hash of some data used by the chain.
pub type Hash = sp_core::H256;


pub type ChallengePostId = u64;

/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
Expand Down Expand Up @@ -278,15 +277,14 @@ impl pallet_template::Config for Runtime {

impl pallet_insecure_randomness_collective_flip::Config for Runtime {}


impl sortition_sum_game::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = sortition_sum_game::weights::SubstrateWeight<Runtime>;
}

impl schelling_game_shared::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = schelling_game_shared::weights::SubstrateWeight<Runtime>;
type WeightInfo = schelling_game_shared::weights::SubstrateWeight<Runtime>;
type Currency = Balances;
type RandomnessSource = RandomnessCollectiveFlip;
type Slash = ();
Expand All @@ -296,7 +294,7 @@ impl schelling_game_shared::Config for Runtime {

impl profile_validation::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = profile_validation::weights::SubstrateWeight<Runtime>;
type WeightInfo = profile_validation::weights::SubstrateWeight<Runtime>;
type Currency = Balances;
type SchellingGameSharedSource = SchellingGameShared;
type Slash = ();
Expand All @@ -312,13 +310,25 @@ impl positive_externality_validation::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = positive_externality_validation::weights::SubstrateWeight<Runtime>;
type SharedStorageSource = SharedStorage;
type Currency = Balances;
type Currency = Balances;
type SchellingGameSharedSource = SchellingGameShared;
}

impl department_funding::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = department_funding::weights::SubstrateWeight<Runtime>;
type SharedStorageSource = SharedStorage;
type Currency = Balances;
type SchellingGameSharedSource = SchellingGameShared;
}



impl project_tips::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = project_tips::weights::SubstrateWeight<Runtime>;
type SharedStorageSource = SharedStorage;
type Currency = Balances;
type SchellingGameSharedSource = SchellingGameShared;
}

// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
Expand All @@ -343,7 +353,8 @@ construct_runtime!(
ProfileValidation: profile_validation,
SharedStorage: shared_storage,
PositiveExternalityValidation: positive_externality_validation,

DepartmentFunding: department_funding,
ProjectTips: project_tips,
}
);

Expand Down Expand Up @@ -634,7 +645,7 @@ impl_runtime_apis! {
fn get_evidence_period_end_block(profile_user_account: AccountId) -> Option<u32> {
ProfileValidation::get_evidence_period_end_block(profile_user_account)
}

fn get_staking_period_end_block(profile_user_account: AccountId) -> Option<u32> {
ProfileValidation::get_staking_period_end_block(profile_user_account)
}
Expand All @@ -644,15 +655,15 @@ impl_runtime_apis! {
fn get_commit_period_end_block(profile_user_account: AccountId) -> Option<u32> {
ProfileValidation::get_commit_period_end_block(profile_user_account)
}

fn get_vote_period_end_block(profile_user_account: AccountId) -> Option<u32> {
ProfileValidation::get_vote_period_end_block(profile_user_account)
}
fn selected_as_juror(profile_user_account: AccountId, who: AccountId) -> bool {
ProfileValidation::selected_as_juror(profile_user_account, who)
}
}

}

#[cfg(test)]
Expand Down

0 comments on commit e1436ef

Please sign in to comment.