Skip to content

Commit

Permalink
Remove all dependencies to repository open-runtime-module-library (#2969
Browse files Browse the repository at this point in the history
)

* refactor xtokens precompile: get rid of orml-xtokens pallet

* refactor GMP precompile: get rid of orml-xtokens pallet

* chore: remove all orml deps (reimplement som primitives)

* update some comments

* fix dev-test maintenance-filter

* transferWithFee and transferMultiassetWithFee ignore fee parameter now

* fix dev-test wormhole

* fix dev-test wormhole (2)

* wip: example

* remove unused code

* remove orml dependencies from mocks and fix compilation

* fix rust tests

* fix

* Add missing copyright

* Fix rust tests

* fix format

* formatting

* fix tracing test

* fix format

* fix tracing

* enable call of transfer_assets

* fix tracing test

* remove unused code

Co-authored-by: Rodrigo Quelhas <22591718+RomarQ@users.noreply.github.com>

* improvements

---------

Co-authored-by: Ahmad Kaouk <ahmadkaouk.93@gmail.com>
Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
Co-authored-by: Rodrigo Quelhas <22591718+RomarQ@users.noreply.github.com>
Co-authored-by: Agusrodri <agusrodriguez2456@gmail.com>
  • Loading branch information
5 people authored Oct 10, 2024
1 parent f9cde1f commit 5cde8a1
Show file tree
Hide file tree
Showing 52 changed files with 1,554 additions and 1,358 deletions.
90 changes: 2 additions & 88 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,6 @@ cumulus-relay-chain-minimal-node = { git = "https://github.com/moonbeam-foundati
cumulus-relay-chain-rpc-interface = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-stable2407" }

# Polkadot / XCM (wasm)
orml-traits = { git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-stable2407", default-features = false }
orml-xcm-support = { git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-stable2407", default-features = false }
orml-xtokens = { git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-stable2407", default-features = false }
pallet-xcm = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-stable2407", default-features = false }
pallet-xcm-benchmarks = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-stable2407", default-features = false }
polkadot-core-primitives = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-stable2407", default-features = false }
Expand Down Expand Up @@ -442,7 +439,6 @@ crossbeam-deque = { opt-level = 3 }
crypto-mac = { opt-level = 3 }
curve25519-dalek = { opt-level = 3 }
ed25519-zebra = { opt-level = 3 }
flate2 = { opt-level = 3 }
futures-channel = { opt-level = 3 }
hash-db = { opt-level = 3 }
hashbrown = { opt-level = 3 }
Expand Down
2 changes: 0 additions & 2 deletions pallets/parachain-staking/src/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>.

/* TODO: use orml_utilities::OrderedSet without leaking substrate v2.0 dependencies*/

use frame_support::traits::Get;
use parity_scale_codec::{Decode, Encode};
use scale_info::TypeInfo;
Expand Down
2 changes: 0 additions & 2 deletions pallets/xcm-transactor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ sp-std = { workspace = true }
cumulus-primitives-core = { workspace = true }

# Polkadot / XCM
orml-traits = { workspace = true }
xcm = { workspace = true }
xcm-builder = { workspace = true }
xcm-executor = { workspace = true }
Expand All @@ -47,7 +46,6 @@ std = [
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"orml-traits/std",
"parity-scale-codec/std",
"sp-io/std",
"sp-runtime/std",
Expand Down
1 change: 0 additions & 1 deletion pallets/xcm-transactor/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
//! Module to provide `StakeEncodeCall`, `HrmpEncodeCall` and `UtilityEncodeCall` implementations
//! for the Xcm Transactor pallet

#![cfg_attr(not(feature = "std"), no_std)]
use frame_support::pallet_prelude::*;
use sp_runtime::traits::{AccountIdLookup, StaticLookup};
use sp_std::prelude::*;
Expand Down
10 changes: 5 additions & 5 deletions pallets/xcm-transactor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ pub mod pallet {
dispatch::DispatchResult, pallet_prelude::*, weights::constants::WEIGHT_REF_TIME_PER_SECOND,
};
use frame_system::{ensure_signed, pallet_prelude::*};
use orml_traits::location::{Parse, Reserve};
use sp_runtime::traits::{AtLeast32BitUnsigned, Bounded, Convert};
use sp_std::boxed::Box;
use sp_std::convert::TryFrom;
Expand All @@ -109,7 +108,7 @@ pub mod pallet {
use xcm::{latest::prelude::*, VersionedLocation};
use xcm_executor::traits::{TransactAsset, WeightBounds};
use xcm_primitives::{
FilterMaxAssetFee, HrmpAvailableCalls, HrmpEncodeCall, UtilityAvailableCalls,
FilterMaxAssetFee, HrmpAvailableCalls, HrmpEncodeCall, Reserve, UtilityAvailableCalls,
UtilityEncodeCall, XcmTransact,
};

Expand Down Expand Up @@ -180,7 +179,7 @@ pub mod pallet {

/// The way to retrieve the reserve of a Asset. This can be
/// configured to accept absolute or relative paths for self tokens
type ReserveProvider: Reserve;
type ReserveProvider: xcm_primitives::Reserve;

/// The way to filter the max fee to use for HRMP management operations
type MaxHrmpFee: FilterMaxAssetFee;
Expand Down Expand Up @@ -1167,8 +1166,9 @@ pub mod pallet {

/// Ensure `dest` has chain part and none recipient part.
fn ensure_valid_dest(dest: &Location) -> Result<Location, DispatchError> {
if let (Some(dest), None) = (dest.chain_part(), dest.non_chain_part()) {
Ok(dest)
let chain_location = dest.chain_location();
if *dest == chain_location {
Ok(chain_location)
} else {
Err(Error::<T>::InvalidDest.into())
}
Expand Down
6 changes: 5 additions & 1 deletion pallets/xcm-transactor/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@ impl SendXcm for TestSendXcm {

parameter_types! {
pub MaxFee: Asset = (Location::parent(), 1_000_000_000_000u128).into();
pub SelfLocationAbsolute: Location = Location {
parents: 1,
interior: [Parachain(ParachainId::get().into())].into(),
};
}
pub type MaxHrmpRelayFee = xcm_builder::Case<MaxFee>;

Expand All @@ -398,7 +402,7 @@ impl Config for Test {
type UniversalLocation = UniversalLocation;
type BaseXcmWeight = BaseXcmWeight;
type XcmSender = TestSendXcm;
type ReserveProvider = orml_traits::location::RelativeReserveProvider;
type ReserveProvider = xcm_primitives::AbsoluteAndRelativeReserve<SelfLocationAbsolute>;
type WeightInfo = ();
type HrmpManipulatorOrigin = EnsureRoot<u64>;
type HrmpOpenOrigin = EnsureRoot<u64>;
Expand Down
3 changes: 1 addition & 2 deletions precompiles/gmp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ slices = { workspace = true }

# Moonbeam
account = { workspace = true }
pallet-xcm-transactor = { workspace = true }

# Substrate
frame-support = { workspace = true }
Expand All @@ -30,8 +31,6 @@ pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] }
precompile-utils = { workspace = true }

# Polkadot / XCM
orml-traits = { workspace = true }
orml-xtokens = { workspace = true }
pallet-xcm = { workspace = true }
xcm = { workspace = true }
xcm-builder = { workspace = true }
Expand Down
Loading

0 comments on commit 5cde8a1

Please sign in to comment.