Skip to content

Commit

Permalink
feat(gov): normalize FastGeneralAdmin track origin for creating new f…
Browse files Browse the repository at this point in the history
…oreign assets
  • Loading branch information
RomarQ committed Jan 28, 2025
1 parent aedf6b4 commit df55557
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 32 deletions.
23 changes: 18 additions & 5 deletions runtime/moonbase/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,18 +726,31 @@ impl frame_support::traits::Contains<Location> for AssetFeesFilter {
}
}

pub type AddAndEditSupportedAssetOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
EitherOfDiverse<
pallet_collective::EnsureProportionMoreThan<AccountId, OpenTechCommitteeInstance, 5, 9>,
governance::custom_origins::FastGeneralAdmin,
>,
>;

pub type RemoveSupportedAssetOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionMoreThan<AccountId, OpenTechCommitteeInstance, 5, 9>,
>;

impl pallet_xcm_weight_trader::Config for Runtime {
type AccountIdToLocation = AccountIdToLocation<AccountId>;
type AddSupportedAssetOrigin = EnsureRoot<AccountId>;
type AddSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type AssetLocationFilter = AssetFeesFilter;
type AssetTransactor = AssetTransactors;
type Balance = Balance;
type EditSupportedAssetOrigin = EnsureRoot<AccountId>;
type EditSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type NativeLocation = SelfReserve;
type PauseSupportedAssetOrigin = EnsureRoot<AccountId>;
type RemoveSupportedAssetOrigin = EnsureRoot<AccountId>;
type PauseSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type RemoveSupportedAssetOrigin = RemoveSupportedAssetOrigin;
type RuntimeEvent = RuntimeEvent;
type ResumeSupportedAssetOrigin = EnsureRoot<AccountId>;
type ResumeSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type WeightInfo = moonbase_weights::pallet_xcm_weight_trader::WeightInfo<Runtime>;
type WeightToFee = <Runtime as pallet_transaction_payment::Config>::WeightToFee;
type XcmFeesAccount = XcmFeesAccount;
Expand Down
18 changes: 5 additions & 13 deletions runtime/moonbeam/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,15 +712,7 @@ impl frame_support::traits::Contains<Location> for AssetFeesFilter {
}
}

pub type AddSupportedAssetOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
EitherOfDiverse<
pallet_collective::EnsureProportionMoreThan<AccountId, OpenTechCommitteeInstance, 5, 9>,
governance::custom_origins::GeneralAdmin,
>,
>;

pub type EditSupportedAssetOrigin = EitherOfDiverse<
pub type AddAndEditSupportedAssetOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
EitherOfDiverse<
pallet_collective::EnsureProportionMoreThan<AccountId, OpenTechCommitteeInstance, 5, 9>,
Expand All @@ -735,16 +727,16 @@ pub type RemoveSupportedAssetOrigin = EitherOfDiverse<

impl pallet_xcm_weight_trader::Config for Runtime {
type AccountIdToLocation = AccountIdToLocation<AccountId>;
type AddSupportedAssetOrigin = AddSupportedAssetOrigin;
type AddSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type AssetLocationFilter = AssetFeesFilter;
type AssetTransactor = AssetTransactors;
type Balance = Balance;
type EditSupportedAssetOrigin = EditSupportedAssetOrigin;
type EditSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type NativeLocation = SelfReserve;
type PauseSupportedAssetOrigin = EditSupportedAssetOrigin;
type PauseSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type ResumeSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type RemoveSupportedAssetOrigin = RemoveSupportedAssetOrigin;
type RuntimeEvent = RuntimeEvent;
type ResumeSupportedAssetOrigin = RemoveSupportedAssetOrigin;
type WeightInfo = moonbeam_weights::pallet_xcm_weight_trader::WeightInfo<Runtime>;
type WeightToFee = <Runtime as pallet_transaction_payment::Config>::WeightToFee;
type XcmFeesAccount = XcmFeesAccount;
Expand Down
19 changes: 5 additions & 14 deletions runtime/moonriver/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,15 +725,7 @@ impl frame_support::traits::Contains<Location> for AssetFeesFilter {
}
}

pub type AddSupportedAssetOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
EitherOfDiverse<
pallet_collective::EnsureProportionMoreThan<AccountId, OpenTechCommitteeInstance, 5, 9>,
governance::custom_origins::GeneralAdmin,
>,
>;

pub type EditSupportedAssetOrigin = EitherOfDiverse<
pub type AddAndEditSupportedAssetOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
EitherOfDiverse<
pallet_collective::EnsureProportionMoreThan<AccountId, OpenTechCommitteeInstance, 5, 9>,
Expand All @@ -748,17 +740,16 @@ pub type RemoveSupportedAssetOrigin = EitherOfDiverse<

impl pallet_xcm_weight_trader::Config for Runtime {
type AccountIdToLocation = AccountIdToLocation<AccountId>;
type AddSupportedAssetOrigin = AddSupportedAssetOrigin;
type AddSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type AssetLocationFilter = AssetFeesFilter;
type AssetTransactor = AssetTransactors;
type Balance = Balance;
type EditSupportedAssetOrigin = EditSupportedAssetOrigin;
type EditSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type NativeLocation = SelfReserve;
type PauseSupportedAssetOrigin = EditSupportedAssetOrigin;
type PauseSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type ResumeSupportedAssetOrigin = AddAndEditSupportedAssetOrigin;
type RemoveSupportedAssetOrigin = RemoveSupportedAssetOrigin;
type RuntimeEvent = RuntimeEvent;
type ResumeSupportedAssetOrigin = RemoveSupportedAssetOrigin;

type WeightInfo = moonriver_weights::pallet_xcm_weight_trader::WeightInfo<Runtime>;
type WeightToFee = <Runtime as pallet_transaction_payment::Config>::WeightToFee;
type XcmFeesAccount = XcmFeesAccount;
Expand Down

0 comments on commit df55557

Please sign in to comment.