-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
98 voting pallet #107
Merged
Merged
98 voting pallet #107
Changes from 21 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
94cfc73
Updating branch with main updates (#100)
letodunc 56e4f03
Merge main into voting pallet branch (#104)
letodunc 9c557f0
added voting pallet, added config in runtime
letodunc ab3e623
added collective and democracy pallets to voting pallet and runtime c…
letodunc b492d99
added collective and democracy config to runtime
letodunc 2f9f9be
updated pallet_template
letodunc 42194c7
added members to house council
letodunc 2aa0e1d
added functions to voting
letodunc 1cb16a3
added pallet roles to voting
letodunc 7ad0a04
update functions implementation
letodunc 19d04b1
added events, refactored code
letodunc 65634d3
updated test configuration
letodunc 03ebaa6
added call formating for collective::propose()
letodunc c5f71d5
added full process voting implementation with basic checks
letodunc 30fdb0a
added origin check on proposal dispatching from Democracy
letodunc 6baf939
added check origin call from collective pallet
letodunc a995d56
added proposal status transition management and documentation
letodunc 2f51df6
Merge branch 'main' into 98-voting-pallet
letodunc 4c1f726
updated voting mockup for tests
letodunc 2d70c77
Merge branch '98-voting-pallet' of https://github.com/Fair-Squares/fa…
letodunc 0d44d24
refactored code
letodunc 4a59015
removed comments
letodunc ef0d525
code review updates
letodunc 0b3cbb6
code review updates
letodunc ee82453
fix for voting benchmarking
letodunc 827df24
added fix for voting benchmarking
letodunc 74db7c9
fix update
letodunc cef7e62
temporary deactivated voting benchmarking
letodunc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[package] | ||
name = "pallet-voting" | ||
version = "4.0.0-dev" | ||
description = "FRAME pallet template for defining custom runtime logic." | ||
authors = ["Substrate DevHub <https://github.com/substrate-developer-hub>"] | ||
homepage = "https://substrate.io/" | ||
edition = "2021" | ||
license = "Unlicense" | ||
publish = false | ||
repository = "https://github.com/letodunc/substrate-node/" | ||
|
||
[package.metadata.docs.rs] | ||
targets = ["x86_64-unknown-linux-gnu"] | ||
|
||
[dependencies] | ||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ | ||
"derive", | ||
] } | ||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } | ||
frame-support = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.26"} | ||
frame-system = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.26" } | ||
frame-benchmarking = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.26", optional = true } | ||
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } | ||
pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false } | ||
pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false } | ||
pallet-balances = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.26" } | ||
pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false } | ||
pallet-sudo = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.26" } | ||
pallet-roles = { default-features = false, path="../roles" } | ||
|
||
[dev-dependencies] | ||
sp-core = { default-features = false, version = "6.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.26" } | ||
sp-io = { default-features = false, version = "6.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.26" } | ||
sp-runtime = { default-features = false, version = "6.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.26" } | ||
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } | ||
|
||
[features] | ||
default = ["std"] | ||
std = [ | ||
"codec/std", | ||
"scale-info/std", | ||
"sp-std/std", | ||
"sp-runtime/std", | ||
"frame-support/std", | ||
"frame-system/std", | ||
"frame-benchmarking/std", | ||
"pallet-collective/std", | ||
"pallet-democracy/std", | ||
"pallet-scheduler/std", | ||
"pallet-balances/std", | ||
"pallet-roles/std", | ||
"pallet-sudo/std", | ||
] | ||
|
||
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"] | ||
try-runtime = ["frame-support/try-runtime"] |
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 @@ | ||
License: Unlicense | ||
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,20 @@ | ||
//! Benchmarking setup for pallet-template | ||
|
||
use super::*; | ||
|
||
#[allow(unused)] | ||
use crate::Pallet as Voting; | ||
use frame_benchmarking::{benchmarks, whitelisted_caller}; | ||
use frame_system::RawOrigin; | ||
|
||
benchmarks! { | ||
do_something { | ||
let s in 0 .. 100; | ||
let caller: T::AccountId = whitelisted_caller(); | ||
}: _(RawOrigin::Signed(caller), s) | ||
verify { | ||
assert_eq!(Something::<T>::get(), Some(s)); | ||
} | ||
|
||
impl_benchmark_test_suite!(Voting, crate::mock::new_test_ext(), crate::mock::Test); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License Apache 2.0 or remove