Skip to content

Commit

Permalink
Merge pull request #663 from galacticcouncil/opengov
Browse files Browse the repository at this point in the history
feat: OpenGov
  • Loading branch information
mrq1911 committed Jun 11, 2024
2 parents 8659a76 + 4337f0f commit d3b62ef
Show file tree
Hide file tree
Showing 16 changed files with 1,448 additions and 206 deletions.
20 changes: 12 additions & 8 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pallet-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch ="rel
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-bounties = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
Expand All @@ -75,6 +76,7 @@ pallet-offences = { git = "https://github.com/paritytech/polkadot-sdk", branch =
pallet-offences-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-recovery = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
Expand All @@ -93,6 +95,7 @@ pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch =
pallet-uniques = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-vesting = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-whitelist = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false }
pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false }

Expand Down Expand Up @@ -327,11 +330,13 @@ pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "re
pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
Expand All @@ -342,6 +347,7 @@ pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-uniques = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-whitelist = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2"}
Expand Down
2 changes: 1 addition & 1 deletion primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "primitives"
version = "6.6.1"
version = "6.6.2"
authors = ["GalacticCouncil"]
edition = "2021"
repository = "https://github.com/galacticcouncil/Basilisk-node"
Expand Down
18 changes: 16 additions & 2 deletions runtime/basilisk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "basilisk-runtime"
version = "115.0.0"
version = "116.0.0"
authors = ["GalacticCouncil"]
edition = "2021"
homepage = "https://github.com/galacticcouncil/Basilisk-node"
Expand Down Expand Up @@ -101,18 +101,22 @@ frame-try-runtime = { workspace = true, optional = true }
pallet-aura = { workspace = true }
pallet-balances = { workspace = true }
pallet-collective = { workspace = true }
pallet-conviction-voting = { workspace = true }
pallet-preimage = { workspace = true }
pallet-session = { workspace = true }
pallet-proxy = { workspace = true }
pallet-multisig = { workspace = true }
pallet-referenda = { workspace = true }
pallet-timestamp = { workspace = true }
pallet-transaction-payment = { workspace = true }
pallet-transaction-payment-rpc-runtime-api = { workspace = true }
pallet-uniques = { workspace = true }
pallet-utility = { workspace = true }
pallet-whitelist = { workspace = true }
pallet-message-queue = { workspace = true }

