-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(pallets/communities): split governance functionalities
- Loading branch information
Showing
10 changed files
with
84 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
use super::*; | ||
|
||
mod tally; | ||
mod tracks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use super::*; | ||
|
||
use frame_support::traits::VoteTally; | ||
|
||
impl<A, B> From<Vote<A, B>> for VoteWeight { | ||
fn from(_value: Vote<A, B>) -> Self { | ||
todo!() | ||
} | ||
} | ||
|
||
impl<T: Config> VoteTally<VoteWeight, CommunityIdOf<T>> for Tally<T> { | ||
fn new(_: CommunityIdOf<T>) -> Self { | ||
todo!() | ||
} | ||
|
||
fn ayes(&self, _cid: CommunityIdOf<T>) -> VoteWeight { | ||
todo!() | ||
} | ||
|
||
fn support(&self, _cid: CommunityIdOf<T>) -> sp_runtime::Perbill { | ||
todo!() | ||
} | ||
|
||
fn approval(&self, _cid: CommunityIdOf<T>) -> sp_runtime::Perbill { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use super::*; | ||
|
||
use pallet_referenda::{Track, TracksInfo}; | ||
use sp_std::borrow::Cow; | ||
|
||
// #[cfg(feature = "referenda")] | ||
impl<T: Config> TracksInfo<VoteWeight, BlockNumberFor<T>> for CommunityTracks<T> { | ||
type Id = T::CommunityId; | ||
type RuntimeOrigin = RuntimeOriginOf<T>; | ||
|
||
fn tracks() -> impl Iterator<Item = Cow<'static, Track<Self::Id, types::VoteWeight, BlockNumberFor<T>>>> { | ||
//TODO: Convert from a list of community IDs to list of tracks" | ||
|
||
// Info::<T>::iter_keys().map(|community_id| Track { | ||
// id: community_id, | ||
// info: TrackInfo { | ||
// name: "".into(), | ||
// max_deciding: 0, | ||
// decision_deposit: 0, | ||
// prepare_period: 100, | ||
// decision_period: 100, | ||
// confirm_period: 100, | ||
// min_enactment_period: 100, | ||
// min_approval: pallet_referenda::Curve::LinearDecreasing { | ||
// length: 1.into(), | ||
// floor: 1.into(), | ||
// ceil: 1.into(), | ||
// }, | ||
// min_support: pallet_referenda::Curve::LinearDecreasing { | ||
// length: 1.into(), | ||
// floor: 1.into(), | ||
// ceil: 1.into(), | ||
// }, | ||
// }, | ||
// }) | ||
|
||
vec![].into_iter() | ||
} | ||
|
||
fn track_for(_origin: &Self::RuntimeOrigin) -> Result<Self::Id, ()> { | ||
todo!("Convert the signed as community account id into the track Id for the community track") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ pub(self) use types::*; | |
|
||
mod challenges; | ||
mod getters; | ||
mod governance; | ||
mod membership; | ||
mod registry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[toolchain] | ||
channel = "nightly-2023-10-30" | ||
components = [ "rustfmt" ] | ||
targets = [ "wasm32-unknown-unknown" ] | ||
profile = "minimal" | ||
channel = "nightly" | ||
components = ["rustfmt"] | ||
targets = ["wasm32-unknown-unknown"] | ||
profile = "minimal" |