diff --git a/Cargo.lock b/Cargo.lock index 00958339b..9c280b716 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8752,6 +8752,7 @@ dependencies = [ "cumulus-primitives-timestamp", "cumulus-primitives-utility", "darwinia-account-migration", + "darwinia-asset-limit", "darwinia-common-runtime", "darwinia-deposit", "darwinia-ecdsa-authority", diff --git a/Cargo.toml b/Cargo.toml index 2777ecf1a..bf5ef2134 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,7 @@ parachain-info = { git = "https://github.com/paritytech/c # darwinia crab-runtime = { path = "runtime/crab" } darwinia-account-migration = { path = "pallet/account-migration", default-features = false } +darwinia-asset-limit = { path = "pallet/asset-limit", default-features = false} darwinia-common-runtime = { path = "runtime/common", default-features = false } darwinia-deposit = { path = "pallet/deposit", default-features = false } darwinia-ecdsa-authority = { path = "pallet/ecdsa-authority", default-features = false } diff --git a/pallet/asset-limit/src/lib.rs b/pallet/asset-limit/src/lib.rs index 0360f92d9..63233a1f8 100644 --- a/pallet/asset-limit/src/lib.rs +++ b/pallet/asset-limit/src/lib.rs @@ -50,6 +50,7 @@ pub mod pallet { AssetLimitChanged { asset_location: T::ForeignAssetType, limit: dc_types::Balance }, } + #[allow(missing_docs)] #[pallet::error] pub enum Error { AssetDoesNotExist @@ -75,7 +76,7 @@ pub mod pallet { T::LimitModifierOrigin::ensure_origin(origin)?; ensure!( - pallet_asset_manager::AssetTypeId::::get(&asset_location).is_some(); + pallet_asset_manager::AssetTypeId::::get(&asset_location).is_some(), Error::::AssetDoesNotExist ); diff --git a/runtime/pangolin/Cargo.toml b/runtime/pangolin/Cargo.toml index 4d2b22afb..0f8103c57 100644 --- a/runtime/pangolin/Cargo.toml +++ b/runtime/pangolin/Cargo.toml @@ -33,6 +33,7 @@ cumulus-pallet-session-benchmarking = { workspace = true, optional = true } # darwinia darwinia-account-migration = { workspace = true } +darwinia-asset-limit = { workspace = true } darwinia-common-runtime = { workspace = true } darwinia-deposit = { workspace = true } darwinia-ecdsa-authority = { workspace = true } @@ -164,6 +165,7 @@ std = [ # darwinia "darwinia-account-migration/std", + "darwinia-asset-limit/std", "darwinia-common-runtime/std", "darwinia-deposit/std", "darwinia-ecdsa-authority/std", @@ -360,6 +362,7 @@ try-runtime = [ # darwinia "darwinia-account-migration/try-runtime", + "darwinia-asset-limit/try-runtime", "darwinia-deposit/try-runtime", "darwinia-ecdsa-authority/try-runtime", "darwinia-message-gadget/try-runtime", diff --git a/runtime/pangolin/src/lib.rs b/runtime/pangolin/src/lib.rs index 2f8c5a2d8..d8bb2ebf4 100644 --- a/runtime/pangolin/src/lib.rs +++ b/runtime/pangolin/src/lib.rs @@ -169,6 +169,7 @@ frame_support::construct_runtime! { DmpQueue: cumulus_pallet_dmp_queue = 35, AssetManager: pallet_asset_manager = 45, XTokens: orml_xtokens = 46, + AssetLimit: darwinia_asset_limit = 47, // EVM stuff. Ethereum: pallet_ethereum = 36, diff --git a/runtime/pangolin/src/pallets.rs b/runtime/pangolin/src/pallets.rs index 7844d04bb..4fade8be8 100644 --- a/runtime/pangolin/src/pallets.rs +++ b/runtime/pangolin/src/pallets.rs @@ -106,6 +106,8 @@ mod asset_manager; mod orml_xtokens; +mod asset_limit; + // EVM stuff. mod ethereum; diff --git a/runtime/pangolin/src/pallets/asset_limit.rs b/runtime/pangolin/src/pallets/asset_limit.rs new file mode 100644 index 000000000..c370d37b4 --- /dev/null +++ b/runtime/pangolin/src/pallets/asset_limit.rs @@ -0,0 +1,25 @@ +// This file is part of Darwinia. +// +// Copyright (C) 2018-2023 Darwinia Network +// SPDX-License-Identifier: GPL-3.0 +// +// Darwinia is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Darwinia is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Darwinia. If not, see . + +// darwinia +use crate::*; + +impl darwinia_asset_limit::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type LimitModifierOrigin = Root; +}