sp-api = { workspace = true }
sp-arithmetic = { workspace = true }
sp-block-builder = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-core = { workspace = true }
Expand Down Expand Up @@ -165,6 +169,9 @@ runtime-benchmarks = [
"cumulus-pallet-parachain-system/runtime-benchmarks",
"pallet-elections-phragmen/runtime-benchmarks",
"pallet-state-trie-migration/runtime-benchmarks",
"pallet-conviction-voting/runtime-benchmarks",
"pallet-referenda/runtime-benchmarks",
"pallet-whitelist/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
]
Expand Down Expand Up @@ -217,6 +224,7 @@ std = [
"hydradx-traits/std",
"hydradx-adapters/std",
"sp-api/std",
"sp-arithmetic/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
Expand All @@ -243,10 +251,13 @@ std = [
"pallet-preimage/std",
"pallet-identity/std",
"pallet-ema-oracle/std",
"pallet-message-queue/std",
"pallet-state-trie-migration/std",
"pallet-conviction-voting/std",
"pallet-referenda/std",
"pallet-whitelist/std",
"cumulus-primitives-utility/std",
"parachains-common/std",
"pallet-message-queue/std",
"polkadot-runtime-common/std",
]
try-runtime= [
Expand Down Expand Up @@ -300,4 +311,7 @@ try-runtime= [
"pallet-collator-rewards/try-runtime",
"pallet-state-trie-migration/try-runtime",
"pallet-message-queue/try-runtime",
"pallet-conviction-voting/try-runtime",
"pallet-referenda/try-runtime",
"pallet-whitelist/try-runtime",
]
20 changes: 10 additions & 10 deletions runtime/basilisk/src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

use super::*;
use crate::governance::{SuperMajorityCouncilOrRoot, SuperMajorityTechCommitteeOrRoot, UnanimousTechCommitteeOrRoot};
use crate::governance::origins::GeneralAdmin;
use crate::system::NativeAssetId;

use hydradx_traits::{
Expand All @@ -38,12 +38,12 @@ use frame_support::{
parameter_types,
sp_runtime::{app_crypto::sp_core::crypto::UncheckedFrom, traits::Zero},
traits::{
AsEnsureOriginWithArg, Contains, Currency, Defensive, EnsureOrigin, Get, Imbalance, LockIdentifier,
AsEnsureOriginWithArg, Contains, Currency, Defensive, EitherOf, EnsureOrigin, Get, Imbalance, LockIdentifier,
NeverEnsureOrigin, OnUnbalanced,
},
BoundedVec, PalletId,
};
use frame_system::RawOrigin;
use frame_system::{EnsureRoot, RawOrigin};
use orml_tokens::CurrencyAdapter;
use orml_traits::currency::MutationHooks;

Expand Down Expand Up @@ -145,7 +145,7 @@ parameter_types! {
}
impl pallet_asset_registry::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RegistryOrigin = SuperMajorityTechCommitteeOrRoot;
type RegistryOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type AssetId = AssetId;
type Balance = Balance;
type AssetNativeLocation = AssetLocation;
Expand All @@ -168,7 +168,7 @@ impl pallet_duster::Config for Runtime {
type MinCurrencyDeposits = AssetRegistry;
type Reward = DustingReward;
type NativeCurrencyId = NativeAssetId;
type BlacklistUpdateOrigin = MajorityTechCommitteeOrRoot;
type BlacklistUpdateOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type WeightInfo = weights::pallet_duster::BasiliskWeight<Runtime>;
}

Expand Down Expand Up @@ -259,7 +259,7 @@ impl pallet_lbp::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type MultiCurrency = Currencies;
type LockedBalance = MultiCurrencyLockedBalance<Runtime>;
type CreatePoolOrigin = SuperMajorityTechCommitteeOrRoot;
type CreatePoolOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type LBPWeightFunction = pallet_lbp::LBPWeightFunction;
type AssetPairAccountId = AssetPairAccountId<Self>;
type WeightInfo = weights::pallet_lbp::BasiliskWeight<Runtime>;
Expand Down Expand Up @@ -349,7 +349,7 @@ impl pallet_uniques::Config for Runtime {
type CollectionId = CollectionId;
type ItemId = ItemId;
type Currency = KusamaCurrency;
type ForceOrigin = SuperMajorityCouncilOrRoot;
type ForceOrigin = EnsureRoot<Self::AccountId>;
// Standard collection creation is disallowed
type CreateOrigin = AsEnsureOriginWithArg<NeverEnsureOrigin<AccountId>>;
type Locker = ();
Expand All @@ -375,7 +375,7 @@ impl pallet_xyk_liquidity_mining::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type MultiCurrency = Currencies;
type AMM = XYK;
type CreateOrigin = UnanimousTechCommitteeOrRoot;
type CreateOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type PalletId = LMPalletId;
type NftCollectionId = LiquidityMiningNftCollectionId;
type NFTHandler = NFT;
Expand Down Expand Up @@ -641,7 +641,7 @@ impl pallet_route_executor::Config for Runtime {
type DefaultRoutePoolType = DefaultRoutePoolType;
type WeightInfo = RouterWeightInfo;
type InspectRegistry = AssetRegistry;
type TechnicalOrigin = SuperMajorityTechCommitteeOrRoot;
type TechnicalOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
}

parameter_types! {
Expand All @@ -656,7 +656,7 @@ parameter_types! {
impl pallet_ema_oracle::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_ema_oracle::BasiliskWeight<Runtime>;
type AuthorityOrigin = SuperMajorityTechCommitteeOrRoot;
type AuthorityOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type BlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;
type SupportedPeriods = SupportedPeriods;
type OracleWhitelist = Everything;
Expand Down
Loading

0 comments on commit d3b62ef

Please sign in to comment.