Skip to content

Commit

Permalink
Merge pull request #188 from docknetwork/allow-root-to-fast-track
Browse files Browse the repository at this point in the history
Allow system root origin to create external proposals
  • Loading branch information
lovesh authored Sep 2, 2024
2 parents 80fbf9e + ca182c5 commit 52df523
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 29 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ branch = "polkadot-v0.9.29"

[dependencies.pallet-elections-phragmen]
git = "https://github.com/docknetwork/dock-substrate-common.git"
branch = "identity-provider"
commit = "49c162eb87c85631376fb95dc04e48dde845ba1c"

[dependencies.dock-staking-rewards]
path = "../pallets/staking-rewards"
Expand All @@ -528,7 +528,7 @@ rev = "dc50c3d973d1f53434c7a03e426faa9c20062f60"

[dependencies.dock-price-feed-rpc]
git = "https://github.com/docknetwork/dock-substrate-common.git"
branch = "identity-provider"
commit = "49c162eb87c85631376fb95dc04e48dde845ba1c"

[dependencies.dock-staking-rewards-rpc]
path = "../pallets/staking-rewards/rpc"
Expand All @@ -538,7 +538,7 @@ path = "../pallets/core/rpc"

[dependencies.pallet-staking]
git = "https://github.com/docknetwork/dock-substrate-common.git"
branch = "identity-provider"
commit = "49c162eb87c85631376fb95dc04e48dde845ba1c"

[dependencies.fp-consensus]
git = "https://github.com/docknetwork/frontier.git"
Expand Down
2 changes: 1 addition & 1 deletion pallets/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ default-features = false

[dependencies.utils]
git = "https://github.com/docknetwork/dock-substrate-common.git"
branch = "identity-provider"
commit = "49c162eb87c85631376fb95dc04e48dde845ba1c"
default-features = false

[dependencies.scale-info]
Expand Down
8 changes: 5 additions & 3 deletions pallets/staking-rewards/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ license = "Apache-2.0"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
scale-info = { version = "2.1.2", default-features = false, features = ["derive"] }
scale-info = { version = "2.1.2", default-features = false, features = [
"derive",
] }

[dependencies.codec]
default-features = false
Expand Down Expand Up @@ -49,7 +51,7 @@ branch = "polkadot-v0.9.29"
[dependencies.pallet-staking]
default-features = false
git = "https://github.com/docknetwork/dock-substrate-common.git"
branch = "identity-provider"
commit = "49c162eb87c85631376fb95dc04e48dde845ba1c"

[dependencies.pallet-staking-reward-curve]
default-features = false
Expand Down Expand Up @@ -100,4 +102,4 @@ std = [
"dock-poa/std",
"sp-io/std",
"scale-info/std",
]
]
12 changes: 6 additions & 6 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ hex = { version = "0.4", default-features = false }

[dependencies.utils]
git = "https://github.com/docknetwork/dock-substrate-common.git"
branch = "identity-provider"
commit = "49c162eb87c85631376fb95dc04e48dde845ba1c"
default-features = false

[dependencies.pallet-babe]
Expand Down Expand Up @@ -292,7 +292,7 @@ branch = "polkadot-v0.9.29"
[dependencies.pallet-collective]
default-features = false
git = "https://github.com/docknetwork/dock-substrate-common.git"
branch = "identity-provider"
commit = "49c162eb87c85631376fb95dc04e48dde845ba1c"

[dependencies.pallet-membership]
default-features = false
Expand Down Expand Up @@ -332,7 +332,7 @@ branch = "polkadot-v0.9.29"
[dependencies.pallet-staking]
default-features = false
git = "https://github.com/docknetwork/dock-substrate-common.git"
branch = "identity-provider"
commit = "49c162eb87c85631376fb95dc04e48dde845ba1c"

[dependencies.pallet-staking-reward-curve]
default-features = false
Expand Down Expand Up @@ -367,12 +367,12 @@ branch = "polkadot-v0.9.29"
[dependencies.pallet-democracy]
default-features = false
git = "https://github.com/docknetwork/dock-substrate-common.git"
branch = "identity-provider"
commit = "49c162eb87c85631376fb95dc04e48dde845ba1c"

[dependencies.pallet-elections-phragmen]
default-features = false
git = "https://github.com/docknetwork/dock-substrate-common.git"
branch = "identity-provider"
commit = "49c162eb87c85631376fb95dc04e48dde845ba1c"

[dependencies.hex-literal]
version = "0.3.4"
Expand Down Expand Up @@ -463,7 +463,7 @@ path = "../pallets/agreement"
[dependencies.dock-price-feed]
default-features = false
git = "https://github.com/docknetwork/dock-substrate-common.git"
branch = "identity-provider"
commit = "49c162eb87c85631376fb95dc04e48dde845ba1c"

[dependencies.libsecp256k1]
version = "0.7"
Expand Down
22 changes: 14 additions & 8 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("dock-pos-dev-runtime"),
impl_name: create_runtime_str!("Dock"),
authoring_version: 1,
spec_version: 61,
spec_version: 62,
impl_version: 2,
transaction_version: 2,
apis: RUNTIME_API_VERSIONS,
Expand Down Expand Up @@ -1233,20 +1233,26 @@ impl pallet_democracy::Config for Runtime {
type CooloffPeriod = CooloffPeriod;
type MinimumDeposit = MinimumDeposit;
/// A straight majority of the council can decide what their next motion is.
type ExternalOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>;
type ExternalOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>,
>;
/// A super-majority can have the next scheduled referendum be a straight majority-carries vote.
type ExternalMajorityOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 3, 4>;
type ExternalMajorityOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 3, 4>,
>;
/// A unanimous council can have the next scheduled referendum be a straight default-carries
/// (NTB) vote.
type ExternalDefaultOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 1>;
type ExternalDefaultOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 1>,
>;
/// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin = EitherOfDiverse<
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 2, 3>,
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 2, 3>,
>;
/// Root or the Technical committee unanimously agreeing can make a Council proposal a referendum instantly.
type InstantOrigin = EitherOfDiverse<
Expand Down

0 comments on commit 52df523

Please sign in to comment.