Skip to content
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

[Communities] ValidationChallenge trait #321

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f9a719c
feat(pallets): pallet-communities
pandres95 Sep 4, 2023
99cde01
Handling a community-governed treasury account (#299)
pandres95 Sep 19, 2023
1b9868a
Enrolling/removing members from a community (#297)
pandres95 Sep 19, 2023
024eec2
Handling a community-governed treasury account (#300)
pandres95 Sep 28, 2023
1de3dc9
[Communities] Refactor pallet structure (#312)
pandres95 Oct 6, 2023
4fc82df
[Communities] Governance V0: Enqueue and Execute calls (#313)
pandres95 Oct 30, 2023
a44e916
Cleanup unneeded extrinsics and configs
olanod Oct 31, 2023
a4d74f6
Remove governance implementation in favor of integration with pallet …
olanod Oct 31, 2023
14ecf35
Use pallet-referenda and PolkadotSDK form workspace
olanod Nov 21, 2023
2cc20a2
[Communities] Promoting/demoting members within the Community (#324)
pandres95 Nov 23, 2023
efcd9d8
fix: lint
pandres95 Nov 24, 2023
ff53773
chore: update rust-toolchain.toml
pandres95 Nov 24, 2023
a4de6ba
Handling a community-governed treasury account (#299)
pandres95 Sep 19, 2023
3cb9a9a
Enrolling/removing members from a community (#297)
pandres95 Sep 19, 2023
c360381
Cleanup unneeded extrinsics and configs
olanod Oct 31, 2023
e1c71bd
Remove governance implementation in favor of integration with pallet …
olanod Oct 31, 2023
55aa9d4
chore(pallets/communities): split governance functionalities
pandres95 Nov 10, 2023
42b3ed4
fix(pallets/communities): cleanup governance codebase + lint
pandres95 Nov 16, 2023
c31882e
feat(communities:traits): declare ValidationChallenge trait
pandres95 Nov 8, 2023
40b00d5
feat(communities:functions): implement ValidationChallenge trait on p…
pandres95 Nov 8, 2023
c1da55f
chore(communities:tests): add mock pallet to call on ValidationChalle…
pandres95 Nov 8, 2023
2c33d8a
chore(tests): fixup tests to match new validation schema
pandres95 Nov 8, 2023
6d154d6
chore(pallets/communities): split governance functionalities
pandres95 Nov 10, 2023
5ec314d
fix: lint
pandres95 Nov 19, 2023
6d6b292
fix: resolve missing codebase from rebasing
pandres95 Nov 22, 2023
6db53fa
fix: lint + fmt
pandres95 Nov 22, 2023
63579bb
fix: missing traits/mod.rs
pandres95 Nov 24, 2023
c37ca79
fix(pallets/communities): missing ensure_member on promote_member and…
pandres95 Nov 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,085 changes: 599 additions & 486 deletions Cargo.lock

Large diffs are not rendered by default.

92 changes: 48 additions & 44 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ pallet-asset-registry = { default-features = false, path = "pallets/asset-regist
pallet-burner = { default-features = false, path = "pallets/burner" }
pallet-lockdown-mode = { default-features = false, path = "pallets/lockdown-mode" }
pallet-payments = { default-features = false, path = "pallets/payments" }

pallet-communities = { default-features = false, path = "pallets/communities" }

# Virto common
virto-common = { default-features = false, path = "runtime/common" }
virto-common = { default-features = false, path = "runtime/common" }

# Substrate std
try-runtime-cli = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
Expand All @@ -67,7 +67,7 @@ sc-consensus = { git = "https://github.com/virto-network/polkadot-sdk", branch =
sc-cli = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
sc-client-api = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
sc-executor = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
sc-service = {git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
sc-service = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
sc-telemetry = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
sc-transaction-pool = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
sc-network = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
Expand Down Expand Up @@ -105,54 +105,56 @@ sp-version = { default-features = false, git = "https://github.com/virto-network
sp-weights = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }

# Build Dependencies
substrate-build-script-utils = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
substrate-build-script-utils = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
substrate-wasm-builder = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }

## Substrate FRAME Dependencies
frame-try-runtime = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
frame-executive = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
frame-support = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
frame-system = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
frame-system-benchmarking = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
frame-executive = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
frame-support = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
frame-system = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
frame-system-benchmarking = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }

## Substrate Pallet Dependencies
pallet-assets = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-asset-tx-payment = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-aura = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-authorship = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-balances = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-collective = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-contracts = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-contracts-primitives = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-democracy = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-identity = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-multisig = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-proxy = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-preimage = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-insecure-randomness-collective-flip = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-session = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-scheduler = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-sudo = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-assets = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-asset-tx-payment = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-aura = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-authorship = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-balances = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-collective = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-contracts = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-contracts-primitives = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-democracy = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-identity = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-insecure-randomness-collective-flip = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-multisig = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-proxy = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-preimage = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-referenda = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-referenda-tracks = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-remark = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-timestamp = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-transaction-payment = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-uniques = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-utility = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-treasury = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-session = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-scheduler = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-sudo = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-timestamp = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-transaction-payment = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-treasury = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-uniques = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-utility = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }

# Cumulus client dependencies
cumulus-client-cli = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-collator = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-consensus-aura = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-consensus-relay-chain = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-consensus-common = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-consensus-proposer = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-service = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-network = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-relay-chain-interface = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-cli = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-collator = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-consensus-aura = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-consensus-relay-chain = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-consensus-common = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-consensus-proposer = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-service = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-client-network = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-relay-chain-interface = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }

# Cumulus runtime dependencies
assets-common = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
Expand All @@ -166,12 +168,14 @@ cumulus-primitives-core = { default-features = false, git = "https://github.com/
cumulus-primitives-timestamp = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-primitives-utility = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
pallet-collator-selection = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
parachains-common = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
parachains-common = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
parachain-info = { package = "staging-parachain-info", default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
cumulus-pallet-session-benchmarking = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }

# Polkadot
polkadot-cli = { features = ["rococo-native"], git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
polkadot-cli = { features = [
"rococo-native",
], git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
polkadot-primitives = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
polkadot-service = { git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
polkadot-runtime-parachains = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "virto-crates-io-v1.2.0" }
Expand Down
3 changes: 2 additions & 1 deletion node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ use std::sync::Arc;

use parachains_common::{AccountId, Balance, Block, Nonce};
use sc_client_api::AuxStore;
pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor};
pub use sc_rpc::DenyUnsafe;
// pub use sc_rpc::SubscriptionTaskExecutor;
use sc_transaction_pool_api::TransactionPool;
use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
Expand Down
3 changes: 2 additions & 1 deletion node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ use cumulus_primitives_core::{
use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
use futures::lock::Mutex;
use jsonrpsee::RpcModule;
pub use parachains_common::{AccountId, AssetIdForTrustBackedAssets as AssetId, Balance, Block, Hash, Header, Nonce};
// pub use parachains_common::AssetIdForTrustBackedAssets as AssetId;
pub use parachains_common::{AccountId, Balance, Block, Hash, Header, Nonce};
use parity_scale_codec::Codec;
use sc_consensus::{
import_queue::{BasicQueue, Verifier as VerifierT},
Expand Down
1 change: 1 addition & 0 deletions pallets/communities/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cargo.lock
53 changes: 53 additions & 0 deletions pallets/communities/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[package]
name = "pallet-communities"
version = "0.1.0"
description = "This pallet enables the creation of communities that are soverign entities with diverse forms of governance. In simpler terms, it can be considered a DAO Factory."
authors = ["Virto Team<[email protected]>"]
edition = "2021"
license = "MIT-0"
publish = false
repository = "https://github.com/virto-network/virto-node/"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
parity-scale-codec = { workspace = true, features = ["derive"] }
scale-info = { workspace = true, features = ["derive"] }

frame-benchmarking = { workspace = true, optional = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

[dev-dependencies]
sp-core = { workspace = true }
sp-io = { workspace = true }

pallet-assets = { workspace = true }
pallet-balances = { workspace = true }
pallet-preimage = { workspace = true }
pallet-referenda = { workspace = true }
pallet-referenda-tracks = { workspace = true }
pallet-scheduler = { workspace = true }

[features]
default = ["std"]
std = [
"parity-scale-codec/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"pallet-assets/std",
"pallet-balances/std",
"pallet-referenda/std",
"scale-info/std",
"sp-runtime/std",
"sp-std/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
]
try-runtime = ["frame-support/try-runtime"]
Loading
Loading