diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab224ca7f9..680fc19298 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -353,8 +353,9 @@ jobs: needs: ["set-tags", "build"] timeout-minutes: 20 strategy: + fail-fast: false matrix: - chain: ["moonbase"] + chain: ["moonbase", "moonbeam"] env: GH_WORKFLOW_MATRIX_CHAIN: ${{ matrix.chain }} DEBUG_COLORS: 1 diff --git a/Cargo.lock b/Cargo.lock index 5524bdbe63..38af3d99df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6517,6 +6517,7 @@ dependencies = [ "pallet-maintenance-mode", "pallet-message-queue", "pallet-migrations", + "pallet-moonbeam-lazy-migrations", "pallet-moonbeam-orbiters", "pallet-multisig", "pallet-parachain-staking", @@ -6999,6 +7000,7 @@ dependencies = [ "pallet-maintenance-mode", "pallet-message-queue", "pallet-migrations", + "pallet-moonbeam-lazy-migrations", "pallet-moonbeam-orbiters", "pallet-multisig", "pallet-parachain-staking", @@ -7388,6 +7390,7 @@ dependencies = [ "pallet-maintenance-mode", "pallet-message-queue", "pallet-migrations", + "pallet-moonbeam-lazy-migrations", "pallet-moonbeam-orbiters", "pallet-multisig", "pallet-parachain-staking", @@ -9564,6 +9567,22 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-moonbeam-lazy-migrations" +version = "0.1.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", +] + [[package]] name = "pallet-moonbeam-orbiters" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 951108cd26..5034a7bb0c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,6 +92,7 @@ pallet-moonbeam-orbiters = { path = "pallets/moonbeam-orbiters", default-feature pallet-parachain-staking = { path = "pallets/parachain-staking", default-features = false } pallet-proxy-genesis-companion = { path = "pallets/proxy-genesis-companion", default-features = false } pallet-xcm-transactor = { path = "pallets/xcm-transactor", default-features = false } +pallet-moonbeam-lazy-migrations = { path = "pallets/moonbeam-lazy-migrations", default-features = false } precompile-utils = { path = "precompiles/utils", default-features = false } xcm-primitives = { path = "primitives/xcm", default-features = false } diff --git a/pallets/moonbeam-lazy-migrations/Cargo.toml b/pallets/moonbeam-lazy-migrations/Cargo.toml new file mode 100644 index 0000000000..bd9bf72e52 --- /dev/null +++ b/pallets/moonbeam-lazy-migrations/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "pallet-moonbeam-lazy-migrations" +authors = { workspace = true } +description = "A pallet for performing migrations from extrinsics" +edition = "2021" +version = "0.1.0" + +[dependencies] +log = { workspace = true } + +# Substrate +frame-support = { workspace = true } +frame-system = { workspace = true } +parity-scale-codec = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } + +# Benchmarks +frame-benchmarking = { workspace = true, optional = true } + +[dev-dependencies] +pallet-balances = { workspace = true } +frame-benchmarking = { workspace = true, features = ["std"] } +sp-io = { workspace = true, features = ["std"] } + +[features] +default = ["std"] +std = [ + "pallet-balances/std", + "frame-support/std", + "frame-system/std", + "scale-info/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", +] +runtime-benchmarks = ["frame-benchmarking"] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/moonbeam-lazy-migrations/src/lib.rs b/pallets/moonbeam-lazy-migrations/src/lib.rs new file mode 100644 index 0000000000..9081e6a105 --- /dev/null +++ b/pallets/moonbeam-lazy-migrations/src/lib.rs @@ -0,0 +1,110 @@ +// Copyright 2024 Moonbeam foundation +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +//! # Lazy Migration Pallet + +#![allow(non_camel_case_types)] +#![cfg_attr(not(feature = "std"), no_std)] + +#[cfg(test)] +mod mock; +#[cfg(test)] +mod tests; + +use frame_support::pallet; + +pub use pallet::*; + +#[pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + + const INTERMEDIATES_NODES_SIZE: u64 = 4096; + const MAX_LOCAL_ASSETS_STORAGE_ENTRY_SIZE: u64 = + (/* biggest key on moonbeam */136) + (/* biggest value on moonbeam */142); + + /// Pallet for multi block migrations + #[pallet::pallet] + pub struct Pallet(PhantomData); + + #[pallet::storage] + /// If true, it means that LocalAssets storage has been removed. + pub(crate) type LocalAssetsMigrationCompleted = StorageValue<_, bool, ValueQuery>; + + /// Configuration trait of this pallet. + #[pallet::config] + pub trait Config: frame_system::Config {} + + #[pallet::error] + pub enum Error { + /// There are no more storage entries to be removed + AllStorageEntriesHaveBeenRemoved, + } + + #[pallet::call] + impl Pallet { + // TODO(rodrigo): This extrinsic should be removed once LocalAssets pallet storage is removed + #[pallet::call_index(0)] + #[pallet::weight(Weight::from_parts(0, + INTERMEDIATES_NODES_SIZE + (MAX_LOCAL_ASSETS_STORAGE_ENTRY_SIZE * ::from(*limit))) + .saturating_add(::DbWeight::get() + .reads_writes((*limit + 1).into(), (*limit + 1).into())) + )] + pub fn clear_local_assets_storage( + origin: OriginFor, + limit: u32, + ) -> DispatchResultWithPostInfo { + ensure_signed(origin)?; + ensure!(limit != 0, "Limit cannot be zero!"); + + let mut weight = ::DbWeight::get().reads(1); + ensure!( + !LocalAssetsMigrationCompleted::::get(), + Error::::AllStorageEntriesHaveBeenRemoved + ); + + let hashed_prefix = sp_io::hashing::twox_128("LocalAssets".as_bytes()); + + let keys_removed = match sp_io::storage::clear_prefix(&hashed_prefix, Some(limit)) { + sp_io::KillStorageResult::AllRemoved(value) => { + LocalAssetsMigrationCompleted::::set(true); + weight + .saturating_accrue(::DbWeight::get().writes(1)); + value + } + sp_io::KillStorageResult::SomeRemaining(value) => value, + } as u64; + + log::info!("Removed {} keys 🧹", keys_removed); + + Ok(Some( + weight + .saturating_add(Weight::from_parts( + 0, + INTERMEDIATES_NODES_SIZE + + MAX_LOCAL_ASSETS_STORAGE_ENTRY_SIZE * keys_removed, + )) + .saturating_add( + ::DbWeight::get() + .reads_writes(keys_removed, keys_removed), + ), + ) + .into()) + } + } +} diff --git a/pallets/moonbeam-lazy-migrations/src/mock.rs b/pallets/moonbeam-lazy-migrations/src/mock.rs new file mode 100644 index 0000000000..9e51e10601 --- /dev/null +++ b/pallets/moonbeam-lazy-migrations/src/mock.rs @@ -0,0 +1,120 @@ +// Copyright 2024 Moonbeam foundation +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +//! A minimal runtime including the multi block migrations pallet + +use super::*; +use crate as pallet_moonbeam_lazy_migrations; +use frame_support::{ + construct_runtime, parameter_types, + traits::Everything, + weights::{constants::RocksDbWeight, Weight}, +}; +use sp_core::H256; +use sp_runtime::{ + traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, Perbill, +}; + +pub type AccountId = u64; +pub type Balance = u128; +type Block = frame_system::mocking::MockBlock; + +// Configure a mock runtime to test the pallet. +construct_runtime!( + pub enum Runtime + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + LazyMigrations: pallet_moonbeam_lazy_migrations::{Pallet, Call}, + } +); + +parameter_types! { + pub const BlockHashCount: u32 = 250; + pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 1); + pub const MaximumBlockLength: u32 = 2 * 1024; + pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const SS58Prefix: u8 = 42; +} +impl frame_system::Config for Runtime { + type BaseCallFilter = Everything; + type DbWeight = RocksDbWeight; + type RuntimeOrigin = RuntimeOrigin; + type Nonce = u64; + type Block = Block; + type RuntimeCall = RuntimeCall; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type BlockWeights = (); + type BlockLength = (); + type SS58Prefix = SS58Prefix; + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +parameter_types! { + pub const ExistentialDeposit: u128 = 0; +} +impl pallet_balances::Config for Runtime { + type MaxReserves = (); + type ReserveIdentifier = (); + type MaxLocks = (); + type Balance = Balance; + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); + type RuntimeHoldReason = (); + type FreezeIdentifier = (); + type MaxHolds = (); + type MaxFreezes = (); + type RuntimeFreezeReason = (); +} + +impl Config for Runtime {} + +/// Externality builder for pallet migration's mock runtime +pub(crate) struct ExtBuilder; + +impl Default for ExtBuilder { + fn default() -> ExtBuilder { + Self + } +} + +impl ExtBuilder { + pub(crate) fn build(self) -> sp_io::TestExternalities { + let storage = frame_system::GenesisConfig::::default() + .build_storage() + .expect("Frame system builds valid default genesis config"); + + let mut ext = sp_io::TestExternalities::new(storage); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} diff --git a/pallets/moonbeam-lazy-migrations/src/tests.rs b/pallets/moonbeam-lazy-migrations/src/tests.rs new file mode 100644 index 0000000000..5a2bdf03a9 --- /dev/null +++ b/pallets/moonbeam-lazy-migrations/src/tests.rs @@ -0,0 +1,80 @@ +// Copyright 2024 Moonbeam foundation +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +//! Unit testing +use { + crate::mock::{ExtBuilder, LazyMigrations}, + frame_support::assert_ok, +}; + +/// TODO(rodrigo): This test should be removed once LocalAssets pallet storage is removed +#[test] +fn test_call_clear_local_assets_storage() { + let mut context = ExtBuilder::default().build(); + + let pallet_prefix = sp_io::hashing::twox_128("LocalAssets".as_bytes()); + let total_storage_entries: u8 = 5; + + let gen_dummy_entry = |dummy: u8| -> [u8; 32] { + [pallet_prefix, sp_io::hashing::twox_128(&[dummy])] + .concat() + .try_into() + .unwrap() + }; + + context.execute_with(|| { + for i in 0u8..total_storage_entries { + let dummy_data = gen_dummy_entry(i); + sp_io::storage::set(&dummy_data, &dummy_data); + dbg!(sp_io::storage::exists(&dummy_data)); + } + }); + + // Commit changes + let _ = context.commit_all(); + + // Next block + context.execute_with(|| { + // Check that the storage entries exist before attempting to remove it + for i in 0u8..total_storage_entries { + let dummy_data = gen_dummy_entry(i); + assert!(sp_io::storage::exists(&dummy_data)); + } + // Clear all storage entries + assert_ok!(LazyMigrations::clear_local_assets_storage( + crate::mock::RuntimeOrigin::signed(1), + total_storage_entries.into() + )); + // Check that all storage entries got deleted + for i in 0u8..total_storage_entries { + let dummy_data = gen_dummy_entry(i); + assert!(!sp_io::storage::exists(&dummy_data)); + } + }); + + // Commit changes + let _ = context.commit_all(); + + // Next block + context.execute_with(|| { + // No more storage entries to be removed (expect failure) + assert!(LazyMigrations::clear_local_assets_storage( + crate::mock::RuntimeOrigin::signed(1), + 1 + ) + .is_err()) + }); +} diff --git a/precompiles/assets-erc20/LocalAsset.sol b/precompiles/assets-erc20/LocalAsset.sol deleted file mode 100644 index e0c1062fbb..0000000000 --- a/precompiles/assets-erc20/LocalAsset.sol +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >=0.8.3; - -/// @author The Moonbeam Team -/// @title Extension of the ERC20 interface that allows an owner -/// @dev Contract to pilot the ERC20 contract. -interface LocalAsset { - /// @dev Mint tokens to an address - /// @custom:selector 40c10f19 - /// @param to address The address to which you want to mint tokens - /// @param value uint256 the amount of tokens to be minted - function mint(address to, uint256 value) external returns (bool); - - /// @dev Burn tokens from an address - /// @custom:selector 9dc29fac - /// @param from address The address from which you want to burn tokens - /// @param value uint256 the amount of tokens to be burnt - function burn(address from, uint256 value) external returns (bool); - - /// @dev Freeze an account, preventing it from operating with the asset - /// @custom:selector 8d1fdf2f - /// @param account address The address that you want to freeze - function freeze(address account) external returns (bool); - - /// @dev Unfreeze an account, letting it from operating againt with the asset - /// @custom:selector 5ea20216 - /// @param account address The address that you want to unfreeze - function thaw(address account) external returns (bool); - - /// @dev Freeze the entire asset operations - /// @custom:selector d4937f51 - function freezeAsset() external returns (bool); - - /// @dev Unfreeze the entire asset operations - /// @custom:selector 51ec2ad7 - function thawAsset() external returns (bool); - - /// @dev Transfer the ownership of an asset to a new account - /// @custom:selector f2fde38b - /// @param owner address The address of the new owner - function transferOwnership(address owner) external returns (bool); - - /// @dev Specify the issuer, admin and freezer of an asset - /// @custom:selector c7d93c59 - /// @param issuer address The address capable of issuing tokens - /// @param admin address The address capable of burning tokens and unfreezing accounts/assets - /// @param freezer address The address capable of freezing accounts/asset - function setTeam( - address issuer, - address admin, - address freezer - ) external returns (bool); - - /// @dev Specify the name, symbol and decimals of your asset - /// @custom:selector 37d2c2f4 - /// @param name string The name of the asset - /// @param symbol string The symbol of the asset - /// @param decimals uint8 The number of decimals of your asset - function setMetadata( - string calldata name, - string calldata symbol, - uint8 decimals - ) external returns (bool); - - /// @dev Clear the name, symbol and decimals of your asset - /// @custom:selector efb6d432 - function clearMetadata() external returns (bool); -} diff --git a/precompiles/assets-erc20/src/eip2612.rs b/precompiles/assets-erc20/src/eip2612.rs index 0e6c2e6429..eff2b44fa7 100644 --- a/precompiles/assets-erc20/src/eip2612.rs +++ b/precompiles/assets-erc20/src/eip2612.rs @@ -109,11 +109,9 @@ pub type NoncesStorage = StorageDoubleMap< ValueQuery, >; -pub struct Eip2612( - PhantomData<(Runtime, IsLocal, Instance)>, -); +pub struct Eip2612(PhantomData<(Runtime, Instance)>); -impl Eip2612 +impl Eip2612 where Instance: InstanceToPrefix + 'static, Runtime: pallet_assets::Config + pallet_evm::Config + frame_system::Config, @@ -123,7 +121,6 @@ where BalanceOf: TryFrom + Into + solidity::Codec, Runtime: AccountIdAssetIdConversion>, <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, - IsLocal: Get, AssetIdOf: Display, Runtime::AccountId: Into, { @@ -237,7 +234,7 @@ where NoncesStorage::::insert(address, owner, nonce + U256::one()); - Erc20AssetsPrecompileSet::::approve_inner( + Erc20AssetsPrecompileSet::::approve_inner( asset_id, handle, owner, spender, value, )?; diff --git a/precompiles/assets-erc20/src/lib.rs b/precompiles/assets-erc20/src/lib.rs index 1eaa26a309..e65348ee8f 100644 --- a/precompiles/assets-erc20/src/lib.rs +++ b/precompiles/assets-erc20/src/lib.rs @@ -23,7 +23,7 @@ use frame_support::traits::fungibles::{ approvals::Inspect as ApprovalInspect, metadata::Inspect as MetadataInspect, roles::Inspect as RolesInspect, }; -use frame_support::traits::{ConstBool, Get, OriginTrait}; +use frame_support::traits::{Get, OriginTrait}; use frame_support::{ dispatch::{GetDispatchInfo, PostDispatchInfo}, sp_runtime::traits::StaticLookup, @@ -53,19 +53,12 @@ pub const SELECTOR_LOG_TRANSFER: [u8; 32] = keccak256!("Transfer(address,address /// Solidity selector of the Approval log, which is the Keccak of the Log signature. pub const SELECTOR_LOG_APPROVAL: [u8; 32] = keccak256!("Approval(address,address,uint256)"); -/// Length limit of strings (symbol and name). -type GetAssetsStringLimit = >::StringLimit; - /// Alias for the Balance type for the provided Runtime and Instance. pub type BalanceOf = >::Balance; /// Alias for the Asset Id type for the provided Runtime and Instance. pub type AssetIdOf = >::AssetId; -/// Public types to use with the PrecompileSet -pub type IsLocal = ConstBool; -pub type IsForeign = ConstBool; - /// This trait ensure we can convert AccountIds to AssetIds /// We will require Runtime to have this trait implemented pub trait AccountIdAssetIdConversion { @@ -90,23 +83,23 @@ pub trait AccountIdAssetIdConversion { /// This means that every address that starts with 0xFFFFFFFF will go through an additional db read, /// but the probability for this to happen is 2^-32 for random addresses -pub struct Erc20AssetsPrecompileSet( - PhantomData<(Runtime, IsLocal, Instance)>, +pub struct Erc20AssetsPrecompileSet( + PhantomData<(Runtime, Instance)>, ); -impl Clone for Erc20AssetsPrecompileSet { +impl Clone for Erc20AssetsPrecompileSet { fn clone(&self) -> Self { Self(PhantomData) } } -impl Default for Erc20AssetsPrecompileSet { +impl Default for Erc20AssetsPrecompileSet { fn default() -> Self { Self(PhantomData) } } -impl Erc20AssetsPrecompileSet { +impl Erc20AssetsPrecompileSet { pub fn new() -> Self { Self(PhantomData) } @@ -114,8 +107,8 @@ impl Erc20AssetsPrecompileSet Erc20AssetsPrecompileSet +#[precompile::test_concrete_types(mock::Runtime, pallet_assets::Instance1)] +impl Erc20AssetsPrecompileSet where Instance: eip2612::InstanceToPrefix + 'static, Runtime: pallet_assets::Config + pallet_evm::Config + frame_system::Config, @@ -125,7 +118,6 @@ where BalanceOf: TryFrom + Into + solidity::Codec, Runtime: AccountIdAssetIdConversion>, <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, - IsLocal: Get, AssetIdOf: Display, Runtime::AccountId: Into, { @@ -521,356 +513,6 @@ where Ok(Address(freezer)) } - // From here: only for locals, we need to check whether we are in local assets otherwise fail - #[precompile::public("mint(address,uint256)")] - fn mint( - asset_id: AssetIdOf, - handle: &mut impl PrecompileHandle, - to: Address, - value: U256, - ) -> EvmResult { - if !IsLocal::get() { - return Err(RevertReason::UnknownSelector.into()); - } - - handle.record_log_costs_manual(3, 32)?; - - let to: H160 = to.into(); - let value = Self::u256_to_amount(value).in_field("value")?; - - // Build call with origin. - { - let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); - let to = Runtime::AddressMapping::into_account_id(to); - - // Dispatch call (if enough gas). - RuntimeHelper::::try_dispatch( - handle, - Some(origin).into(), - pallet_assets::Call::::mint { - id: asset_id.into(), - beneficiary: Runtime::Lookup::unlookup(to), - amount: value, - }, - SYSTEM_ACCOUNT_SIZE, - )?; - } - - log3( - handle.context().address, - SELECTOR_LOG_TRANSFER, - H160::default(), - to, - solidity::encode_event_data(value), - ) - .record(handle)?; - - Ok(true) - } - - #[precompile::public("burn(address,uint256)")] - fn burn( - asset_id: AssetIdOf, - handle: &mut impl PrecompileHandle, - from: Address, - value: U256, - ) -> EvmResult { - if !IsLocal::get() { - return Err(RevertReason::UnknownSelector.into()); - } - - handle.record_log_costs_manual(3, 32)?; - - let from: H160 = from.into(); - let value = Self::u256_to_amount(value).in_field("value")?; - - // Build call with origin. - { - let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); - let from = Runtime::AddressMapping::into_account_id(from); - - // Dispatch call (if enough gas). - RuntimeHelper::::try_dispatch( - handle, - Some(origin).into(), - pallet_assets::Call::::burn { - id: asset_id.into(), - who: Runtime::Lookup::unlookup(from), - amount: value, - }, - 0, - )?; - } - - log3( - handle.context().address, - SELECTOR_LOG_TRANSFER, - from, - H160::default(), - solidity::encode_event_data(value), - ) - .record(handle)?; - - Ok(true) - } - - #[precompile::public("freeze(address)")] - fn freeze( - asset_id: AssetIdOf, - handle: &mut impl PrecompileHandle, - account: Address, - ) -> EvmResult { - if !IsLocal::get() { - return Err(RevertReason::UnknownSelector.into()); - } - - let account: H160 = account.into(); - - // Build call with origin. - { - let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); - let account = Runtime::AddressMapping::into_account_id(account); - - // Dispatch call (if enough gas). - RuntimeHelper::::try_dispatch( - handle, - Some(origin).into(), - pallet_assets::Call::::freeze { - id: asset_id.into(), - who: Runtime::Lookup::unlookup(account), - }, - 0, - )?; - } - - Ok(true) - } - - #[precompile::public("thaw(address)")] - fn thaw( - asset_id: AssetIdOf, - handle: &mut impl PrecompileHandle, - account: Address, - ) -> EvmResult { - if !IsLocal::get() { - return Err(RevertReason::UnknownSelector.into()); - } - - let account: H160 = account.into(); - - // Build call with origin. - { - let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); - let account = Runtime::AddressMapping::into_account_id(account); - - // Dispatch call (if enough gas). - RuntimeHelper::::try_dispatch( - handle, - Some(origin).into(), - pallet_assets::Call::::thaw { - id: asset_id.into(), - who: Runtime::Lookup::unlookup(account), - }, - 0, - )?; - } - - Ok(true) - } - - #[precompile::public("freezeAsset()")] - #[precompile::public("freeze_asset()")] - fn freeze_asset( - asset_id: AssetIdOf, - handle: &mut impl PrecompileHandle, - ) -> EvmResult { - if !IsLocal::get() { - return Err(RevertReason::UnknownSelector.into()); - } - - // Build call with origin. - { - let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); - - // Dispatch call (if enough gas). - RuntimeHelper::::try_dispatch( - handle, - Some(origin).into(), - pallet_assets::Call::::freeze_asset { - id: asset_id.into(), - }, - 0, - )?; - } - - Ok(true) - } - - #[precompile::public("thawAsset()")] - #[precompile::public("thaw_asset()")] - fn thaw_asset( - asset_id: AssetIdOf, - handle: &mut impl PrecompileHandle, - ) -> EvmResult { - if !IsLocal::get() { - return Err(RevertReason::UnknownSelector.into()); - } - - // Build call with origin. - { - let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); - - // Dispatch call (if enough gas). - RuntimeHelper::::try_dispatch( - handle, - Some(origin).into(), - pallet_assets::Call::::thaw_asset { - id: asset_id.into(), - }, - 0, - )?; - } - - // Build output. - Ok(true) - } - - #[precompile::public("transferOwnership(address)")] - #[precompile::public("transfer_ownership(address)")] - fn transfer_ownership( - asset_id: AssetIdOf, - handle: &mut impl PrecompileHandle, - owner: Address, - ) -> EvmResult { - if !IsLocal::get() { - return Err(RevertReason::UnknownSelector.into()); - } - - let owner: H160 = owner.into(); - - // Build call with origin. - { - let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); - let owner = Runtime::AddressMapping::into_account_id(owner); - - // Dispatch call (if enough gas). - RuntimeHelper::::try_dispatch( - handle, - Some(origin).into(), - pallet_assets::Call::::transfer_ownership { - id: asset_id.into(), - owner: Runtime::Lookup::unlookup(owner), - }, - 0, - )?; - } - - Ok(true) - } - - #[precompile::public("setTeam(address,address,address)")] - #[precompile::public("set_team(address,address,address)")] - fn set_team( - asset_id: AssetIdOf, - handle: &mut impl PrecompileHandle, - issuer: Address, - admin: Address, - freezer: Address, - ) -> EvmResult { - if !IsLocal::get() { - return Err(RevertReason::UnknownSelector.into()); - } - - let issuer: H160 = issuer.into(); - let admin: H160 = admin.into(); - let freezer: H160 = freezer.into(); - - // Build call with origin. - { - let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); - let issuer = Runtime::AddressMapping::into_account_id(issuer); - let admin = Runtime::AddressMapping::into_account_id(admin); - let freezer = Runtime::AddressMapping::into_account_id(freezer); - - // Dispatch call (if enough gas). - RuntimeHelper::::try_dispatch( - handle, - Some(origin).into(), - pallet_assets::Call::::set_team { - id: asset_id.into(), - issuer: Runtime::Lookup::unlookup(issuer), - admin: Runtime::Lookup::unlookup(admin), - freezer: Runtime::Lookup::unlookup(freezer), - }, - 0, - )?; - } - - Ok(true) - } - - #[precompile::public("setMetadata(string,string,uint8)")] - #[precompile::public("set_metadata(string,string,uint8)")] - fn set_metadata( - asset_id: AssetIdOf, - handle: &mut impl PrecompileHandle, - name: BoundedString>, - symbol: BoundedString>, - decimals: u8, - ) -> EvmResult { - if !IsLocal::get() { - return Err(RevertReason::UnknownSelector.into()); - } - - // Build call with origin. - { - let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); - - // Dispatch call (if enough gas). - RuntimeHelper::::try_dispatch( - handle, - Some(origin).into(), - pallet_assets::Call::::set_metadata { - id: asset_id.into(), - name: name.into(), - symbol: symbol.into(), - decimals, - }, - 0, - )?; - } - - Ok(true) - } - - #[precompile::public("clearMetadata()")] - #[precompile::public("clear_metadata()")] - fn clear_metadata( - asset_id: AssetIdOf, - handle: &mut impl PrecompileHandle, - ) -> EvmResult { - if !IsLocal::get() { - return Err(RevertReason::UnknownSelector.into()); - } - - // Build call with origin. - { - let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); - - // Dispatch call (if enough gas). - RuntimeHelper::::try_dispatch( - handle, - Some(origin).into(), - pallet_assets::Call::::clear_metadata { - id: asset_id.into(), - }, - 0, - )?; - } - - Ok(true) - } - #[precompile::public("permit(address,address,uint256,uint256,uint8,bytes32,bytes32)")] fn eip2612_permit( asset_id: AssetIdOf, @@ -883,7 +525,7 @@ where r: H256, s: H256, ) -> EvmResult { - >::permit( + >::permit( asset_id, handle, owner, spender, value, deadline, v, r, s, ) } @@ -895,7 +537,7 @@ where handle: &mut impl PrecompileHandle, owner: Address, ) -> EvmResult { - >::nonces(asset_id, handle, owner) + >::nonces(asset_id, handle, owner) } #[precompile::public("DOMAIN_SEPARATOR()")] @@ -904,7 +546,7 @@ where asset_id: AssetIdOf, handle: &mut impl PrecompileHandle, ) -> EvmResult { - >::domain_separator(asset_id, handle) + >::domain_separator(asset_id, handle) } fn u256_to_amount(value: U256) -> MayRevert> { diff --git a/precompiles/assets-erc20/src/mock.rs b/precompiles/assets-erc20/src/mock.rs index 5ba6df4ccb..57ea8659eb 100644 --- a/precompiles/assets-erc20/src/mock.rs +++ b/precompiles/assets-erc20/src/mock.rs @@ -46,21 +46,13 @@ pub type Block = frame_system::mocking::MockBlockU32; /// be routed to Erc20AssetsPrecompileSet being marked as foreign pub const FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX: u32 = 0xffffffff; -/// The local asset precompile address prefix. Addresses that match against this prefix will -/// be routed to Erc20AssetsPrecompileSet being marked as local -pub const LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX: u32 = 0xfffffffe; - parameter_types! { pub ForeignAssetPrefix: &'static [u8] = &[0xff, 0xff, 0xff, 0xff]; - pub LocalAssetPrefix: &'static [u8] = &[0xff, 0xff, 0xff, 0xfe]; } mock_account!(ForeignAssetId(AssetId), |value: ForeignAssetId| { AddressInPrefixedSet(FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, value.0).into() }); -mock_account!(LocalAssetId(AssetId), |value: LocalAssetId| { - AddressInPrefixedSet(LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, value.0).into() -}); // Implement the trait, where we convert AccountId to AssetID impl AccountIdAssetIdConversion for Runtime { @@ -75,28 +67,12 @@ impl AccountIdAssetIdConversion for Runtime { account.without_prefix(), )); } - - if account.has_prefix_u32(LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX) { - return Some(( - LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX.to_be_bytes().to_vec(), - account.without_prefix(), - )); - } - None } // Not used for now - fn asset_id_to_account(prefix: &[u8], asset_id: AssetId) -> AccountId { - if prefix - == LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX - .to_be_bytes() - .as_slice() - { - LocalAssetId(asset_id).into() - } else { - ForeignAssetId(asset_id).into() - } + fn asset_id_to_account(_prefix: &[u8], asset_id: AssetId) -> AccountId { + ForeignAssetId(asset_id).into() } } @@ -168,17 +144,12 @@ pub type Precompiles = PrecompileSetBuilder< ( PrecompileSetStartingWith< ForeignAssetPrefix, - Erc20AssetsPrecompileSet, - >, - PrecompileSetStartingWith< - LocalAssetPrefix, - Erc20AssetsPrecompileSet, + Erc20AssetsPrecompileSet, >, ), >; -pub type LocalPCall = Erc20AssetsPrecompileSetCall; -pub type ForeignPCall = Erc20AssetsPrecompileSetCall; +pub type ForeignPCall = Erc20AssetsPrecompileSetCall; const MAX_POV_SIZE: u64 = 5 * 1024 * 1024; /// Block Storage Limit in bytes. Set to 40KB. @@ -224,7 +195,6 @@ impl pallet_evm::Config for Runtime { } type ForeignAssetInstance = pallet_assets::Instance1; -type LocalAssetInstance = pallet_assets::Instance2; // Required for runtime benchmarks pallet_assets::runtime_benchmarks_enabled! { @@ -274,30 +244,6 @@ impl pallet_assets::Config for Runtime { } } -impl pallet_assets::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Balance = Balance; - type AssetId = AssetId; - type Currency = Balances; - type ForceOrigin = EnsureRoot; - type AssetDeposit = AssetDeposit; - type MetadataDepositBase = MetadataDepositBase; - type MetadataDepositPerByte = MetadataDepositPerByte; - type ApprovalDeposit = ApprovalDeposit; - type StringLimit = AssetsStringLimit; - type Freezer = (); - type Extra = (); - type AssetAccountDeposit = AssetAccountDeposit; - type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<656>; - type AssetIdParameter = AssetId; - type CreateOrigin = AsEnsureOriginWithArg>; - type CallbackHandle = (); - pallet_assets::runtime_benchmarks_enabled! { - type BenchmarkHelper = BenchmarkHelper; - } -} - // Configure a mock runtime to test the pallet. construct_runtime!( pub enum Runtime @@ -307,7 +253,6 @@ construct_runtime!( ForeignAssets: pallet_assets::, Evm: pallet_evm, Timestamp: pallet_timestamp, - LocalAssets: pallet_assets::, } ); diff --git a/precompiles/assets-erc20/src/tests.rs b/precompiles/assets-erc20/src/tests.rs index 5988770dbc..263b00dae0 100644 --- a/precompiles/assets-erc20/src/tests.rs +++ b/precompiles/assets-erc20/src/tests.rs @@ -80,17 +80,6 @@ fn selectors() { assert!(ForeignPCall::eip2612_permit_selectors().contains(&0xd505accf)); assert!(ForeignPCall::eip2612_domain_separator_selectors().contains(&0x3644e515)); - assert!(ForeignPCall::mint_selectors().contains(&0x40c10f19)); - assert!(ForeignPCall::burn_selectors().contains(&0x9dc29fac)); - assert!(ForeignPCall::freeze_selectors().contains(&0x8d1fdf2f)); - assert!(ForeignPCall::thaw_selectors().contains(&0x5ea20216)); - assert!(ForeignPCall::freeze_asset_selectors().contains(&0xd4937f51)); - assert!(ForeignPCall::thaw_asset_selectors().contains(&0x51ec2ad7)); - assert!(ForeignPCall::transfer_ownership_selectors().contains(&0xf2fde38b)); - assert!(ForeignPCall::set_team_selectors().contains(&0xc7d93c59)); - assert!(ForeignPCall::set_metadata_selectors().contains(&0x37d2c2f4)); - assert!(ForeignPCall::clear_metadata_selectors().contains(&0xefb6d432)); - assert_eq!( crate::SELECTOR_LOG_TRANSFER, &Keccak256::digest(b"Transfer(address,address,uint256)")[..] @@ -130,17 +119,6 @@ fn modifiers() { tester.test_view_modifier(ForeignPCall::eip2612_nonces_selectors()); tester.test_default_modifier(ForeignPCall::eip2612_permit_selectors()); tester.test_view_modifier(ForeignPCall::eip2612_domain_separator_selectors()); - - tester.test_default_modifier(ForeignPCall::mint_selectors()); - tester.test_default_modifier(ForeignPCall::burn_selectors()); - tester.test_default_modifier(ForeignPCall::freeze_selectors()); - tester.test_default_modifier(ForeignPCall::thaw_selectors()); - tester.test_default_modifier(ForeignPCall::freeze_asset_selectors()); - tester.test_default_modifier(ForeignPCall::thaw_asset_selectors()); - tester.test_default_modifier(ForeignPCall::transfer_ownership_selectors()); - tester.test_default_modifier(ForeignPCall::set_team_selectors()); - tester.test_default_modifier(ForeignPCall::set_metadata_selectors()); - tester.test_default_modifier(ForeignPCall::clear_metadata_selectors()); }); } @@ -649,846 +627,180 @@ fn transfer_from_non_incremental_approval() { CryptoAlith, Bob, solidity::encode_event_data(U256::from(500)), - )) - .execute_returns(true); - - // We then approve 300. Non-incremental, so this is - // the approved new value - // Additionally, the gas used in this approval is higher because we - // need to clear the previous one - precompiles() - .prepare_test( - CryptoAlith, - ForeignAssetId(0u128), - ForeignPCall::approve { - spender: Address(Bob.into()), - value: 300.into(), - }, - ) - .expect_cost(72171756) - .expect_log(log3( - ForeignAssetId(0u128), - SELECTOR_LOG_APPROVAL, - CryptoAlith, - Bob, - solidity::encode_event_data(U256::from(300)), - )) - .execute_returns(true); - - // This should fail, as now the new approved quantity is 300 - precompiles() - .prepare_test( - Bob, // Bob is the one sending transferFrom! - ForeignAssetId(0u128), - ForeignPCall::transfer_from { - from: Address(CryptoAlith.into()), - to: Address(Bob.into()), - value: 500.into(), - }, - ) - .execute_reverts(|output| { - output - == b"Dispatched call failed with error: Module(ModuleError { index: 2, error: [10, 0, 0, 0], \ - message: Some(\"Unapproved\") })" - }); - }); -} - -#[test] -fn transfer_from_above_allowance() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000)]) - .build() - .execute_with(|| { - assert_ok!(ForeignAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(ForeignAssets::mint( - RuntimeOrigin::signed(CryptoAlith.into()), - 0u128, - CryptoAlith.into(), - 1000 - )); - - precompiles() - .prepare_test( - CryptoAlith, - ForeignAssetId(0u128), - ForeignPCall::approve { - spender: Address(Bob.into()), - value: 300.into(), - }, - ) - .execute_some(); - - precompiles() - .prepare_test( - Bob, // Bob is the one sending transferFrom! - ForeignAssetId(0u128), - ForeignPCall::transfer_from { - from: Address(CryptoAlith.into()), - to: Address(Bob.into()), - value: 400.into(), - }, - ) - .execute_reverts(|output| { - output - == b"Dispatched call failed with error: Module(ModuleError { index: 2, error: [10, 0, 0, 0], \ - message: Some(\"Unapproved\") })" - }); - }); -} - -#[test] -fn transfer_from_self() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000)]) - .build() - .execute_with(|| { - assert_ok!(ForeignAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(ForeignAssets::mint( - RuntimeOrigin::signed(CryptoAlith.into()), - 0u128, - CryptoAlith.into(), - 1000 - )); - - precompiles() - .prepare_test( - CryptoAlith, // CryptoAlith sending transferFrom herself, no need for allowance. - ForeignAssetId(0u128), - ForeignPCall::transfer_from { - from: Address(CryptoAlith.into()), - to: Address(Bob.into()), - value: 400.into(), - }, - ) - .expect_cost(48477756) // 1 weight => 1 gas in mock - .expect_log(log3( - ForeignAssetId(0u128), - SELECTOR_LOG_TRANSFER, - CryptoAlith, - Bob, - solidity::encode_event_data(U256::from(400)), - )) - .execute_returns(true); - - precompiles() - .prepare_test( - CryptoAlith, - ForeignAssetId(0u128), - ForeignPCall::balance_of { - who: Address(CryptoAlith.into()), - }, - ) - .expect_cost(0) // TODO: Test db read/write costs - .expect_no_logs() - .execute_returns(U256::from(600)); - - precompiles() - .prepare_test( - CryptoAlith, - ForeignAssetId(0u128), - ForeignPCall::balance_of { - who: Address(Bob.into()), - }, - ) - .expect_cost(0) // TODO: Test db read/write costs - .expect_no_logs() - .execute_returns(U256::from(400)); - }); -} - -#[test] -fn get_metadata() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) - .build() - .execute_with(|| { - assert_ok!(ForeignAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(ForeignAssets::force_set_metadata( - RuntimeOrigin::root(), - 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false - )); - - precompiles() - .prepare_test(CryptoAlith, ForeignAssetId(0u128), ForeignPCall::name {}) - .expect_cost(0) // TODO: Test db read/write costs - .expect_no_logs() - .execute_returns(UnboundedBytes::from("TestToken")); - - precompiles() - .prepare_test(CryptoAlith, ForeignAssetId(0u128), ForeignPCall::symbol {}) - .expect_cost(0) // TODO: Test db read/write costs - .expect_no_logs() - .execute_returns(UnboundedBytes::from("Test")); - - precompiles() - .prepare_test( - CryptoAlith, - ForeignAssetId(0u128), - ForeignPCall::decimals {}, - ) - .expect_cost(0) // TODO: Test db read/write costs - .expect_no_logs() - .execute_returns(12u8); - }); -} - -#[test] -fn local_functions_cannot_be_accessed_by_foreign_assets() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) - .build() - .execute_with(|| { - assert_ok!(ForeignAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(ForeignAssets::force_set_metadata( - RuntimeOrigin::root(), - 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false - )); - - precompiles() - .prepare_test( - CryptoAlith, - ForeignAssetId(0u128), - ForeignPCall::mint { - to: Address(Bob.into()), - value: 400.into(), - }, - ) - .execute_reverts(|output| output == b"Unknown selector"); - - precompiles() - .prepare_test( - CryptoAlith, - ForeignAssetId(0u128), - ForeignPCall::burn { - from: Address(Bob.into()), - value: 400.into(), - }, - ) - .execute_reverts(|output| output == b"Unknown selector"); - }); -} - -#[test] -fn mint_local_assets() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) - .build() - .execute_with(|| { - assert_ok!(LocalAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(LocalAssets::force_set_metadata( - RuntimeOrigin::root(), - 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false - )); - - precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::mint { - to: Address(Bob.into()), - value: 400.into(), - }, - ) - .expect_cost(27261756) // 1 weight => 1 gas in mock - .expect_log(log3( - LocalAssetId(0u128), - SELECTOR_LOG_TRANSFER, - Zero, - Bob, - solidity::encode_event_data(U256::from(400)), - )) - .execute_returns(true); - - precompiles() - .prepare_test( - Bob, - LocalAssetId(0u128), - LocalPCall::balance_of { - who: Address(Bob.into()), - }, - ) - .expect_cost(0) // TODO: Test db read/write costs - .expect_no_logs() - .execute_returns(U256::from(400)); - }); -} - -#[test] -fn burn_local_assets() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) - .build() - .execute_with(|| { - assert_ok!(LocalAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(LocalAssets::force_set_metadata( - RuntimeOrigin::root(), - 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false - )); - assert_ok!(LocalAssets::mint( - RuntimeOrigin::signed(CryptoAlith.into()), - 0u128, - CryptoAlith.into(), - 1000 - )); - - precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::burn { - from: Address(CryptoAlith.into()), - value: 400.into(), - }, - ) - .expect_cost(34475756) // 1 weight => 1 gas in mock - .expect_log(log3( - LocalAssetId(0u128), - SELECTOR_LOG_TRANSFER, - CryptoAlith, - Zero, - solidity::encode_event_data(U256::from(400)), - )) - .execute_returns(true); - - precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::balance_of { - who: Address(CryptoAlith.into()), - }, - ) - .expect_cost(0) // TODO: Test db read/write costs - .expect_no_logs() - .execute_returns(U256::from(600)); - }); -} - -#[test] -fn freeze_local_assets() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) - .build() - .execute_with(|| { - assert_ok!(LocalAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(LocalAssets::force_set_metadata( - RuntimeOrigin::root(), - 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false - )); - assert_ok!(LocalAssets::mint( - RuntimeOrigin::signed(CryptoAlith.into()), - 0u128, - Bob.into(), - 1000 - )); - - precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::freeze { - account: Address(Bob.into()), - }, - ) - .expect_cost(18384000) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_returns(true); - - precompiles() - .prepare_test( - Bob, - LocalAssetId(0u128), - LocalPCall::transfer { - to: Address(CryptoAlith.into()), - value: 400.into(), - }, - ) - .execute_reverts(|output| { - from_utf8(&output) - .unwrap() - .contains("Dispatched call failed with error: ") - && from_utf8(&output).unwrap().contains("Frozen") - }); - }); -} - -#[test] -fn thaw_local_assets() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) - .build() - .execute_with(|| { - assert_ok!(LocalAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(LocalAssets::force_set_metadata( - RuntimeOrigin::root(), - 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false - )); - assert_ok!(LocalAssets::mint( - RuntimeOrigin::signed(CryptoAlith.into()), - 0u128, - Bob.into(), - 1000 - )); - - precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::freeze { - account: Address(Bob.into()), - }, - ) - .expect_cost(18384000) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_returns(true); - - precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::thaw { - account: Address(Bob.into()), - }, - ) - .expect_cost(18282000) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_returns(true); - - precompiles() - .prepare_test( - Bob, - LocalAssetId(0u128), - LocalPCall::transfer { - to: Address(CryptoAlith.into()), - value: 400.into(), - }, - ) - .expect_cost(48477756) // 1 weight => 1 gas in mock - .expect_log(log3( - LocalAssetId(0u128), - SELECTOR_LOG_TRANSFER, - Bob, - CryptoAlith, - solidity::encode_event_data(U256::from(400)), - )) - .execute_returns(true); - }); -} - -#[test] -fn freeze_asset_local_asset() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) - .build() - .execute_with(|| { - assert_ok!(LocalAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(LocalAssets::force_set_metadata( - RuntimeOrigin::root(), - 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false - )); - assert_ok!(LocalAssets::mint( - RuntimeOrigin::signed(CryptoAlith.into()), - 0u128, - Bob.into(), - 1000 - )); - - precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::freeze_asset {}, - ) - .expect_cost(14193000) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_returns(true); - - precompiles() - .prepare_test( - Bob, - LocalAssetId(0u128), - LocalPCall::transfer { - to: Address(CryptoAlith.into()), - value: 400.into(), - }, - ) - .execute_reverts(|output| { - from_utf8(&output) - .unwrap() - .contains("Dispatched call failed with error: ") - && from_utf8(&output).unwrap().contains("AssetNotLive") - }); - }); -} - -#[test] -fn thaw_asset_local_assets() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) - .build() - .execute_with(|| { - assert_ok!(LocalAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(LocalAssets::force_set_metadata( - RuntimeOrigin::root(), - 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false - )); - assert_ok!(LocalAssets::mint( - RuntimeOrigin::signed(CryptoAlith.into()), - 0u128, - Bob.into(), - 1000 - )); - - precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::freeze_asset {}, - ) - .expect_cost(14193000) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_returns(true); - - precompiles() - .prepare_test(CryptoAlith, LocalAssetId(0u128), LocalPCall::thaw_asset {}) - .expect_cost(14263000) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_returns(true); - - precompiles() - .prepare_test( - Bob, - LocalAssetId(0u128), - LocalPCall::transfer { - to: Address(CryptoAlith.into()), - value: 400.into(), - }, - ) - .expect_cost(48477756) // 1 weight => 1 gas in mock - .expect_log(log3( - LocalAssetId(0u128), - SELECTOR_LOG_TRANSFER, - Bob, - CryptoAlith, - solidity::encode_event_data(U256::from(400)), - )) - .execute_returns(true); - }); -} - -#[test] -fn transfer_ownership_local_assets() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) - .build() - .execute_with(|| { - assert_ok!(LocalAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(LocalAssets::force_set_metadata( - RuntimeOrigin::root(), - 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false - )); + )) + .execute_returns(true); + // We then approve 300. Non-incremental, so this is + // the approved new value + // Additionally, the gas used in this approval is higher because we + // need to clear the previous one precompiles() .prepare_test( CryptoAlith, - LocalAssetId(0u128), - LocalPCall::transfer_ownership { - owner: Address(Bob.into()), + ForeignAssetId(0u128), + ForeignPCall::approve { + spender: Address(Bob.into()), + value: 300.into(), }, ) - .expect_cost(16042000) // 1 weight => 1 gas in mock - .expect_no_logs() + .expect_cost(72171756) + .expect_log(log3( + ForeignAssetId(0u128), + SELECTOR_LOG_APPROVAL, + CryptoAlith, + Bob, + solidity::encode_event_data(U256::from(300)), + )) .execute_returns(true); - // Now Bob should be able to change ownership, and not CryptoAlith + // This should fail, as now the new approved quantity is 300 precompiles() .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::transfer_ownership { - owner: Address(Bob.into()), + Bob, // Bob is the one sending transferFrom! + ForeignAssetId(0u128), + ForeignPCall::transfer_from { + from: Address(CryptoAlith.into()), + to: Address(Bob.into()), + value: 500.into(), }, ) .execute_reverts(|output| { - from_utf8(&output) - .unwrap() - .contains("Dispatched call failed with error: ") - && from_utf8(&output).unwrap().contains("NoPermission") + output + == b"Dispatched call failed with error: Module(ModuleError { index: 2, error: [10, 0, 0, 0], \ + message: Some(\"Unapproved\") })" }); - - precompiles() - .prepare_test( - Bob, - LocalAssetId(0u128), - LocalPCall::transfer_ownership { - owner: Address(CryptoAlith.into()), - }, - ) - .expect_cost(16042000) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_returns(true); }); } #[test] -fn set_team_local_assets() { +fn transfer_from_above_allowance() { ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) + .with_balances(vec![(CryptoAlith.into(), 1000)]) .build() .execute_with(|| { - assert_ok!(LocalAssets::force_create( + assert_ok!(ForeignAssets::force_create( RuntimeOrigin::root(), 0u128, CryptoAlith.into(), true, 1 )); - assert_ok!(LocalAssets::force_set_metadata( - RuntimeOrigin::root(), + assert_ok!(ForeignAssets::mint( + RuntimeOrigin::signed(CryptoAlith.into()), 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false + CryptoAlith.into(), + 1000 )); precompiles() .prepare_test( CryptoAlith, - LocalAssetId(0u128), - LocalPCall::set_team { - issuer: Address(Bob.into()), - admin: Address(Bob.into()), - freezer: Address(Bob.into()), + ForeignAssetId(0u128), + ForeignPCall::approve { + spender: Address(Bob.into()), + value: 300.into(), }, ) - .expect_cost(14641000) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_returns(true); + .execute_some(); - // Now Bob should be able to mint, and not CryptoAlith precompiles() .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::mint { + Bob, // Bob is the one sending transferFrom! + ForeignAssetId(0u128), + ForeignPCall::transfer_from { + from: Address(CryptoAlith.into()), to: Address(Bob.into()), value: 400.into(), }, ) .execute_reverts(|output| { - from_utf8(&output) - .unwrap() - .contains("Dispatched call failed with error: ") - && from_utf8(&output).unwrap().contains("NoPermission") + output + == b"Dispatched call failed with error: Module(ModuleError { index: 2, error: [10, 0, 0, 0], \ + message: Some(\"Unapproved\") })" }); - - precompiles() - .prepare_test( - Bob, - LocalAssetId(0u128), - LocalPCall::mint { - to: Address(Bob.into()), - value: 400.into(), - }, - ) - .expect_cost(27261756) // 1 weight => 1 gas in mock - .expect_log(log3( - LocalAssetId(0u128), - SELECTOR_LOG_TRANSFER, - Zero, - Bob, - solidity::encode_event_data(U256::from(400)), - )) - .execute_returns(true); - - precompiles() - .prepare_test( - Bob, - LocalAssetId(0u128), - LocalPCall::balance_of { - who: Address(Bob.into()), - }, - ) - .expect_cost(0) // TODO: Test db read/write costs - .expect_no_logs() - .execute_returns(U256::from(400)); }); } #[test] -fn set_metadata() { +fn transfer_from_self() { ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) + .with_balances(vec![(CryptoAlith.into(), 1000)]) .build() .execute_with(|| { - assert_ok!(LocalAssets::force_create( + assert_ok!(ForeignAssets::force_create( RuntimeOrigin::root(), 0u128, CryptoAlith.into(), true, 1 )); - assert_ok!(LocalAssets::force_set_metadata( - RuntimeOrigin::root(), + assert_ok!(ForeignAssets::mint( + RuntimeOrigin::signed(CryptoAlith.into()), 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false + CryptoAlith.into(), + 1000 )); precompiles() .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::set_metadata { - name: "TestToken".into(), - symbol: "Test".into(), - decimals: 12, + CryptoAlith, // CryptoAlith sending transferFrom herself, no need for allowance. + ForeignAssetId(0u128), + ForeignPCall::transfer_from { + from: Address(CryptoAlith.into()), + to: Address(Bob.into()), + value: 400.into(), }, ) - .expect_cost(31456892) // 1 weight => 1 gas in mock - .expect_no_logs() + .expect_cost(48477756) // 1 weight => 1 gas in mock + .expect_log(log3( + ForeignAssetId(0u128), + SELECTOR_LOG_TRANSFER, + CryptoAlith, + Bob, + solidity::encode_event_data(U256::from(400)), + )) .execute_returns(true); precompiles() - .prepare_test(CryptoAlith, LocalAssetId(0u128), LocalPCall::name {}) - .expect_cost(0) // TODO: Test db read/write costs - .expect_no_logs() - .execute_returns(UnboundedBytes::from("TestToken")); - - precompiles() - .prepare_test(CryptoAlith, LocalAssetId(0u128), LocalPCall::symbol {}) + .prepare_test( + CryptoAlith, + ForeignAssetId(0u128), + ForeignPCall::balance_of { + who: Address(CryptoAlith.into()), + }, + ) .expect_cost(0) // TODO: Test db read/write costs .expect_no_logs() - .execute_returns(UnboundedBytes::from("Test")); + .execute_returns(U256::from(600)); precompiles() - .prepare_test(CryptoAlith, LocalAssetId(0u128), LocalPCall::decimals {}) + .prepare_test( + CryptoAlith, + ForeignAssetId(0u128), + ForeignPCall::balance_of { + who: Address(Bob.into()), + }, + ) .expect_cost(0) // TODO: Test db read/write costs .expect_no_logs() - .execute_returns(12u8); + .execute_returns(U256::from(400)); }); } #[test] -fn clear_metadata() { +fn get_metadata() { ExtBuilder::default() .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) .build() .execute_with(|| { - assert_ok!(LocalAssets::force_create( + assert_ok!(ForeignAssets::force_create( RuntimeOrigin::root(), 0u128, CryptoAlith.into(), true, 1 )); - assert_ok!(LocalAssets::force_set_metadata( + assert_ok!(ForeignAssets::force_set_metadata( RuntimeOrigin::root(), 0u128, b"TestToken".to_vec(), @@ -1498,46 +810,26 @@ fn clear_metadata() { )); precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::set_metadata { - name: "TestToken".into(), - symbol: "Test".into(), - decimals: 12, - }, - ) - .expect_cost(31456892) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_returns(true); - - precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::clear_metadata {}, - ) - .expect_cost(31930000) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_returns(true); - - precompiles() - .prepare_test(CryptoAlith, LocalAssetId(0u128), LocalPCall::name {}) + .prepare_test(CryptoAlith, ForeignAssetId(0u128), ForeignPCall::name {}) .expect_cost(0) // TODO: Test db read/write costs .expect_no_logs() - .execute_returns(UnboundedBytes::from("")); + .execute_returns(UnboundedBytes::from("TestToken")); precompiles() - .prepare_test(CryptoAlith, LocalAssetId(0u128), LocalPCall::symbol {}) + .prepare_test(CryptoAlith, ForeignAssetId(0u128), ForeignPCall::symbol {}) .expect_cost(0) // TODO: Test db read/write costs .expect_no_logs() - .execute_returns(UnboundedBytes::from("")); + .execute_returns(UnboundedBytes::from("Test")); precompiles() - .prepare_test(CryptoAlith, LocalAssetId(0u128), LocalPCall::decimals {}) + .prepare_test( + CryptoAlith, + ForeignAssetId(0u128), + ForeignPCall::decimals {}, + ) .expect_cost(0) // TODO: Test db read/write costs .expect_no_logs() - .execute_returns(0u8); + .execute_returns(12u8); }); } @@ -1566,7 +858,7 @@ fn permit_valid() { let value: U256 = 500u16.into(); let deadline: U256 = 0u8.into(); // todo: proper timestamp - let permit = Eip2612::::generate_permit( + let permit = Eip2612::::generate_permit( ForeignAssetId(0u128).into(), 0u128, owner, @@ -1675,7 +967,7 @@ fn permit_valid_named_asset() { let value: U256 = 500u16.into(); let deadline: U256 = 0u8.into(); // todo: proper timestamp - let permit = Eip2612::::generate_permit( + let permit = Eip2612::::generate_permit( ForeignAssetId(0u128).into(), 0u128, owner, @@ -1777,7 +1069,7 @@ fn permit_invalid_nonce() { let value: U256 = 500u16.into(); let deadline: U256 = 0u8.into(); - let permit = Eip2612::::generate_permit( + let permit = Eip2612::::generate_permit( ForeignAssetId(0u128).into(), 0u128, owner, @@ -1953,7 +1245,7 @@ fn permit_invalid_deadline() { let value: U256 = 500u16.into(); let deadline: U256 = 5u8.into(); // deadline < timestamp => expired - let permit = Eip2612::::generate_permit( + let permit = Eip2612::::generate_permit( ForeignAssetId(0u128).into(), 0u128, owner, @@ -2323,93 +1615,13 @@ fn transfer_from_overflow() { }); } -#[test] -fn mint_overflow() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) - .build() - .execute_with(|| { - assert_ok!(LocalAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(LocalAssets::force_set_metadata( - RuntimeOrigin::root(), - 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false - )); - - precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::mint { - to: Address(Bob.into()), - value: U256::from(u128::MAX) + 1, - }, - ) - .expect_cost(1756u64) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_reverts(|e| e == b"value: Value is too large for balance type"); - }); -} - -#[test] -fn burn_overflow() { - ExtBuilder::default() - .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) - .build() - .execute_with(|| { - assert_ok!(LocalAssets::force_create( - RuntimeOrigin::root(), - 0u128, - CryptoAlith.into(), - true, - 1 - )); - assert_ok!(LocalAssets::force_set_metadata( - RuntimeOrigin::root(), - 0u128, - b"TestToken".to_vec(), - b"Test".to_vec(), - 12, - false - )); - assert_ok!(LocalAssets::mint( - RuntimeOrigin::signed(CryptoAlith.into()), - 0u128, - CryptoAlith.into(), - 1000 - )); - - precompiles() - .prepare_test( - CryptoAlith, - LocalAssetId(0u128), - LocalPCall::burn { - from: Address(CryptoAlith.into()), - value: U256::from(u128::MAX) + 1, - }, - ) - .expect_cost(1756u64) // 1 weight => 1 gas in mock - .expect_no_logs() - .execute_reverts(|e| e == b"value: Value is too large for balance type"); - }); -} - #[test] fn get_owner() { ExtBuilder::default() .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) .build() .execute_with(|| { - assert_ok!(LocalAssets::force_create( + assert_ok!(ForeignAssets::force_create( RuntimeOrigin::root(), 0u128, CryptoAlith.into(), @@ -2417,7 +1629,7 @@ fn get_owner() { 1 )); - assert_ok!(LocalAssets::transfer_ownership( + assert_ok!(ForeignAssets::transfer_ownership( RuntimeOrigin::signed(CryptoAlith.into()), 0u128, // owner @@ -2425,7 +1637,7 @@ fn get_owner() { )); precompiles() - .prepare_test(CryptoAlith, LocalAssetId(0u128), ForeignPCall::owner {}) + .prepare_test(CryptoAlith, ForeignAssetId(0u128), ForeignPCall::owner {}) .expect_cost(0) .expect_no_logs() .execute_returns(Address(Bob.into())); @@ -2438,7 +1650,7 @@ fn get_issuer() { .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) .build() .execute_with(|| { - assert_ok!(LocalAssets::force_create( + assert_ok!(ForeignAssets::force_create( RuntimeOrigin::root(), 0u128, CryptoAlith.into(), @@ -2446,7 +1658,7 @@ fn get_issuer() { 1 )); - assert_ok!(LocalAssets::set_team( + assert_ok!(ForeignAssets::set_team( RuntimeOrigin::signed(CryptoAlith.into()), 0u128, // Issuer @@ -2458,7 +1670,7 @@ fn get_issuer() { )); precompiles() - .prepare_test(CryptoAlith, LocalAssetId(0u128), ForeignPCall::issuer {}) + .prepare_test(CryptoAlith, ForeignAssetId(0u128), ForeignPCall::issuer {}) .expect_cost(0) .expect_no_logs() .execute_returns(Address(Bob.into())); @@ -2471,7 +1683,7 @@ fn get_admin() { .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) .build() .execute_with(|| { - assert_ok!(LocalAssets::force_create( + assert_ok!(ForeignAssets::force_create( RuntimeOrigin::root(), 0u128, CryptoAlith.into(), @@ -2479,7 +1691,7 @@ fn get_admin() { 1 )); - assert_ok!(LocalAssets::set_team( + assert_ok!(ForeignAssets::set_team( RuntimeOrigin::signed(CryptoAlith.into()), 0u128, // Issuer @@ -2491,7 +1703,7 @@ fn get_admin() { )); precompiles() - .prepare_test(CryptoAlith, LocalAssetId(0u128), ForeignPCall::admin {}) + .prepare_test(CryptoAlith, ForeignAssetId(0u128), ForeignPCall::admin {}) .expect_cost(0) .expect_no_logs() .execute_returns(Address(Bob.into())); @@ -2504,7 +1716,7 @@ fn get_freezer() { .with_balances(vec![(CryptoAlith.into(), 1000), (Bob.into(), 2500)]) .build() .execute_with(|| { - assert_ok!(LocalAssets::force_create( + assert_ok!(ForeignAssets::force_create( RuntimeOrigin::root(), 0u128, CryptoAlith.into(), @@ -2512,7 +1724,7 @@ fn get_freezer() { 1 )); - assert_ok!(LocalAssets::set_team( + assert_ok!(ForeignAssets::set_team( RuntimeOrigin::signed(CryptoAlith.into()), 0u128, // Issuer @@ -2524,7 +1736,7 @@ fn get_freezer() { )); precompiles() - .prepare_test(CryptoAlith, LocalAssetId(0u128), ForeignPCall::freezer {}) + .prepare_test(CryptoAlith, ForeignAssetId(0u128), ForeignPCall::freezer {}) .expect_cost(0) .expect_no_logs() .execute_returns(Address(Bob.into())); @@ -2534,27 +1746,7 @@ fn get_freezer() { #[test] fn test_solidity_interface_has_all_function_selectors_documented_and_implemented() { check_precompile_implements_solidity_interfaces( - &["ERC20.sol", "LocalAsset.sol", "Permit.sol"], - LocalPCall::supports_selector, + &["ERC20.sol", "Permit.sol"], + ForeignPCall::supports_selector, ) } - -#[test] -fn test_deprecated_solidity_selectors_are_supported() { - for deprecated_function in [ - "freeze_asset()", - "thaw_asset()", - "transfer_ownership(address)", - "set_team(address,address,address)", - "set_metadata(string,string,uint8)", - "clear_metadata()", - ] { - let selector = compute_selector(deprecated_function); - if !LocalPCall::supports_selector(selector) { - panic!( - "failed decoding selector 0x{:x} => '{}' as Action", - selector, deprecated_function, - ) - } - } -} diff --git a/precompiles/utils/src/precompile_set.rs b/precompiles/utils/src/precompile_set.rs index 0a02e1cca6..22682b4594 100644 --- a/precompiles/utils/src/precompile_set.rs +++ b/precompiles/utils/src/precompile_set.rs @@ -128,6 +128,7 @@ impl Into for DiscriminantResult { #[cfg_attr(feature = "testing", derive(serde::Serialize, serde::Deserialize))] pub enum PrecompileKind { Single(H160), + Multiple(Vec), Prefixed(Vec), } @@ -837,6 +838,68 @@ impl IsActivePrecompile for RevertPrecompile { } } +/// Precompiles that were removed from a precompile set. +/// Still considered precompiles but are inactive and always revert. +pub struct RemovedPrecompilesAt(PhantomData); +impl PrecompileSetFragment for RemovedPrecompilesAt +where + A: Get>, +{ + #[inline(always)] + fn new() -> Self { + Self(PhantomData) + } + + #[inline(always)] + fn execute( + &self, + handle: &mut impl PrecompileHandle, + ) -> Option { + if A::get().contains(&handle.code_address()) { + Some(Err(revert("Removed precompile"))) + } else { + None + } + } + + #[inline(always)] + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: A::get().contains(&address), + extra_cost: 0, + } + } + + #[inline(always)] + fn used_addresses(&self) -> Vec { + A::get() + } + + fn summarize_checks(&self) -> Vec { + vec![PrecompileCheckSummary { + name: None, + precompile_kind: PrecompileKind::Multiple(A::get()), + recursion_limit: Some(0), + accept_delegate_call: true, + callable_by_smart_contract: "Reverts in all cases".into(), + callable_by_precompile: "Reverts in all cases".into(), + }] + } +} + +impl IsActivePrecompile for RemovedPrecompilesAt +where + Self: PrecompileSetFragment, +{ + #[inline(always)] + fn is_active_precompile(&self, _address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: false, + extra_cost: 0, + } + } +} + /// A precompile that was removed from a precompile set. /// Still considered a precompile but is inactive and always revert. pub struct RemovedPrecompileAt(PhantomData); diff --git a/precompiles/xcm-utils/src/mock.rs b/precompiles/xcm-utils/src/mock.rs index 14713d603c..26b9ca4308 100644 --- a/precompiles/xcm-utils/src/mock.rs +++ b/precompiles/xcm-utils/src/mock.rs @@ -31,7 +31,6 @@ use sp_core::{H256, U256}; use sp_io; use sp_runtime::traits::{BlakeTwo256, IdentityLookup, TryConvert}; use sp_runtime::BuildStorage; -use sp_std::borrow::Borrow; use xcm::latest::Error as XcmError; use xcm_builder::AllowUnpaidExecutionFrom; use xcm_builder::FixedWeightBounds; @@ -109,7 +108,7 @@ impl ConvertLocation for MockParentMultilocationToAccountConverter { pub struct MockParachainMultilocationToAccountConverter; impl ConvertLocation for MockParachainMultilocationToAccountConverter { fn convert_location(location: &MultiLocation) -> Option { - match location.borrow() { + match location { MultiLocation { parents: 1, interior: Junctions::X1(Parachain(id)), diff --git a/runtime/common/src/migrations.rs b/runtime/common/src/migrations.rs index c1e6a55f67..959cba8786 100644 --- a/runtime/common/src/migrations.rs +++ b/runtime/common/src/migrations.rs @@ -418,6 +418,7 @@ where //Box::new(xcm_transactor_to_xcm_v3), // completed in runtime 2600 //Box::new(remove_min_bond_for_old_orbiter_collators), + // Runtime 2700 Box::new(missing_balances_migrations), Box::new(fix_pallet_versions), Box::new(pallet_referenda_migrate_v0_to_v1), diff --git a/runtime/moonbase/Cargo.toml b/runtime/moonbase/Cargo.toml index 02a6eee57d..0039ec16df 100644 --- a/runtime/moonbase/Cargo.toml +++ b/runtime/moonbase/Cargo.toml @@ -13,7 +13,7 @@ hex-literal = { workspace = true, optional = true } log = { workspace = true } num_enum = { workspace = true } rlp = { workspace = true, optional = true } -serde = { workspace = true, features = [ "derive" ] } +serde = { workspace = true, features = ["derive"] } sha3 = { workspace = true, optional = true } smallvec = { workspace = true } strum = { workspace = true } @@ -36,8 +36,9 @@ pallet-crowdloan-rewards = { workspace = true } pallet-erc20-xcm-bridge = { workspace = true } pallet-evm-chain-id = { workspace = true } pallet-ethereum-xcm = { workspace = true } -pallet-maintenance-mode = { workspace = true, features = [ "xcm-support" ] } +pallet-maintenance-mode = { workspace = true, features = ["xcm-support"] } pallet-migrations = { workspace = true } +pallet-moonbeam-lazy-migrations = { workspace = true } pallet-moonbeam-orbiters = { workspace = true } pallet-parachain-staking = { workspace = true } pallet-proxy-genesis-companion = { workspace = true } @@ -79,7 +80,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } frame-system-rpc-runtime-api = { workspace = true } pallet-assets = { workspace = true } -pallet-balances = { workspace = true, features = [ "insecure_zero_ed" ] } +pallet-balances = { workspace = true, features = ["insecure_zero_ed"] } pallet-collective = { workspace = true } pallet-conviction-voting = { workspace = true } pallet-democracy = { workspace = true } @@ -103,14 +104,14 @@ parity-scale-codec = { workspace = true, features = [ "max-encoded-len", "chain-error", ] } -scale-info = { workspace = true, features = [ "derive" ] } +scale-info = { workspace = true, features = ["derive"] } sp-api = { workspace = true } sp-block-builder = { workspace = true } sp-consensus-slots = { workspace = true } sp-core = { workspace = true } sp-debug-derive = { workspace = true } sp-inherents = { workspace = true } -sp-io = { workspace = true, features = [ "improved_panic_error_reporting" ] } +sp-io = { workspace = true, features = ["improved_panic_error_reporting"] } sp-offchain = { workspace = true } sp-runtime = { workspace = true } sp-session = { workspace = true } @@ -122,9 +123,9 @@ sp-weights = { workspace = true } # Frontier fp-evm = { workspace = true } fp-rpc = { workspace = true } -fp-self-contained = { workspace = true, features = [ "serde" ] } -pallet-ethereum = { workspace = true, features = [ "forbid-evm-reentrancy" ] } -pallet-evm = { workspace = true, features = [ "forbid-evm-reentrancy" ] } +fp-self-contained = { workspace = true, features = ["serde"] } +pallet-ethereum = { workspace = true, features = ["forbid-evm-reentrancy"] } +pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] } pallet-evm-precompile-blake2 = { workspace = true } pallet-evm-precompile-bn128 = { workspace = true } pallet-evm-precompile-dispatch = { workspace = true } @@ -170,8 +171,8 @@ frame-try-runtime = { workspace = true, optional = true } [dev-dependencies] ethereum = { workspace = true } -hex = { workspace = true, features = [ "std" ] } -sha3 = { workspace = true, features = [ "std" ] } +hex = { workspace = true, features = ["std"] } +sha3 = { workspace = true, features = ["std"] } cumulus-primitives-parachain-inherent = { workspace = true } cumulus-test-relay-sproof-builder = { workspace = true } @@ -182,13 +183,13 @@ polkadot-runtime-parachains = { workspace = true } sp-timestamp = { workspace = true } xcm-simulator = { workspace = true } -precompile-utils = { workspace = true, features = [ "std", "testing" ] } +precompile-utils = { workspace = true, features = ["std", "testing"] } [build-dependencies] substrate-wasm-builder = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "account/std", "async-backing-primitives/std", @@ -251,6 +252,7 @@ std = [ "pallet-identity/std", "pallet-maintenance-mode/std", "pallet-migrations/std", + "pallet-moonbeam-lazy-migrations/std", "pallet-moonbeam-orbiters/std", "pallet-multisig/std", "pallet-parachain-staking/std", @@ -296,18 +298,18 @@ std = [ ] # Must be enabled for tracing runtimes only -evm-tracing = [ "evm-tracing-events", "moonbeam-evm-tracer", "rlp", "sha3" ] +evm-tracing = ["evm-tracing-events", "moonbeam-evm-tracer", "rlp", "sha3"] # Allow to print logs details (no wasm:stripped) -force-debug = [ "sp-debug-derive/force-debug" ] +force-debug = ["sp-debug-derive/force-debug"] # Will be enabled by the `wasm-builder` when building the runtime for WASM. -runtime-wasm = [ ] +runtime-wasm = [] # A feature that should be enabled when the runtime should be build for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", @@ -334,6 +336,7 @@ runtime-benchmarks = [ "pallet-evm/runtime-benchmarks", "pallet-identity/runtime-benchmarks", "pallet-migrations/runtime-benchmarks", + "pallet-moonbeam-lazy-migrations/runtime-benchmarks", "pallet-moonbeam-orbiters/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-parachain-staking/runtime-benchmarks", @@ -372,6 +375,7 @@ try-runtime = [ "pallet-maintenance-mode/try-runtime", "pallet-maintenance-mode/try-runtime", "pallet-migrations/try-runtime", + "pallet-moonbeam-lazy-migrations/try-runtime", "pallet-parachain-staking/try-runtime", "pallet-preimage/try-runtime", "pallet-referenda/try-runtime", @@ -382,4 +386,4 @@ try-runtime = [ "pallet-xcm-transactor/try-runtime", ] -moonbase-runtime-benchmarks = [ ] +moonbase-runtime-benchmarks = [] diff --git a/runtime/moonbase/src/asset_config.rs b/runtime/moonbase/src/asset_config.rs index 5e060c5b18..e11870bb63 100644 --- a/runtime/moonbase/src/asset_config.rs +++ b/runtime/moonbase/src/asset_config.rs @@ -19,8 +19,8 @@ use super::{ currency, governance, xcm_config, AccountId, AssetId, AssetManager, Assets, Balance, Balances, - CouncilInstance, LocalAssets, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, - FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, + CouncilInstance, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, + FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, }; use moonbeam_runtime_common::weights as moonbeam_weights; @@ -54,7 +54,6 @@ const REMOVE_ITEMS_LIMIT: u32 = 656; // Not to disrupt the previous asset instance, we assign () to Foreign pub type ForeignAssetInstance = (); -pub type LocalAssetInstance = pallet_assets::Instance1; // For foreign assets, these parameters dont matter much // as this will only be called by root with the forced arguments @@ -116,31 +115,6 @@ impl pallet_assets::Config for Runtime { } } -// Local assets -impl pallet_assets::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Balance = Balance; - type AssetId = AssetId; - type Currency = Balances; - type ForceOrigin = EnsureNever; - type AssetDeposit = AssetDeposit; - type MetadataDepositBase = MetadataDepositBase; - type MetadataDepositPerByte = MetadataDepositPerByte; - type ApprovalDeposit = ApprovalDeposit; - type StringLimit = AssetsStringLimit; - type Freezer = (); - type Extra = (); - type AssetAccountDeposit = ConstU128<{ currency::deposit(1, 18) }>; - type WeightInfo = moonbeam_weights::pallet_assets::WeightInfo; - type RemoveItemsLimit = ConstU32<{ REMOVE_ITEMS_LIMIT }>; - type AssetIdParameter = Compact; - type CreateOrigin = AsEnsureOriginWithArg>; - type CallbackHandle = (); - pallet_assets::runtime_benchmarks_enabled! { - type BenchmarkHelper = BenchmarkHelper; - } -} - // We instruct how to register the Assets // In this case, we tell it to Create an Asset in pallet-assets pub struct AssetRegistrar; @@ -162,15 +136,6 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { min_balance, )?; - // TODO uncomment when we feel comfortable - /* - // The asset has been created. Let's put the revert code in the precompile address - let precompile_address = Runtime::asset_id_to_account(ASSET_PRECOMPILE_ADDRESS_PREFIX, asset); - pallet_evm::AccountCodes::::insert( - precompile_address, - vec![0x60, 0x00, 0x60, 0x00, 0xfd], - );*/ - // Lastly, the metadata Assets::force_set_metadata( RuntimeOrigin::root(), @@ -182,62 +147,10 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { ) } - #[transactional] - fn create_local_asset( - asset: AssetId, - _creator: AccountId, - min_balance: Balance, - is_sufficient: bool, - owner: AccountId, - ) -> DispatchResult { - // We create with root, because we need to decide whether we want to create the asset - // as sufficient. Take into account this does not hold any reserved amount - // in pallet-assets - LocalAssets::force_create( - RuntimeOrigin::root(), - asset.into(), - owner, - is_sufficient, - min_balance, - )?; - - // No metadata needs to be set, as this can be set through regular calls - - // TODO: should we put the revert code? - // The asset has been created. Let's put the revert code in the precompile address - let precompile_address: H160 = - Runtime::asset_id_to_account(LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, asset).into(); - pallet_evm::AccountCodes::::insert( - precompile_address, - vec![0x60, 0x00, 0x60, 0x00, 0xfd], - ); - Ok(()) - } - #[transactional] fn destroy_foreign_asset(asset: AssetId) -> DispatchResult { - // First destroy the asset - Assets::start_destroy(RuntimeOrigin::root(), asset.into())?; - - // We remove the EVM revert code - // This does not panick even if there is no code in the address - let precompile_address: H160 = - Runtime::asset_id_to_account(FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, asset).into(); - pallet_evm::AccountCodes::::remove(precompile_address); - Ok(()) - } - - #[transactional] - fn destroy_local_asset(asset: AssetId) -> DispatchResult { - // First destroy the asset - LocalAssets::start_destroy(RuntimeOrigin::root(), asset.into())?; - - // We remove the EVM revert code - // This does not panick even if there is no code in the address - let precompile_address: H160 = - Runtime::asset_id_to_account(LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, asset).into(); - pallet_evm::AccountCodes::::remove(precompile_address); - Ok(()) + // Mark the asset as destroying + Assets::start_destroy(RuntimeOrigin::root(), asset.into()) } fn destroy_asset_dispatch_info_weight(asset: AssetId) -> Weight { @@ -245,20 +158,15 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { // witness // We need to take the dispatch info from the destroy call, which is already annotated in // the assets pallet - // Additionally, we need to add a DB write for removing the precompile revert code in the - // EVM // This is the dispatch info of destroy - let call_weight = RuntimeCall::Assets( + RuntimeCall::Assets( pallet_assets::Call::::start_destroy { id: asset.into(), }, ) .get_dispatch_info() - .weight; - - // This is the db write - call_weight.saturating_add(::DbWeight::get().writes(1)) + .weight } } @@ -322,9 +230,7 @@ impl AccountIdAssetIdConversion for Runtime { let h160_account: H160 = account.into(); let mut data = [0u8; 16]; let (prefix_part, id_part) = h160_account.as_fixed_bytes().split_at(4); - if prefix_part == FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX - || prefix_part == LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX - { + if prefix_part == FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX { data.copy_from_slice(id_part); let asset_id: AssetId = u128::from_be_bytes(data).into(); Some((prefix_part.to_vec(), asset_id)) diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index bfeadc0359..638a90ff98 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -47,7 +47,6 @@ pub use pallet_author_slot_filter::EligibilityValue; pub use pallet_parachain_staking::{weights::WeightInfo, InflationInfo, Range}; pub use precompiles::{ MoonbasePrecompiles, PrecompileName, FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, - LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, }; use account::AccountId20; @@ -1152,13 +1151,14 @@ impl pallet_migrations::Config for Runtime { type XcmExecutionManager = XcmExecutionManager; } +impl pallet_moonbeam_lazy_migrations::Config for Runtime {} + /// Maintenance mode Call filter pub struct MaintenanceFilter; impl Contains for MaintenanceFilter { fn contains(c: &RuntimeCall) -> bool { match c { RuntimeCall::Assets(_) => false, - RuntimeCall::LocalAssets(_) => false, RuntimeCall::Balances(_) => false, RuntimeCall::CrowdloanRewards(_) => false, RuntimeCall::Ethereum(_) => false, @@ -1197,16 +1197,6 @@ impl Contains for NormalFilter { pallet_assets::Call::finish_destroy { .. } => true, _ => false, }, - // We want to disable create, as we dont want users to be choosing the - // assetId of their choice - // We also disable destroy, as we want to route destroy through the - // asset-manager, which guarantees the removal both at the EVM and - // substrate side of things - RuntimeCall::LocalAssets(method) => match method { - pallet_assets::Call::create { .. } => false, - pallet_assets::Call::start_destroy { .. } => false, - _ => true, - }, // We filter anonymous proxy as they make "reserve" inconsistent // See: https://github.com/paritytech/substrate/blob/37cca710eed3dadd4ed5364c7686608f5175cce1/frame/proxy/src/lib.rs#L270 // editorconfig-checker-disable-line RuntimeCall::Proxy(method) => match method { @@ -1482,7 +1472,7 @@ construct_runtime! { Migrations: pallet_migrations::{Pallet, Storage, Config, Event} = 32, XcmTransactor: pallet_xcm_transactor::{Pallet, Call, Config, Storage, Event} = 33, ProxyGenesisCompanion: pallet_proxy_genesis_companion::{Pallet, Config} = 34, - LocalAssets: pallet_assets::::{Pallet, Call, Storage, Event} = 36, + // Previously 36: pallet_assets:: MoonbeamOrbiters: pallet_moonbeam_orbiters::{Pallet, Call, Storage, Event} = 37, EthereumXcm: pallet_ethereum_xcm::{Pallet, Call, Storage, Origin} = 38, Randomness: pallet_randomness::{Pallet, Call, Storage, Event, Inherent} = 39, @@ -1499,6 +1489,7 @@ construct_runtime! { Erc20XcmBridge: pallet_erc20_xcm_bridge::{Pallet} = 48, Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 49, AsyncBacking: pallet_async_backing::{Pallet, Storage} = 50, + MoonbeamLazyMigrations: pallet_moonbeam_lazy_migrations::{Pallet, Call, Storage} = 51 } } @@ -1736,6 +1727,10 @@ mod tests { assert!(std::mem::size_of::>() <= CALL_ALIGN as usize); assert!(std::mem::size_of::>() <= CALL_ALIGN as usize); assert!(std::mem::size_of::>() <= CALL_ALIGN as usize); + assert!( + std::mem::size_of::>() + <= CALL_ALIGN as usize + ); assert!(std::mem::size_of::>() <= CALL_ALIGN as usize); assert!( std::mem::size_of::>() diff --git a/runtime/moonbase/src/precompiles.rs b/runtime/moonbase/src/precompiles.rs index 48ffdb8fdf..9e499c6553 100644 --- a/runtime/moonbase/src/precompiles.rs +++ b/runtime/moonbase/src/precompiles.rs @@ -15,10 +15,10 @@ // along with Moonbeam. If not, see . use crate::{ - asset_config::{ForeignAssetInstance, LocalAssetInstance}, - xcm_config::XcmExecutorConfig, - CouncilInstance, OpenTechCommitteeInstance, TechCommitteeInstance, TreasuryCouncilInstance, + asset_config::ForeignAssetInstance, xcm_config::XcmExecutorConfig, CouncilInstance, + OpenTechCommitteeInstance, TechCommitteeInstance, TreasuryCouncilInstance, }; +use crate::{AssetId, H160}; use frame_support::parameter_types; use pallet_evm_precompile_author_mapping::AuthorMappingPrecompile; use pallet_evm_precompile_balances_erc20::{Erc20BalancesPrecompile, Erc20Metadata}; @@ -47,8 +47,9 @@ use pallet_evm_precompile_xcm_transactor::{ }; use pallet_evm_precompile_xcm_utils::{AllExceptXcmExecute, XcmUtilsPrecompile}; use pallet_evm_precompile_xtokens::XtokensPrecompile; -use pallet_evm_precompileset_assets_erc20::{Erc20AssetsPrecompileSet, IsForeign, IsLocal}; +use pallet_evm_precompileset_assets_erc20::{AccountIdAssetIdConversion, Erc20AssetsPrecompileSet}; use precompile_utils::precompile_set::*; +use sp_std::prelude::*; /// ERC20 metadata for the native token. pub struct NativeErc20Metadata; @@ -244,6 +245,53 @@ type MoonbasePrecompilesAt = ( >, ); +pub struct DisabledLocalAssets(sp_std::marker::PhantomData); + +impl sp_core::Get> for DisabledLocalAssets +where + Runtime: frame_system::Config, + Runtime::AccountId: Into, + Runtime: AccountIdAssetIdConversion, +{ + fn get() -> Vec { + vec![ + // https://moonbase.subscan.io/extrinsic/5245322-6?event=5245322-22 + 182085191673801920759598290391359780050u128, + // https://moonbase.subscan.io/extrinsic/3244752-4?event=3244752-9 + 282223684955665977914983262584256755878u128, + // https://moonbase.subscan.io/extrinsic/3158280-4?event=3158280-9 + 235962050501460763853961856666389569138u128, + // https://moonbase.subscan.io/block/3045900?tab=event&&event=3045900-4 + 45350527686064227409532032051821627910u128, + // https://moonbase.subscan.io/extrinsic/3024306-4?event=3024306-9 + 199439015574556113723291251263369885338u128, + // https://moonbase.subscan.io/extrinsic/2921640-4?event=2921640-9 + 236426850287284823323011839750645103615u128, + // https://moonbase.subscan.io/extrinsic/2748867-4?event=2748867-9 + 14626673838203901761839010613793775004u128, + // https://moonbase.subscan.io/extrinsic/2709788-4?event=2709788-9 + 95328064580428769161981851380106820590u128, + // https://moonbase.subscan.io/extrinsic/2670844-4?event=2670844-9 + 339028723712074529056817184013808486301u128, + // https://moonbase.subscan.io/extrinsic/2555083-4?event=2555083-9 + 100481493116602214283160747599845770751u128, + // https://moonbase.subscan.io/extrinsic/2473880-3?event=2473880-8 + 319515966007349957795820176952936446433u128, + // https://moonbase.subscan.io/extrinsic/2346438-3?event=2346438-6 + 337110116006454532607322340792629567158u128, + // https://moonbase.subscan.io/extrinsic/2239102-3?event=2239102-6 + 255225902946708983196362678630947296516u128, + // https://moonbase.subscan.io/extrinsic/2142964-4?event=2142964-12 + 3356866138193769031598374869367363824u128, + // https://moonbase.subscan.io/extrinsic/1967538-6?event=1967538-28 + 144992676743556815849525085098140609495u128, + ] + .iter() + .map(|id| Runtime::asset_id_to_account(LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, *id).into()) + .collect() + } +} + /// The PrecompileSet installed in the Moonbase runtime. /// We include the nine Istanbul precompiles /// (https://github.com/ethereum/go-ethereum/blob/3c46f557/core/vm/contracts.go#L69) @@ -259,13 +307,9 @@ pub type MoonbasePrecompiles = PrecompileSetBuilder< // Prefixed precompile sets (XC20) PrecompileSetStartingWith< ForeignAssetPrefix, - Erc20AssetsPrecompileSet, - (CallableByContract, CallableByPrecompile), - >, - PrecompileSetStartingWith< - LocalAssetPrefix, - Erc20AssetsPrecompileSet, + Erc20AssetsPrecompileSet, (CallableByContract, CallableByPrecompile), >, + RemovedPrecompilesAt>, ), >; diff --git a/runtime/moonbase/src/xcm_config.rs b/runtime/moonbase/src/xcm_config.rs index dea67d2baa..01c8cf7dbd 100644 --- a/runtime/moonbase/src/xcm_config.rs +++ b/runtime/moonbase/src/xcm_config.rs @@ -19,8 +19,8 @@ use super::{ governance, AccountId, AssetId, AssetManager, Assets, Balance, Balances, DealWithFees, - Erc20XcmBridge, LocalAssets, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, - RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, + Erc20XcmBridge, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, + RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, }; use moonbeam_runtime_common::weights as moonbeam_weights; use pallet_evm_precompileset_assets_erc20::AccountIdAssetIdConversion; @@ -39,12 +39,11 @@ use sp_core::{ConstU32, H160, H256}; use sp_weights::Weight; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, - CurrencyAdapter as XcmCurrencyAdapter, DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, - FungiblesAdapter, HashedDescription, NoChecking, ParentIsPreset, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, - SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, - WithComputedOrigin, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, + DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, FungiblesAdapter, HashedDescription, + NoChecking, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, + TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin, }; use xcm::latest::prelude::*; @@ -88,16 +87,6 @@ parameter_types! { PalletInstance(::index() as u8) ) }; - - // This is the relative view of our local assets. - // Indentified by thix prefix + generalIndex(assetId) - // We use the RELATIVE multilocation - pub LocalAssetsPalletLocation: MultiLocation = MultiLocation { - parents:0, - interior: Junctions::X1( - PalletInstance(::index() as u8) - ) - }; } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used @@ -163,32 +152,6 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< (), >; -/// Means for transacting local assets that are not the native currency -/// This transactor uses the new reanchor logic -pub type LocalFungiblesTransactor = FungiblesAdapter< - // Use this fungibles implementation: - LocalAssets, - // Use this currency when it is a fungible asset matching the given location or name: - ( - ConvertedConcreteId< - AssetId, - Balance, - // This just tells to convert an assetId into a GeneralIndex junction prepended - // by LocalAssetsPalletLocation - AsPrefixedGeneralIndex, - JustTry, - >, - ), - // Convert an XCM MultiLocation into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We dont want to allow teleporting assets - NoChecking, - // The account to use for tracking teleports. - (), ->; - // We use all transactors // These correspond to // SelfReserve asset, both pre and post 0.9.16 @@ -199,7 +162,6 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< pub type AssetTransactors = ( LocalAssetTransactor, ForeignFungiblesTransactor, - LocalFungiblesTransactor, Erc20XcmBridge, ); @@ -468,7 +430,7 @@ pub enum CurrencyId { // Assets representing other chains native tokens ForeignAsset(AssetId), // Our local assets - LocalAssetReserve(AssetId), + DeprecatedLocalAssetReserve(AssetId), // Erc20 token Erc20 { contract_address: H160 }, } @@ -480,15 +442,8 @@ impl AccountIdToCurrencyId for Runtime { a if a == H160::from_low_u64_be(2050).into() => CurrencyId::SelfReserve, // the rest of the currencies, by their corresponding erc20 address _ => match Runtime::account_to_asset_id(account) { - // We distinguish by prefix, and depending on it we create either - // Foreign or Local - Some((prefix, asset_id)) => { - if prefix == FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX.to_vec() { - CurrencyId::ForeignAsset(asset_id) - } else { - CurrencyId::LocalAssetReserve(asset_id) - } - } + // A foreign asset + Some((_prefix, asset_id)) => CurrencyId::ForeignAsset(asset_id), // If no known prefix is identified, we consider that it's a "real" erc20 token // (i.e. managed by a real smart contract) None => CurrencyId::Erc20 { @@ -513,11 +468,7 @@ where Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), - CurrencyId::LocalAssetReserve(asset) => { - let mut location = LocalAssetsPalletLocation::get(); - location.push_interior(Junction::GeneralIndex(asset)).ok(); - Some(location) - } + CurrencyId::DeprecatedLocalAssetReserve(_) => None, CurrencyId::Erc20 { contract_address } => { let mut location = Erc20XcmBridgePalletLocation::get(); location diff --git a/runtime/moonbase/tests/common/mod.rs b/runtime/moonbase/tests/common/mod.rs index 2b615ae40d..815372b2d6 100644 --- a/runtime/moonbase/tests/common/mod.rs +++ b/runtime/moonbase/tests/common/mod.rs @@ -26,7 +26,7 @@ use moonbase_runtime::{asset_config::AssetRegistrarMetadata, xcm_config::AssetTy pub use moonbase_runtime::{ currency::{GIGAWEI, SUPPLY_FACTOR, UNIT, WEI}, AccountId, AssetId, AssetManager, Assets, AsyncBacking, AuthorInherent, Balance, Balances, - CrowdloanRewards, Ethereum, Executive, Header, InflationInfo, LocalAssets, ParachainStaking, + CrowdloanRewards, Ethereum, Executive, Header, InflationInfo, ParachainStaking, ParachainSystem, Range, Runtime, RuntimeCall, RuntimeEvent, System, TransactionConverter, TransactionPaymentAsGasPrice, UncheckedExtrinsic, HOURS, WEEKS, }; @@ -287,18 +287,9 @@ impl ExtBuilder { let mut ext = sp_io::TestExternalities::new(t); - let local_assets = self.local_assets.clone(); let xcm_assets = self.xcm_assets.clone(); ext.execute_with(|| { - // If any local assets specified, we create them here - for (asset_id, balances, owner) in local_assets.clone() { - LocalAssets::force_create(root_origin(), asset_id.into(), owner, true, 1).unwrap(); - for (account, balance) in balances { - LocalAssets::mint(origin_of(owner.into()), asset_id.into(), account, balance) - .unwrap(); - } - } // If any xcm assets specified, we register them here for xcm_asset_initialization in xcm_assets { let asset_id: AssetId = xcm_asset_initialization.asset_type.clone().into(); diff --git a/runtime/moonbase/tests/integration_test.rs b/runtime/moonbase/tests/integration_test.rs index e836b7a6c1..5ec56d6e62 100644 --- a/runtime/moonbase/tests/integration_test.rs +++ b/runtime/moonbase/tests/integration_test.rs @@ -37,8 +37,7 @@ use frame_support::{ StorageHasher, Twox128, }; use moonbase_runtime::{ - asset_config::AssetRegistrarMetadata, - asset_config::LocalAssetInstance, + asset_config::{AssetRegistrarMetadata, ForeignAssetInstance}, get, xcm_config::{AssetType, SelfReserve}, AccountId, AssetId, AssetManager, Assets, Balances, CouncilCollective, CrowdloanRewards, @@ -61,7 +60,7 @@ use moonbeam_xcm_benchmarks::weights::XcmWeight; use nimbus_primitives::NimbusId; use pallet_evm::PrecompileSet; use pallet_evm_precompileset_assets_erc20::{ - AccountIdAssetIdConversion, IsLocal, SELECTOR_LOG_APPROVAL, SELECTOR_LOG_TRANSFER, + AccountIdAssetIdConversion, SELECTOR_LOG_APPROVAL, SELECTOR_LOG_TRANSFER, }; use pallet_transaction_payment::Multiplier; use pallet_xcm_transactor::{Currency, CurrencyPayment, HrmpOperation, TransactWeights}; @@ -81,10 +80,9 @@ type XcmUtilsPCall = pallet_evm_precompile_xcm_utils::XcmUtilsPrecompileCall< moonbase_runtime::xcm_config::XcmExecutorConfig, >; type XtokensPCall = pallet_evm_precompile_xtokens::XtokensPrecompileCall; -type LocalAssetsPCall = pallet_evm_precompileset_assets_erc20::Erc20AssetsPrecompileSetCall< +type ForeignAssetsPCall = pallet_evm_precompileset_assets_erc20::Erc20AssetsPrecompileSetCall< Runtime, - IsLocal, - LocalAssetInstance, + ForeignAssetInstance, >; type XcmTransactorV1PCall = pallet_evm_precompile_xcm_transactor::v1::XcmTransactorPrecompileV1Call; @@ -157,11 +155,11 @@ fn verify_pallet_prefixes() { is_pallet_prefix::("Migrations"); is_pallet_prefix::("XcmTransactor"); is_pallet_prefix::("ProxyGenesisCompanion"); - is_pallet_prefix::("LocalAssets"); is_pallet_prefix::("MoonbeamOrbiters"); is_pallet_prefix::("EthereumXcm"); is_pallet_prefix::("Randomness"); is_pallet_prefix::("TreasuryCouncilCollective"); + is_pallet_prefix::("MoonbeamLazyMigrations"); let prefix = |pallet_name, storage_name| { let mut res = [0u8; 32]; @@ -488,12 +486,12 @@ fn verify_pallet_indices() { is_pallet_index::(32); is_pallet_index::(33); is_pallet_index::(34); - is_pallet_index::(36); is_pallet_index::(37); is_pallet_index::(38); is_pallet_index::(39); is_pallet_index::(40); is_pallet_index::(46); + is_pallet_index::(51); } #[test] @@ -505,7 +503,8 @@ fn verify_reserved_indices() { _ => panic!("metadata has been bumped, test needs to be updated"), }; // 35: BaseFee - let reserved = vec![35]; + // 36: pallet_assets:: + let reserved = vec![35, 36]; let existing = metadata .pallets .iter() @@ -1312,31 +1311,6 @@ fn asset_can_be_registered() { }); } -#[test] -fn local_assets_cannot_be_create_by_signed_origins() { - ExtBuilder::default() - .with_balances(vec![ - (AccountId::from(ALICE), 2_000 * UNIT * SUPPLY_FACTOR), - (AccountId::from(BOB), 1_000 * UNIT * SUPPLY_FACTOR), - ]) - .build() - .execute_with(|| { - assert_noop!( - RuntimeCall::LocalAssets( - pallet_assets::Call::::create { - id: 11u128.into(), - admin: AccountId::from(ALICE), - min_balance: 1u128 - } - ) - .dispatch(::RuntimeOrigin::signed( - AccountId::from(ALICE) - )), - frame_system::Error::::CallFiltered - ); - }); -} - #[test] fn xcm_asset_erc20_precompiles_supply_and_balance() { ExtBuilder::default() @@ -1374,7 +1348,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::total_supply {}, + ForeignAssetsPCall::total_supply {}, ) .expect_cost(2000) .expect_no_logs() @@ -1385,7 +1359,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::balance_of { + ForeignAssetsPCall::balance_of { who: Address(ALICE.into()), }, ) @@ -1429,7 +1403,7 @@ fn xcm_asset_erc20_precompiles_transfer() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::transfer { + ForeignAssetsPCall::transfer { to: Address(BOB.into()), value: { 400 * UNIT }.into(), }, @@ -1449,7 +1423,7 @@ fn xcm_asset_erc20_precompiles_transfer() { .prepare_test( BOB, asset_precompile_address, - LocalAssetsPCall::balance_of { + ForeignAssetsPCall::balance_of { who: Address(BOB.into()), }, ) @@ -1493,7 +1467,7 @@ fn xcm_asset_erc20_precompiles_approve() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::approve { + ForeignAssetsPCall::approve { spender: Address(BOB.into()), value: { 400 * UNIT }.into(), }, @@ -1513,7 +1487,7 @@ fn xcm_asset_erc20_precompiles_approve() { .prepare_test( BOB, asset_precompile_address, - LocalAssetsPCall::transfer_from { + ForeignAssetsPCall::transfer_from { from: Address(ALICE.into()), to: Address(CHARLIE.into()), value: { 400 * UNIT }.into(), @@ -1534,7 +1508,7 @@ fn xcm_asset_erc20_precompiles_approve() { .prepare_test( CHARLIE, asset_precompile_address, - LocalAssetsPCall::balance_of { + ForeignAssetsPCall::balance_of { who: Address(CHARLIE.into()), }, ) diff --git a/runtime/moonbase/tests/xcm_mock/mod.rs b/runtime/moonbase/tests/xcm_mock/mod.rs index 56d396e9d5..f556bc4710 100644 --- a/runtime/moonbase/tests/xcm_mock/mod.rs +++ b/runtime/moonbase/tests/xcm_mock/mod.rs @@ -263,9 +263,7 @@ pub type StatemintAssets = pallet_assets::Pallet; pub type ParachainPalletXcm = pallet_xcm::Pallet; pub type Assets = pallet_assets::Pallet; -pub type LocalAssets = pallet_assets::Pallet; -pub type Balances = pallet_balances::Pallet; pub type Treasury = pallet_treasury::Pallet; pub type AssetManager = pallet_asset_manager::Pallet; pub type XTokens = orml_xtokens::Pallet; diff --git a/runtime/moonbase/tests/xcm_mock/parachain.rs b/runtime/moonbase/tests/xcm_mock/parachain.rs index c4d8109c30..f442a3618f 100644 --- a/runtime/moonbase/tests/xcm_mock/parachain.rs +++ b/runtime/moonbase/tests/xcm_mock/parachain.rs @@ -50,11 +50,11 @@ use xcm::latest::{ }; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, - CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, - FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, WithComputedOrigin, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, + EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, FungiblesAdapter, IsConcrete, + NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, + TakeWeightCredit, WithComputedOrigin, }; use xcm_executor::{traits::JustTry, Config, XcmExecutor}; @@ -276,36 +276,9 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< (), >; -/// Means for transacting local assets besides the native currency on this chain. -pub type LocalFungiblesTransactor = FungiblesAdapter< - // Use this fungibles implementation: - LocalAssets, - // Use this currency when it is a fungible asset matching the given location or name: - ( - ConvertedConcreteId< - AssetId, - Balance, - AsPrefixedGeneralIndex, - JustTry, - >, - ), - // Convert an XCM MultiLocation into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We dont want to allow teleporting assets - NoChecking, - // The account to use for tracking teleports. - (), ->; - // These will be our transactors // We use both transactors -pub type AssetTransactors = ( - LocalAssetTransactor, - ForeignFungiblesTransactor, - LocalFungiblesTransactor, -); +pub type AssetTransactors = (LocalAssetTransactor, ForeignFungiblesTransactor); pub type XcmRouter = super::ParachainXcmRouter; @@ -372,13 +345,6 @@ parameter_types! { PalletInstance(::index() as u8) ) }; - - pub LocalAssetsPalletLocation: MultiLocation = MultiLocation { - parents:0, - interior: Junctions::X1( - PalletInstance(::index() as u8) - ) - }; pub const MaxAssetsIntoHolding: u32 = 64; } @@ -436,7 +402,6 @@ impl cumulus_pallet_xcm::Config for Runtime { pub enum CurrencyId { SelfReserve, ForeignAsset(AssetId), - LocalAssetReserve(AssetId), } // How to convert from CurrencyId to MultiLocation @@ -458,11 +423,6 @@ where Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), - CurrencyId::LocalAssetReserve(asset) => { - let mut location = LocalAssetsPalletLocation::get(); - location.push_interior(Junction::GeneralIndex(asset)).ok(); - Some(location) - } } } } @@ -845,32 +805,6 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { ) } - fn create_local_asset( - asset: AssetId, - _creator: AccountId, - min_balance: Balance, - is_sufficient: bool, - owner: AccountId, - ) -> DispatchResult { - LocalAssets::force_create( - RuntimeOrigin::root(), - asset, - owner, - is_sufficient, - min_balance, - )?; - - // TODO uncomment when we feel comfortable - /* - // The asset has been created. Let's put the revert code in the precompile address - let precompile_address = Runtime::asset_id_to_account(ASSET_PRECOMPILE_ADDRESS_PREFIX, asset); - pallet_evm::AccountCodes::::insert( - precompile_address, - vec![0x60, 0x00, 0x60, 0x00, 0xfd], - );*/ - Ok(()) - } - fn destroy_foreign_asset(asset: AssetId) -> DispatchResult { // Mark the asset as destroying Assets::start_destroy(RuntimeOrigin::root(), asset.into())?; @@ -878,13 +812,6 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { Ok(()) } - fn destroy_local_asset(asset: AssetId) -> DispatchResult { - // Mark the asset as destroying - LocalAssets::start_destroy(RuntimeOrigin::root(), asset.into())?; - - Ok(()) - } - fn destroy_asset_dispatch_info_weight(asset: AssetId) -> Weight { RuntimeCall::Assets( pallet_assets::Call::::start_destroy { diff --git a/runtime/moonbase/tests/xcm_tests.rs b/runtime/moonbase/tests/xcm_tests.rs index e8ce182165..ca0b9fa5a1 100644 --- a/runtime/moonbase/tests/xcm_tests.rs +++ b/runtime/moonbase/tests/xcm_tests.rs @@ -24,7 +24,6 @@ use frame_support::{ weights::Weight, BoundedVec, }; -use pallet_asset_manager::LocalAssetIdCreator; use pallet_xcm_transactor::{ Currency, CurrencyPayment, HrmpInitParams, HrmpOperation, TransactWeights, }; @@ -37,7 +36,6 @@ use xcm_mock::*; use xcm_primitives::{UtilityEncodeCall, DEFAULT_PROOF_SIZE}; use xcm_simulator::TestExt; mod common; -use common::ExtBuilder; use cumulus_primitives_core::relay_chain::HrmpChannelId; // Send a relay asset (like DOT) to a parachain A #[test] @@ -2565,246 +2563,6 @@ fn test_statemint_like() { }); } -#[test] -fn send_para_a_local_asset_to_para_b() { - ExtBuilder::default().build().execute_with(|| { - MockNet::reset(); - - let asset_id = parachain::LocalAssetIdCreator::create_asset_id_from_metadata(0); - let para_a_local_asset = MultiLocation::new( - 1, - X3(Parachain(1), PalletInstance(11u8), GeneralIndex(asset_id)), - ); - let source_location = parachain::AssetType::Xcm(para_a_local_asset); - let source_id: parachain::AssetId = source_location.clone().into(); - - let asset_metadata = parachain::AssetMetadata { - name: b"ParaALocalAsset".to_vec(), - symbol: b"ParaALocalAsset".to_vec(), - decimals: 12, - }; - - ParaA::execute_with(|| { - assert_ok!(AssetManager::register_local_asset( - parachain::RuntimeOrigin::root(), - PARAALICE.into(), - PARAALICE.into(), - true, - 1 - )); - - assert_ok!(LocalAssets::mint( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - asset_id, - PARAALICE.into(), - 300000000000000 - )); - }); - - ParaB::execute_with(|| { - assert_ok!(AssetManager::register_foreign_asset( - parachain::RuntimeOrigin::root(), - source_location.clone(), - asset_metadata, - 1u128, - true - )); - assert_ok!(AssetManager::set_asset_units_per_second( - parachain::RuntimeOrigin::root(), - source_location, - 0u128, - 0 - )); - }); - - let dest = MultiLocation { - parents: 1, - interior: X2( - Parachain(2), - AccountKey20 { - network: None, - key: PARAALICE.into(), - }, - ), - }; - - ParaA::execute_with(|| { - // free execution, full amount received - assert_ok!(XTokens::transfer( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - parachain::CurrencyId::LocalAssetReserve(asset_id), - 100, - Box::new(VersionedMultiLocation::V3(dest)), - WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) - )); - }); - - ParaB::execute_with(|| { - // free execution, full amount received - assert_eq!(Assets::balance(source_id, &PARAALICE.into()), 100); - }); - }); -} - -#[test] -fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_dev() { - ExtBuilder::default().build().execute_with(|| { - MockNet::reset(); - - let asset_id = parachain::LocalAssetIdCreator::create_asset_id_from_metadata(0); - let para_a_local_asset = MultiLocation::new( - 1, - X3(Parachain(1), PalletInstance(11u8), GeneralIndex(asset_id)), - ); - let source_location_local_asset = parachain::AssetType::Xcm(para_a_local_asset); - let source_id_local_asset: parachain::AssetId = source_location_local_asset.clone().into(); - - let asset_metadata_local_asset = parachain::AssetMetadata { - name: b"ParaALocalAsset".to_vec(), - symbol: b"ParaALocalAsset".to_vec(), - decimals: 12, - }; - - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location_balances = parachain::AssetType::Xcm(para_a_balances); - let source_id_balances: parachain::AssetId = source_location_balances.clone().into(); - - let asset_metadata_balances = parachain::AssetMetadata { - name: b"ParaAToken".to_vec(), - symbol: b"ParaA".to_vec(), - decimals: 18, - }; - - ParaB::execute_with(|| { - assert_ok!(AssetManager::register_foreign_asset( - parachain::RuntimeOrigin::root(), - source_location_local_asset.clone(), - asset_metadata_local_asset, - 1u128, - true - )); - assert_ok!(AssetManager::set_asset_units_per_second( - parachain::RuntimeOrigin::root(), - source_location_local_asset, - 0u128, - 0 - )); - - assert_ok!(AssetManager::register_foreign_asset( - parachain::RuntimeOrigin::root(), - source_location_balances.clone(), - asset_metadata_balances, - 1u128, - true - )); - assert_ok!(AssetManager::set_asset_units_per_second( - parachain::RuntimeOrigin::root(), - source_location_balances, - 0u128, - 1 - )); - }); - - ParaA::execute_with(|| { - assert_ok!(AssetManager::register_local_asset( - parachain::RuntimeOrigin::root(), - PARAALICE.into(), - PARAALICE.into(), - true, - 1 - )); - - assert_ok!(LocalAssets::mint( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - asset_id, - PARAALICE.into(), - 300000000000000 - )); - }); - - let dest = MultiLocation { - parents: 1, - interior: X2( - Parachain(2), - AccountKey20 { - network: None, - key: PARAALICE.into(), - }, - ), - }; - - ParaA::execute_with(|| { - // free execution, full amount received - assert_ok!(XTokens::transfer_multicurrencies( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - vec![ - (parachain::CurrencyId::LocalAssetReserve(asset_id), 100), - (parachain::CurrencyId::SelfReserve, 1000000) - ], - 0, - Box::new(VersionedMultiLocation::V3(dest)), - WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) - )); - }); - - let mut alith_balance_asset_before = 0; - let mut alith_balance_native_token_before = 0; - - ParaA::execute_with(|| { - alith_balance_asset_before = LocalAssets::balance(asset_id, &PARAALICE.into()); - alith_balance_native_token_before = Balances::free_balance(&PARAALICE.into()); - }); - - let new_dest = MultiLocation { - parents: 1, - interior: X2( - Parachain(1), - AccountKey20 { - network: None, - key: PARAALICE.into(), - }, - ), - }; - - ParaB::execute_with(|| { - // free execution, full amount received - assert_eq!( - Assets::balance(source_id_local_asset, &PARAALICE.into()), - 100 - ); - assert_eq!( - Assets::balance(source_id_balances, &PARAALICE.into()), - 1000000 - ); - - // free execution, full amount received - assert_ok!(XTokens::transfer_multicurrencies( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - vec![ - (parachain::CurrencyId::ForeignAsset(source_id_balances), 4), - ( - parachain::CurrencyId::ForeignAsset(source_id_local_asset), - 50 - ) - ], - 0, - Box::new(VersionedMultiLocation::V3(new_dest)), - WeightLimit::Limited(Weight::from_parts(4u64, DEFAULT_PROOF_SIZE)) - )); - }); - - ParaA::execute_with(|| { - let alith_balance_asset_after = LocalAssets::balance(asset_id, &PARAALICE.into()); - let alith_balance_native_token_after = Balances::free_balance(&PARAALICE.into()); - assert_eq!(alith_balance_asset_after, alith_balance_asset_before + 50); - assert_eq!( - alith_balance_native_token_before, - alith_balance_native_token_after - ); - }); - }); -} - #[test] fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { MockNet::reset(); diff --git a/runtime/moonbeam/Cargo.toml b/runtime/moonbeam/Cargo.toml index 9486797156..e39c4e4d3c 100644 --- a/runtime/moonbeam/Cargo.toml +++ b/runtime/moonbeam/Cargo.toml @@ -13,7 +13,7 @@ hex-literal = { workspace = true, optional = true } log = { workspace = true } num_enum = { workspace = true } rlp = { workspace = true, optional = true } -serde = { workspace = true, features = [ "derive" ] } +serde = { workspace = true, features = ["derive"] } sha3 = { workspace = true, optional = true } smallvec = { workspace = true } strum = { workspace = true } @@ -36,8 +36,9 @@ pallet-crowdloan-rewards = { workspace = true } pallet-erc20-xcm-bridge = { workspace = true } pallet-evm-chain-id = { workspace = true } pallet-ethereum-xcm = { workspace = true } -pallet-maintenance-mode = { workspace = true, features = [ "xcm-support" ] } +pallet-maintenance-mode = { workspace = true, features = ["xcm-support"] } pallet-migrations = { workspace = true } +pallet-moonbeam-lazy-migrations = { workspace = true } pallet-moonbeam-orbiters = { workspace = true } pallet-parachain-staking = { workspace = true } pallet-proxy-genesis-companion = { workspace = true } @@ -79,7 +80,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } frame-system-rpc-runtime-api = { workspace = true } pallet-assets = { workspace = true } -pallet-balances = { workspace = true, features = [ "insecure_zero_ed" ] } +pallet-balances = { workspace = true, features = ["insecure_zero_ed"] } pallet-collective = { workspace = true } pallet-conviction-voting = { workspace = true } pallet-democracy = { workspace = true } @@ -102,13 +103,13 @@ parity-scale-codec = { workspace = true, features = [ "max-encoded-len", "chain-error", ] } -scale-info = { workspace = true, features = [ "derive" ] } +scale-info = { workspace = true, features = ["derive"] } sp-api = { workspace = true } sp-block-builder = { workspace = true } sp-consensus-slots = { workspace = true } sp-core = { workspace = true } sp-inherents = { workspace = true } -sp-io = { workspace = true, features = [ "improved_panic_error_reporting" ] } +sp-io = { workspace = true, features = ["improved_panic_error_reporting"] } sp-offchain = { workspace = true } sp-runtime = { workspace = true } sp-session = { workspace = true } @@ -120,9 +121,9 @@ sp-weights = { workspace = true } # Frontier fp-evm = { workspace = true } fp-rpc = { workspace = true } -fp-self-contained = { workspace = true, features = [ "serde" ] } -pallet-ethereum = { workspace = true, features = [ "forbid-evm-reentrancy" ] } -pallet-evm = { workspace = true, features = [ "forbid-evm-reentrancy" ] } +fp-self-contained = { workspace = true, features = ["serde"] } +pallet-ethereum = { workspace = true, features = ["forbid-evm-reentrancy"] } +pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] } pallet-evm-precompile-blake2 = { workspace = true } pallet-evm-precompile-bn128 = { workspace = true } pallet-evm-precompile-dispatch = { workspace = true } @@ -168,8 +169,8 @@ frame-try-runtime = { workspace = true, optional = true } [dev-dependencies] ethereum = { workspace = true } frame-metadata = { workspace = true } -hex = { workspace = true, features = [ "std" ] } -sha3 = { workspace = true, features = [ "std" ] } +hex = { workspace = true, features = ["std"] } +sha3 = { workspace = true, features = ["std"] } cumulus-primitives-parachain-inherent = { workspace = true } cumulus-test-relay-sproof-builder = { workspace = true } @@ -178,13 +179,13 @@ pallet-message-queue = { workspace = true } polkadot-runtime-parachains = { workspace = true } xcm-simulator = { workspace = true } -precompile-utils = { workspace = true, features = [ "std", "testing" ] } +precompile-utils = { workspace = true, features = ["std", "testing"] } [build-dependencies] substrate-wasm-builder = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "account/std", "async-backing-primitives/std", @@ -246,6 +247,7 @@ std = [ "pallet-identity/std", "pallet-maintenance-mode/std", "pallet-migrations/std", + "pallet-moonbeam-lazy-migrations/std", "pallet-moonbeam-orbiters/std", "pallet-multisig/std", "pallet-parachain-staking/std", @@ -288,7 +290,7 @@ std = [ "xcm-primitives/std", "xcm/std", ] -evm-tracing = [ "evm-tracing-events", "moonbeam-evm-tracer", "rlp", "sha3" ] +evm-tracing = ["evm-tracing-events", "moonbeam-evm-tracer", "rlp", "sha3"] # Will be enabled by the `wasm-builder` when building the runtime for WASM. runtime-wasm = [] @@ -296,7 +298,7 @@ runtime-wasm = [] # A feature that should be enabled when the runtime should be build for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", @@ -323,6 +325,7 @@ runtime-benchmarks = [ "pallet-evm/runtime-benchmarks", "pallet-identity/runtime-benchmarks", "pallet-migrations/runtime-benchmarks", + "pallet-moonbeam-lazy-migrations/runtime-benchmarks", "pallet-moonbeam-orbiters/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-parachain-staking/runtime-benchmarks", @@ -359,6 +362,7 @@ try-runtime = [ "pallet-democracy/try-runtime", "pallet-maintenance-mode/try-runtime", "pallet-migrations/try-runtime", + "pallet-moonbeam-lazy-migrations/try-runtime", "pallet-parachain-staking/try-runtime", "pallet-preimage/try-runtime", "pallet-referenda/try-runtime", diff --git a/runtime/moonbeam/src/asset_config.rs b/runtime/moonbeam/src/asset_config.rs index 00c1fde48a..e34db8b6f5 100644 --- a/runtime/moonbeam/src/asset_config.rs +++ b/runtime/moonbeam/src/asset_config.rs @@ -19,8 +19,8 @@ use super::{ currency, governance, xcm_config, AccountId, AssetId, AssetManager, Assets, Balance, Balances, - CouncilInstance, LocalAssets, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, - FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, + CouncilInstance, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, + FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, }; use frame_support::{ @@ -54,7 +54,6 @@ const REMOVE_ITEMS_LIMIT: u32 = 656; // Not to disrupt the previous asset instance, we assign () to Foreign pub type ForeignAssetInstance = (); -pub type LocalAssetInstance = pallet_assets::Instance1; // For foreign assets, these parameters dont matter much // as this will only be called by root with the forced arguments @@ -116,31 +115,6 @@ impl pallet_assets::Config for Runtime { } } -// Local assets -impl pallet_assets::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Balance = Balance; - type AssetId = AssetId; - type Currency = Balances; - type ForceOrigin = EnsureNever; - type AssetDeposit = AssetDeposit; - type MetadataDepositBase = MetadataDepositBase; - type MetadataDepositPerByte = MetadataDepositPerByte; - type ApprovalDeposit = ApprovalDeposit; - type StringLimit = AssetsStringLimit; - type Freezer = (); - type Extra = (); - type AssetAccountDeposit = ConstU128<{ currency::deposit(1, 18) }>; - type WeightInfo = moonbeam_weights::pallet_assets::WeightInfo; - type RemoveItemsLimit = ConstU32<{ REMOVE_ITEMS_LIMIT }>; - type AssetIdParameter = Compact; - type CreateOrigin = AsEnsureOriginWithArg>; - type CallbackHandle = (); - pallet_assets::runtime_benchmarks_enabled! { - type BenchmarkHelper = BenchmarkHelper; - } -} - // We instruct how to register the Assets // In this case, we tell it to Create an Asset in pallet-assets pub struct AssetRegistrar; @@ -162,15 +136,6 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { min_balance, )?; - // TODO uncomment when we feel comfortable - /* - // The asset has been created. Let's put the revert code in the precompile address - let precompile_address = Runtime::asset_id_to_account(ASSET_PRECOMPILE_ADDRESS_PREFIX, asset); - pallet_evm::AccountCodes::::insert( - precompile_address, - vec![0x60, 0x00, 0x60, 0x00, 0xfd], - );*/ - // Lastly, the metadata Assets::force_set_metadata( RuntimeOrigin::root(), @@ -182,61 +147,10 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { ) } - #[transactional] - fn create_local_asset( - asset: AssetId, - _creator: AccountId, - min_balance: Balance, - is_sufficient: bool, - owner: AccountId, - ) -> DispatchResult { - // We create with root, because we need to decide whether we want to create the asset - // as sufficient. Take into account this does not hold any reserved amount - // in pallet-assets - LocalAssets::force_create( - RuntimeOrigin::root(), - asset.into(), - owner, - is_sufficient, - min_balance, - )?; - - // No metadata needs to be set, as this can be set through regular calls - - // The asset has been created. Let's put the revert code in the precompile address - let precompile_address: H160 = - Runtime::asset_id_to_account(LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, asset).into(); - pallet_evm::AccountCodes::::insert( - precompile_address, - vec![0x60, 0x00, 0x60, 0x00, 0xfd], - ); - Ok(()) - } - #[transactional] fn destroy_foreign_asset(asset: AssetId) -> DispatchResult { // Mark the asset as destroying - Assets::start_destroy(RuntimeOrigin::root(), asset.into())?; - - // We remove the EVM revert code - // This does not panick even if there is no code in the address - let precompile_address: H160 = - Runtime::asset_id_to_account(FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, asset).into(); - pallet_evm::AccountCodes::::remove(precompile_address); - Ok(()) - } - - #[transactional] - fn destroy_local_asset(asset: AssetId) -> DispatchResult { - // Mark the asset as destroying - LocalAssets::start_destroy(RuntimeOrigin::root(), asset.into())?; - - // We remove the EVM revert code - // This does not panick even if there is no code in the address - let precompile_address: H160 = - Runtime::asset_id_to_account(LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, asset).into(); - pallet_evm::AccountCodes::::remove(precompile_address); - Ok(()) + Assets::start_destroy(RuntimeOrigin::root(), asset.into()) } fn destroy_asset_dispatch_info_weight(asset: AssetId) -> Weight { @@ -244,20 +158,15 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { // witness // We need to take the dispatch info from the destroy call, which is already annotated in // the assets pallet - // Additionally, we need to add a DB write for removing the precompile revert code in the - // EVM // This is the dispatch info of destroy - let call_weight = RuntimeCall::Assets( + RuntimeCall::Assets( pallet_assets::Call::::start_destroy { id: asset.into(), }, ) .get_dispatch_info() - .weight; - - // This is the db write - call_weight.saturating_add(::DbWeight::get().writes(1)) + .weight } } @@ -321,9 +230,7 @@ impl AccountIdAssetIdConversion for Runtime { let h160_account: H160 = account.into(); let mut data = [0u8; 16]; let (prefix_part, id_part) = h160_account.as_fixed_bytes().split_at(4); - if prefix_part == FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX - || prefix_part == LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX - { + if prefix_part == FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX { data.copy_from_slice(id_part); let asset_id: AssetId = u128::from_be_bytes(data).into(); Some((prefix_part.to_vec(), asset_id)) diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 0d57d20fd3..da950c48ff 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -108,7 +108,6 @@ use nimbus_primitives::CanAuthor; mod precompiles; pub use precompiles::{ MoonbeamPrecompiles, PrecompileName, FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, - LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, }; #[cfg(any(feature = "std", test))] @@ -1131,13 +1130,14 @@ impl pallet_migrations::Config for Runtime { type XcmExecutionManager = XcmExecutionManager; } +impl pallet_moonbeam_lazy_migrations::Config for Runtime {} + /// Maintenance mode Call filter pub struct MaintenanceFilter; impl Contains for MaintenanceFilter { fn contains(c: &RuntimeCall) -> bool { match c { RuntimeCall::Assets(_) => false, - RuntimeCall::LocalAssets(_) => false, RuntimeCall::Balances(_) => false, RuntimeCall::CrowdloanRewards(_) => false, RuntimeCall::Ethereum(_) => false, @@ -1176,16 +1176,6 @@ impl Contains for NormalFilter { pallet_assets::Call::finish_destroy { .. } => true, _ => false, }, - // We want to disable create, as we dont want users to be choosing the - // assetId of their choice - // We also disable destroy, as we want to route destroy through the - // asset-manager, which guarantees the removal both at the EVM and - // substrate side of things - RuntimeCall::LocalAssets(method) => match method { - pallet_assets::Call::create { .. } => false, - pallet_assets::Call::start_destroy { .. } => false, - _ => true, - }, // We just want to enable this in case of live chains, since the default version // is populated at genesis RuntimeCall::PolkadotXcm(method) => match method { @@ -1498,9 +1488,10 @@ construct_runtime! { AssetManager: pallet_asset_manager::{Pallet, Call, Storage, Event} = 105, XTokens: orml_xtokens::{Pallet, Call, Storage, Event} = 106, XcmTransactor: pallet_xcm_transactor::{Pallet, Call, Storage, Event} = 107, - LocalAssets: pallet_assets::::{Pallet, Call, Storage, Event} = 108, + // Previously 108: pallet_assets:: EthereumXcm: pallet_ethereum_xcm::{Pallet, Call, Storage, Origin} = 109, Erc20XcmBridge: pallet_erc20_xcm_bridge::{Pallet} = 110, + MoonbeamLazyMigrations: pallet_moonbeam_lazy_migrations::{Pallet, Call, Storage} = 111, // Randomness @@ -1752,6 +1743,10 @@ mod tests { std::mem::size_of::>() <= CALL_ALIGN as usize ); assert!(std::mem::size_of::>() <= CALL_ALIGN as usize); + assert!( + std::mem::size_of::>() + <= CALL_ALIGN as usize + ); assert!( std::mem::size_of::>() <= CALL_ALIGN as usize diff --git a/runtime/moonbeam/src/precompiles.rs b/runtime/moonbeam/src/precompiles.rs index 901618c9a2..041a44caec 100644 --- a/runtime/moonbeam/src/precompiles.rs +++ b/runtime/moonbeam/src/precompiles.rs @@ -15,10 +15,10 @@ // along with Moonbeam. If not, see . use crate::{ - asset_config::{ForeignAssetInstance, LocalAssetInstance}, - xcm_config::XcmExecutorConfig, - CouncilInstance, OpenTechCommitteeInstance, TechCommitteeInstance, TreasuryCouncilInstance, + asset_config::ForeignAssetInstance, xcm_config::XcmExecutorConfig, CouncilInstance, + OpenTechCommitteeInstance, TechCommitteeInstance, TreasuryCouncilInstance, }; +use crate::{AssetId, H160}; use frame_support::parameter_types; use pallet_evm_precompile_author_mapping::AuthorMappingPrecompile; use pallet_evm_precompile_balances_erc20::{Erc20BalancesPrecompile, Erc20Metadata}; @@ -47,8 +47,9 @@ use pallet_evm_precompile_xcm_transactor::{ }; use pallet_evm_precompile_xcm_utils::XcmUtilsPrecompile; use pallet_evm_precompile_xtokens::XtokensPrecompile; -use pallet_evm_precompileset_assets_erc20::{Erc20AssetsPrecompileSet, IsForeign, IsLocal}; +use pallet_evm_precompileset_assets_erc20::{AccountIdAssetIdConversion, Erc20AssetsPrecompileSet}; use precompile_utils::precompile_set::*; +use sp_std::prelude::*; pub struct NativeErc20Metadata; @@ -246,6 +247,27 @@ type MoonbeamPrecompilesAt = ( >, ); +pub struct DisabledLocalAssets(sp_std::marker::PhantomData); + +impl sp_core::Get> for DisabledLocalAssets +where + Runtime: frame_system::Config, + Runtime::AccountId: Into, + Runtime: AccountIdAssetIdConversion, +{ + fn get() -> Vec { + vec![ + 337110116006454532607322340792629567158u128, + 278750993613512357835566279094880339619, + 228256396637196286254896220398224702687, + 270195117769614861929703564202131636628, + ] + .iter() + .map(|id| Runtime::asset_id_to_account(LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, *id).into()) + .collect() + } +} + /// The PrecompileSet installed in the Moonbeam runtime. /// We include the nine Istanbul precompiles /// (https://github.com/ethereum/go-ethereum/blob/3c46f557/core/vm/contracts.go#L69) @@ -262,13 +284,9 @@ pub type MoonbeamPrecompiles = PrecompileSetBuilder< // Prefixed precompile sets (XC20) PrecompileSetStartingWith< ForeignAssetPrefix, - Erc20AssetsPrecompileSet, - (CallableByContract, CallableByPrecompile), - >, - PrecompileSetStartingWith< - LocalAssetPrefix, - Erc20AssetsPrecompileSet, + Erc20AssetsPrecompileSet, (CallableByContract, CallableByPrecompile), >, + RemovedPrecompilesAt>, ), >; diff --git a/runtime/moonbeam/src/xcm_config.rs b/runtime/moonbeam/src/xcm_config.rs index 0509f8b87a..8985f52563 100644 --- a/runtime/moonbeam/src/xcm_config.rs +++ b/runtime/moonbeam/src/xcm_config.rs @@ -19,8 +19,8 @@ use super::{ governance, AccountId, AssetId, AssetManager, Assets, Balance, Balances, DealWithFees, - Erc20XcmBridge, LocalAssets, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, - RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, + Erc20XcmBridge, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, + RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, }; use frame_support::{ @@ -40,12 +40,11 @@ use sp_core::{ConstU32, H160, H256}; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, - CurrencyAdapter as XcmCurrencyAdapter, DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, - FungiblesAdapter, HashedDescription, NoChecking, ParentIsPreset, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, - SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, - WithComputedOrigin, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, + DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, FungiblesAdapter, HashedDescription, + NoChecking, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, + TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin, }; use xcm::latest::prelude::*; @@ -86,16 +85,6 @@ parameter_types! { PalletInstance(::index() as u8) ) }; - - // This is the relative view of our local assets. - // Indentified by thix prefix + generalIndex(assetId) - // We use the RELATIVE multilocation - pub LocalAssetsPalletLocation: MultiLocation = MultiLocation { - parents:0, - interior: Junctions::X1( - PalletInstance(::index() as u8) - ) - }; } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used @@ -160,36 +149,10 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< (), >; -/// Means for transacting local assets besides the native currency on this chain. -pub type LocalFungiblesTransactor = FungiblesAdapter< - // Use this fungibles implementation: - LocalAssets, - // Use this currency when it is a fungible asset matching the given location or name: - ( - ConvertedConcreteId< - AssetId, - Balance, - // This just tells to convert an assetId into a GeneralIndex junction prepended - // by LocalAssetsPalletLocationNewReanchor - AsPrefixedGeneralIndex, - JustTry, - >, - ), - // Convert an XCM MultiLocation into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We dont want to allow teleporting assets - NoChecking, - // The account to use for tracking teleports. - (), ->; - // We use all transactors pub type AssetTransactors = ( LocalAssetTransactor, ForeignFungiblesTransactor, - LocalFungiblesTransactor, Erc20XcmBridge, ); @@ -459,7 +422,7 @@ pub enum CurrencyId { // Assets representing other chains native tokens ForeignAsset(AssetId), // Our local assets - LocalAssetReserve(AssetId), + DeprecatedLocalAssetReserve(AssetId), // Erc20 token Erc20 { contract_address: H160 }, } @@ -473,13 +436,7 @@ impl AccountIdToCurrencyId for Runtime { _ => match Runtime::account_to_asset_id(account) { // We distinguish by prefix, and depending on it we create either // Foreign or Local - Some((prefix, asset_id)) => { - if prefix == FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX.to_vec() { - CurrencyId::ForeignAsset(asset_id) - } else { - CurrencyId::LocalAssetReserve(asset_id) - } - } + Some((_prefix, asset_id)) => CurrencyId::ForeignAsset(asset_id), // If no known prefix is identified, we consider that it's a "real" erc20 token // (i.e. managed by a real smart contract) None => CurrencyId::Erc20 { @@ -503,12 +460,7 @@ where Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), - // No transactor matches this yet, so even if we have this enum variant the transfer will fail - CurrencyId::LocalAssetReserve(asset) => { - let mut location = LocalAssetsPalletLocation::get(); - location.push_interior(Junction::GeneralIndex(asset)).ok(); - Some(location) - } + CurrencyId::DeprecatedLocalAssetReserve(_) => None, CurrencyId::Erc20 { contract_address } => { let mut location = Erc20XcmBridgePalletLocation::get(); location diff --git a/runtime/moonbeam/tests/common/mod.rs b/runtime/moonbeam/tests/common/mod.rs index c4d86cd848..353a68a64c 100644 --- a/runtime/moonbeam/tests/common/mod.rs +++ b/runtime/moonbeam/tests/common/mod.rs @@ -27,9 +27,9 @@ pub use moonbeam_runtime::{ currency::{GIGAWEI, GLMR, SUPPLY_FACTOR, WEI}, xcm_config::AssetType, AccountId, AssetId, AssetManager, Assets, AuthorInherent, Balance, Balances, CrowdloanRewards, - Ethereum, Executive, Header, InflationInfo, LocalAssets, ParachainStaking, Range, Runtime, - RuntimeCall, RuntimeEvent, System, TransactionConverter, TransactionPaymentAsGasPrice, - UncheckedExtrinsic, HOURS, WEEKS, + Ethereum, Executive, Header, InflationInfo, ParachainStaking, Range, Runtime, RuntimeCall, + RuntimeEvent, System, TransactionConverter, TransactionPaymentAsGasPrice, UncheckedExtrinsic, + HOURS, WEEKS, }; use nimbus_primitives::{NimbusId, NIMBUS_ENGINE_ID}; use sp_core::{Encode, H160}; @@ -287,17 +287,8 @@ impl ExtBuilder { genesis_config.assimilate_storage(&mut t).unwrap(); let mut ext = sp_io::TestExternalities::new(t); - let local_assets = self.local_assets.clone(); let xcm_assets = self.xcm_assets.clone(); ext.execute_with(|| { - // If any local assets specified, we create them here - for (asset_id, balances, owner) in local_assets.clone() { - LocalAssets::force_create(root_origin(), asset_id.into(), owner, true, 1).unwrap(); - for (account, balance) in balances { - LocalAssets::mint(origin_of(owner.into()), asset_id.into(), account, balance) - .unwrap(); - } - } // If any xcm assets specified, we register them here for xcm_asset_initialization in xcm_assets { let asset_id: AssetId = xcm_asset_initialization.asset_type.clone().into(); diff --git a/runtime/moonbeam/tests/integration_test.rs b/runtime/moonbeam/tests/integration_test.rs index 15a4226851..c74b621c21 100644 --- a/runtime/moonbeam/tests/integration_test.rs +++ b/runtime/moonbeam/tests/integration_test.rs @@ -33,7 +33,7 @@ use frame_support::{ StorageHasher, Twox128, }; use moonbeam_runtime::{ - asset_config::LocalAssetInstance, + asset_config::ForeignAssetInstance, currency::GLMR, xcm_config::{CurrencyId, SelfReserve}, AccountId, Balances, CouncilCollective, CrowdloanRewards, OpenTechCommitteeCollective, @@ -45,7 +45,7 @@ use moonbeam_xcm_benchmarks::weights::XcmWeight; use nimbus_primitives::NimbusId; use pallet_evm::PrecompileSet; use pallet_evm_precompileset_assets_erc20::{ - AccountIdAssetIdConversion, IsLocal, SELECTOR_LOG_APPROVAL, SELECTOR_LOG_TRANSFER, + AccountIdAssetIdConversion, SELECTOR_LOG_APPROVAL, SELECTOR_LOG_TRANSFER, }; use pallet_transaction_payment::Multiplier; use pallet_xcm_transactor::{Currency, CurrencyPayment, TransactWeights}; @@ -76,10 +76,9 @@ type XcmUtilsPCall = pallet_evm_precompile_xcm_utils::XcmUtilsPrecompileCall< moonbeam_runtime::xcm_config::XcmExecutorConfig, >; type XtokensPCall = pallet_evm_precompile_xtokens::XtokensPrecompileCall; -type LocalAssetsPCall = pallet_evm_precompileset_assets_erc20::Erc20AssetsPrecompileSetCall< +type ForeignAssetsPCall = pallet_evm_precompileset_assets_erc20::Erc20AssetsPrecompileSetCall< Runtime, - IsLocal, - LocalAssetInstance, + ForeignAssetInstance, >; type XcmTransactorV2PCall = pallet_evm_precompile_xcm_transactor::v2::XcmTransactorPrecompileV2Call; @@ -153,9 +152,9 @@ fn verify_pallet_prefixes() { is_pallet_prefix::("Migrations"); is_pallet_prefix::("XcmTransactor"); is_pallet_prefix::("ProxyGenesisCompanion"); - is_pallet_prefix::("LocalAssets"); is_pallet_prefix::("MoonbeamOrbiters"); is_pallet_prefix::("TreasuryCouncilCollective"); + is_pallet_prefix::("MoonbeamLazyMigrations"); let prefix = |pallet_name, storage_name| { let mut res = [0u8; 32]; res[0..16].copy_from_slice(&Twox128::hash(pallet_name)); @@ -504,7 +503,7 @@ fn verify_pallet_indices() { is_pallet_index::(105); is_pallet_index::(106); is_pallet_index::(107); - is_pallet_index::(108); + is_pallet_index::(111); } #[test] @@ -517,7 +516,8 @@ fn verify_reserved_indices() { }; // 40: Sudo // 53: BaseFee - let reserved = vec![40, 53]; + // 108: pallet_assets:: + let reserved = vec![40, 53, 108]; let existing = metadata .pallets .iter() @@ -1725,31 +1725,6 @@ fn asset_can_be_registered() { }); } -#[test] -fn local_assets_cannot_be_create_by_signed_origins() { - ExtBuilder::default() - .with_balances(vec![ - (AccountId::from(ALICE), 2_000 * GLMR * SUPPLY_FACTOR), - (AccountId::from(BOB), 1_000 * GLMR * SUPPLY_FACTOR), - ]) - .build() - .execute_with(|| { - assert_noop!( - RuntimeCall::LocalAssets( - pallet_assets::Call::::create { - id: 11u128.into(), - admin: AccountId::from(ALICE), - min_balance: 1u128 - } - ) - .dispatch(::RuntimeOrigin::signed( - AccountId::from(ALICE) - )), - frame_system::Error::::CallFiltered - ); - }); -} - #[test] fn xcm_asset_erc20_precompiles_supply_and_balance() { ExtBuilder::default() @@ -1788,7 +1763,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::total_supply {}, + ForeignAssetsPCall::total_supply {}, ) .expect_cost(2000) .expect_no_logs() @@ -1799,7 +1774,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::balance_of { + ForeignAssetsPCall::balance_of { who: Address(ALICE.into()), }, ) @@ -1844,7 +1819,7 @@ fn xcm_asset_erc20_precompiles_transfer() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::transfer { + ForeignAssetsPCall::transfer { to: Address(BOB.into()), value: { 400 * GLMR }.into(), }, @@ -1864,7 +1839,7 @@ fn xcm_asset_erc20_precompiles_transfer() { .prepare_test( BOB, asset_precompile_address, - LocalAssetsPCall::balance_of { + ForeignAssetsPCall::balance_of { who: Address(BOB.into()), }, ) @@ -1909,7 +1884,7 @@ fn xcm_asset_erc20_precompiles_approve() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::approve { + ForeignAssetsPCall::approve { spender: Address(BOB.into()), value: { 400 * GLMR }.into(), }, @@ -1929,7 +1904,7 @@ fn xcm_asset_erc20_precompiles_approve() { .prepare_test( BOB, asset_precompile_address, - LocalAssetsPCall::transfer_from { + ForeignAssetsPCall::transfer_from { from: Address(ALICE.into()), to: Address(CHARLIE.into()), value: { 400 * GLMR }.into(), @@ -1950,7 +1925,7 @@ fn xcm_asset_erc20_precompiles_approve() { .prepare_test( CHARLIE, asset_precompile_address, - LocalAssetsPCall::balance_of { + ForeignAssetsPCall::balance_of { who: Address(CHARLIE.into()), }, ) diff --git a/runtime/moonbeam/tests/xcm_mock/mod.rs b/runtime/moonbeam/tests/xcm_mock/mod.rs index f1441c2e54..d52700b810 100644 --- a/runtime/moonbeam/tests/xcm_mock/mod.rs +++ b/runtime/moonbeam/tests/xcm_mock/mod.rs @@ -263,7 +263,6 @@ pub type StatemintChainPalletXcm = pallet_xcm::Pallet; pub type StatemintAssets = pallet_assets::Pallet; pub type Assets = pallet_assets::Pallet; -pub type LocalAssets = pallet_assets::Pallet; pub type Treasury = pallet_treasury::Pallet; pub type AssetManager = pallet_asset_manager::Pallet; pub type XTokens = orml_xtokens::Pallet; diff --git a/runtime/moonbeam/tests/xcm_mock/parachain.rs b/runtime/moonbeam/tests/xcm_mock/parachain.rs index 2024534f9f..bf3bd82f2a 100644 --- a/runtime/moonbeam/tests/xcm_mock/parachain.rs +++ b/runtime/moonbeam/tests/xcm_mock/parachain.rs @@ -50,11 +50,11 @@ use xcm::latest::{ }; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, - CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, - FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, WithComputedOrigin, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, + EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, FungiblesAdapter, IsConcrete, + NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, + TakeWeightCredit, WithComputedOrigin, }; use xcm_executor::{traits::JustTry, Config, XcmExecutor}; @@ -125,7 +125,6 @@ impl pallet_balances::Config for Runtime { } pub type ForeignAssetInstance = (); -pub type LocalAssetInstance = pallet_assets::Instance1; // Required for runtime benchmarks pallet_assets::runtime_benchmarks_enabled! { @@ -173,30 +172,6 @@ impl pallet_assets::Config for Runtime { } } -impl pallet_assets::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Balance = Balance; - type AssetId = AssetId; - type Currency = Balances; - type ForceOrigin = EnsureRoot; - type AssetDeposit = AssetDeposit; - type MetadataDepositBase = MetadataDepositBase; - type MetadataDepositPerByte = MetadataDepositPerByte; - type ApprovalDeposit = ApprovalDeposit; - type StringLimit = AssetsStringLimit; - type Freezer = (); - type Extra = (); - type AssetAccountDeposit = AssetAccountDeposit; - type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<656>; - type AssetIdParameter = AssetId; - type CreateOrigin = AsEnsureOriginWithArg>; - type CallbackHandle = (); - pallet_assets::runtime_benchmarks_enabled! { - type BenchmarkHelper = BenchmarkHelper; - } -} - /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. @@ -274,35 +249,8 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< (), >; -/// Means for transacting local assets besides the native currency on this chain. -pub type LocalFungiblesTransactor = FungiblesAdapter< - // Use this fungibles implementation: - LocalAssets, - // Use this currency when it is a fungible asset matching the given location or name: - ( - ConvertedConcreteId< - AssetId, - Balance, - AsPrefixedGeneralIndex, - JustTry, - >, - ), - // Convert an XCM MultiLocation into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We dont want to allow teleporting assets - NoChecking, - // The account to use for tracking teleports. - (), ->; - // We use all transactors -pub type AssetTransactors = ( - LocalAssetTransactor, - ForeignFungiblesTransactor, - LocalFungiblesTransactor, -); +pub type AssetTransactors = (LocalAssetTransactor, ForeignFungiblesTransactor); pub type XcmRouter = super::ParachainXcmRouter; pub type XcmBarrier = ( @@ -360,12 +308,6 @@ parameter_types! { PalletInstance(::index() as u8) ) }; - pub LocalAssetsPalletLocation: MultiLocation = MultiLocation { - parents:0, - interior: Junctions::X1( - PalletInstance(::index() as u8) - ) - }; pub const MaxAssetsIntoHolding: u32 = 64; } @@ -422,7 +364,6 @@ impl cumulus_pallet_xcm::Config for Runtime { pub enum CurrencyId { SelfReserve, ForeignAsset(AssetId), - LocalAssetReserve(AssetId), } // How to convert from CurrencyId to MultiLocation @@ -439,11 +380,6 @@ where Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), - CurrencyId::LocalAssetReserve(asset) => { - let mut location = LocalAssetsPalletLocation::get(); - location.push_interior(Junction::GeneralIndex(asset)).ok(); - Some(location) - } } } } @@ -825,32 +761,6 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { ) } - fn create_local_asset( - asset: AssetId, - _creator: AccountId, - min_balance: Balance, - is_sufficient: bool, - owner: AccountId, - ) -> DispatchResult { - LocalAssets::force_create( - RuntimeOrigin::root(), - asset, - owner, - is_sufficient, - min_balance, - )?; - - // TODO uncomment when we feel comfortable - /* - // The asset has been created. Let's put the revert code in the precompile address - let precompile_address = Runtime::asset_id_to_account(ASSET_PRECOMPILE_ADDRESS_PREFIX, asset); - pallet_evm::AccountCodes::::insert( - precompile_address, - vec![0x60, 0x00, 0x60, 0x00, 0xfd], - );*/ - Ok(()) - } - fn destroy_foreign_asset(asset: AssetId) -> DispatchResult { // Mark the asset as destroying Assets::start_destroy(RuntimeOrigin::root(), asset)?; @@ -858,13 +768,6 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { Ok(()) } - fn destroy_local_asset(asset: AssetId) -> DispatchResult { - // Mark the asset as destroying - LocalAssets::start_destroy(RuntimeOrigin::root(), asset)?; - - Ok(()) - } - fn destroy_asset_dispatch_info_weight(asset: AssetId) -> Weight { RuntimeCall::Assets( pallet_assets::Call::::start_destroy { @@ -1187,7 +1090,6 @@ construct_runtime!( AssetManager: pallet_asset_manager, XcmTransactor: pallet_xcm_transactor, Treasury: pallet_treasury, - LocalAssets: pallet_assets::, Proxy: pallet_proxy, Timestamp: pallet_timestamp, diff --git a/runtime/moonbeam/tests/xcm_tests.rs b/runtime/moonbeam/tests/xcm_tests.rs index 79098a78e3..5739252288 100644 --- a/runtime/moonbeam/tests/xcm_tests.rs +++ b/runtime/moonbeam/tests/xcm_tests.rs @@ -25,7 +25,6 @@ use frame_support::{ weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight}, BoundedVec, }; -use pallet_asset_manager::LocalAssetIdCreator; use pallet_xcm_transactor::{ Currency, CurrencyPayment, HrmpInitParams, HrmpOperation, TransactWeights, }; @@ -2299,242 +2298,6 @@ fn test_statemint_like() { }); } -#[test] -fn send_para_a_local_asset_to_para_b() { - MockNet::reset(); - - let asset_id = parachain::LocalAssetIdCreator::create_asset_id_from_metadata(0); - let para_a_local_asset = MultiLocation::new( - 1, - X3(Parachain(1), PalletInstance(11u8), GeneralIndex(asset_id)), - ); - let source_location = parachain::AssetType::Xcm(para_a_local_asset); - let source_id: parachain::AssetId = source_location.clone().into(); - - let asset_metadata = parachain::AssetMetadata { - name: b"ParaALocalAsset".to_vec(), - symbol: b"ParaALocalAsset".to_vec(), - decimals: 12, - }; - - ParaA::execute_with(|| { - assert_ok!(AssetManager::register_local_asset( - parachain::RuntimeOrigin::root(), - PARAALICE.into(), - PARAALICE.into(), - true, - 1 - )); - - assert_ok!(LocalAssets::mint( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - asset_id, - PARAALICE.into(), - 300000000000000 - )); - }); - - ParaB::execute_with(|| { - assert_ok!(AssetManager::register_foreign_asset( - parachain::RuntimeOrigin::root(), - source_location.clone(), - asset_metadata, - 1u128, - true - )); - assert_ok!(AssetManager::set_asset_units_per_second( - parachain::RuntimeOrigin::root(), - source_location, - 0u128, - 0 - )); - }); - - let dest = MultiLocation { - parents: 1, - interior: X2( - Parachain(2), - AccountKey20 { - network: None, - key: PARAALICE.into(), - }, - ), - }; - - ParaA::execute_with(|| { - // free execution, full amount received - assert_ok!(XTokens::transfer( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - parachain::CurrencyId::LocalAssetReserve(asset_id), - 100, - Box::new(VersionedMultiLocation::V3(dest)), - WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) - )); - }); - - ParaB::execute_with(|| { - // free execution, full amount received - assert_eq!(Assets::balance(source_id, &PARAALICE.into()), 100); - }); -} - -#[test] -fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_glmr() { - MockNet::reset(); - - let asset_id = parachain::LocalAssetIdCreator::create_asset_id_from_metadata(0); - let para_a_local_asset = MultiLocation::new( - 1, - X3(Parachain(1), PalletInstance(11u8), GeneralIndex(asset_id)), - ); - let source_location_local_asset = parachain::AssetType::Xcm(para_a_local_asset); - let source_id_local_asset: parachain::AssetId = source_location_local_asset.clone().into(); - - let asset_metadata_local_asset = parachain::AssetMetadata { - name: b"ParaALocalAsset".to_vec(), - symbol: b"ParaALocalAsset".to_vec(), - decimals: 12, - }; - - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location_balances = parachain::AssetType::Xcm(para_a_balances); - let source_id_balances: parachain::AssetId = source_location_balances.clone().into(); - - let asset_metadata_balances = parachain::AssetMetadata { - name: b"ParaAToken".to_vec(), - symbol: b"ParaA".to_vec(), - decimals: 18, - }; - - ParaB::execute_with(|| { - assert_ok!(AssetManager::register_foreign_asset( - parachain::RuntimeOrigin::root(), - source_location_local_asset.clone(), - asset_metadata_local_asset, - 1u128, - true - )); - assert_ok!(AssetManager::set_asset_units_per_second( - parachain::RuntimeOrigin::root(), - source_location_local_asset, - 0u128, - 0 - )); - - assert_ok!(AssetManager::register_foreign_asset( - parachain::RuntimeOrigin::root(), - source_location_balances.clone(), - asset_metadata_balances, - 1u128, - true - )); - assert_ok!(AssetManager::set_asset_units_per_second( - parachain::RuntimeOrigin::root(), - source_location_balances, - 0u128, - 1 - )); - }); - - ParaA::execute_with(|| { - assert_ok!(AssetManager::register_local_asset( - parachain::RuntimeOrigin::root(), - PARAALICE.into(), - PARAALICE.into(), - true, - 1 - )); - - assert_ok!(LocalAssets::mint( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - asset_id, - PARAALICE.into(), - 300000000000000 - )); - }); - - let dest = MultiLocation { - parents: 1, - interior: X2( - Parachain(2), - AccountKey20 { - network: None, - key: PARAALICE.into(), - }, - ), - }; - - ParaA::execute_with(|| { - // free execution, full amount received - assert_ok!(XTokens::transfer_multicurrencies( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - vec![ - (parachain::CurrencyId::LocalAssetReserve(asset_id), 100), - (parachain::CurrencyId::SelfReserve, 1000000) - ], - 0, - Box::new(VersionedMultiLocation::V3(dest)), - WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) - )); - }); - - let mut alith_balance_asset_before = 0; - let mut alith_balance_native_token_before = 0; - - ParaA::execute_with(|| { - alith_balance_asset_before = LocalAssets::balance(asset_id, &PARAALICE.into()); - alith_balance_native_token_before = ParaBalances::free_balance(&PARAALICE.into()); - }); - - let new_dest = MultiLocation { - parents: 1, - interior: X2( - Parachain(1), - AccountKey20 { - network: None, - key: PARAALICE.into(), - }, - ), - }; - - ParaB::execute_with(|| { - // free execution, full amount received - assert_eq!( - Assets::balance(source_id_local_asset, &PARAALICE.into()), - 100 - ); - assert_eq!( - Assets::balance(source_id_balances, &PARAALICE.into()), - 1000000 - ); - - // free execution, full amount received - assert_ok!(XTokens::transfer_multicurrencies( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - vec![ - (parachain::CurrencyId::ForeignAsset(source_id_balances), 4), - ( - parachain::CurrencyId::ForeignAsset(source_id_local_asset), - 50 - ) - ], - 0, - Box::new(VersionedMultiLocation::V3(new_dest)), - WeightLimit::Limited(4.into()) - )); - }); - - ParaA::execute_with(|| { - let alith_balance_asset_after = LocalAssets::balance(asset_id, &PARAALICE.into()); - let alith_balance_native_token_after = ParaBalances::free_balance(&PARAALICE.into()); - assert_eq!(alith_balance_asset_after, alith_balance_asset_before + 50); - assert_eq!( - alith_balance_native_token_before, - alith_balance_native_token_after - ); - }); -} - #[test] fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { MockNet::reset(); diff --git a/runtime/moonriver/Cargo.toml b/runtime/moonriver/Cargo.toml index dfc6a22fa6..78971397a3 100644 --- a/runtime/moonriver/Cargo.toml +++ b/runtime/moonriver/Cargo.toml @@ -13,7 +13,7 @@ hex-literal = { workspace = true, optional = true } log = { workspace = true } num_enum = { workspace = true } rlp = { workspace = true, optional = true } -serde = { workspace = true, features = [ "derive" ] } +serde = { workspace = true, features = ["derive"] } sha3 = { workspace = true, optional = true } smallvec = { workspace = true } strum = { workspace = true } @@ -36,8 +36,9 @@ pallet-crowdloan-rewards = { workspace = true } pallet-erc20-xcm-bridge = { workspace = true } pallet-evm-chain-id = { workspace = true } pallet-ethereum-xcm = { workspace = true } -pallet-maintenance-mode = { workspace = true, features = [ "xcm-support" ] } +pallet-maintenance-mode = { workspace = true, features = ["xcm-support"] } pallet-migrations = { workspace = true } +pallet-moonbeam-lazy-migrations = { workspace = true } pallet-moonbeam-orbiters = { workspace = true } pallet-parachain-staking = { workspace = true } pallet-proxy-genesis-companion = { workspace = true } @@ -79,7 +80,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } frame-system-rpc-runtime-api = { workspace = true } pallet-assets = { workspace = true } -pallet-balances = { workspace = true, features = [ "insecure_zero_ed" ] } +pallet-balances = { workspace = true, features = ["insecure_zero_ed"] } pallet-collective = { workspace = true } pallet-conviction-voting = { workspace = true } pallet-democracy = { workspace = true } @@ -102,14 +103,14 @@ parity-scale-codec = { workspace = true, features = [ "max-encoded-len", "chain-error", ] } -scale-info = { workspace = true, features = [ "derive" ] } +scale-info = { workspace = true, features = ["derive"] } sp-api = { workspace = true } sp-block-builder = { workspace = true } sp-consensus-slots = { workspace = true } sp-core = { workspace = true } sp-debug-derive = { workspace = true } sp-inherents = { workspace = true } -sp-io = { workspace = true, features = [ "improved_panic_error_reporting" ] } +sp-io = { workspace = true, features = ["improved_panic_error_reporting"] } sp-offchain = { workspace = true } sp-runtime = { workspace = true } sp-session = { workspace = true } @@ -121,9 +122,9 @@ sp-weights = { workspace = true } # Frontier fp-evm = { workspace = true } fp-rpc = { workspace = true } -fp-self-contained = { workspace = true, features = [ "serde" ] } -pallet-ethereum = { workspace = true, features = [ "forbid-evm-reentrancy" ] } -pallet-evm = { workspace = true, features = [ "forbid-evm-reentrancy" ] } +fp-self-contained = { workspace = true, features = ["serde"] } +pallet-ethereum = { workspace = true, features = ["forbid-evm-reentrancy"] } +pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] } pallet-evm-precompile-blake2 = { workspace = true } pallet-evm-precompile-bn128 = { workspace = true } pallet-evm-precompile-dispatch = { workspace = true } @@ -169,8 +170,8 @@ frame-try-runtime = { workspace = true, optional = true } [dev-dependencies] ethereum = { workspace = true } frame-metadata = { workspace = true } -hex = { workspace = true, features = [ "std" ] } -sha3 = { workspace = true, features = [ "std" ] } +hex = { workspace = true, features = ["std"] } +sha3 = { workspace = true, features = ["std"] } cumulus-primitives-parachain-inherent = { workspace = true } cumulus-test-relay-sproof-builder = { workspace = true } @@ -179,13 +180,13 @@ pallet-message-queue = { workspace = true } polkadot-runtime-parachains = { workspace = true } xcm-simulator = { workspace = true } -precompile-utils = { workspace = true, features = [ "std", "testing" ] } +precompile-utils = { workspace = true, features = ["std", "testing"] } [build-dependencies] substrate-wasm-builder = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "account/std", "async-backing-primitives/std", @@ -246,6 +247,7 @@ std = [ "pallet-identity/std", "pallet-maintenance-mode/std", "pallet-migrations/std", + "pallet-moonbeam-lazy-migrations/std", "pallet-moonbeam-orbiters/std", "pallet-multisig/std", "pallet-parachain-staking/std", @@ -290,10 +292,10 @@ std = [ ] # Must be enabled for tracing runtimes only -evm-tracing = [ "evm-tracing-events", "moonbeam-evm-tracer", "rlp", "sha3" ] +evm-tracing = ["evm-tracing-events", "moonbeam-evm-tracer", "rlp", "sha3"] # Allow to print logs details (no wasm:stripped) -force-debug = [ "sp-debug-derive/force-debug" ] +force-debug = ["sp-debug-derive/force-debug"] # Will be enabled by the `wasm-builder` when building the runtime for WASM. runtime-wasm = [] @@ -301,7 +303,7 @@ runtime-wasm = [] # A feature that should be enabled when the runtime should be build for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", @@ -328,6 +330,7 @@ runtime-benchmarks = [ "pallet-evm/runtime-benchmarks", "pallet-identity/runtime-benchmarks", "pallet-migrations/runtime-benchmarks", + "pallet-moonbeam-lazy-migrations/runtime-benchmarks", "pallet-moonbeam-orbiters/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-parachain-staking/runtime-benchmarks", @@ -363,6 +366,7 @@ try-runtime = [ "pallet-democracy/try-runtime", "pallet-maintenance-mode/try-runtime", "pallet-migrations/try-runtime", + "pallet-moonbeam-lazy-migrations/try-runtime", "pallet-parachain-staking/try-runtime", "pallet-preimage/try-runtime", "pallet-referenda/try-runtime", diff --git a/runtime/moonriver/src/asset_config.rs b/runtime/moonriver/src/asset_config.rs index f475e9ece1..23c2abb5ed 100644 --- a/runtime/moonriver/src/asset_config.rs +++ b/runtime/moonriver/src/asset_config.rs @@ -19,8 +19,8 @@ use super::{ currency, governance, xcm_config, AccountId, AssetId, AssetManager, Assets, Balance, Balances, - CouncilInstance, LocalAssets, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, - FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, + CouncilInstance, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, + FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, }; use moonbeam_runtime_common::weights as moonbeam_weights; @@ -54,7 +54,6 @@ const REMOVE_ITEMS_LIMIT: u32 = 656; // Not to disrupt the previous asset instance, we assign () to Foreign pub type ForeignAssetInstance = (); -pub type LocalAssetInstance = pallet_assets::Instance1; // For foreign assets, these parameters dont matter much // as this will only be called by root with the forced arguments @@ -116,31 +115,6 @@ impl pallet_assets::Config for Runtime { } } -// Local assets -impl pallet_assets::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Balance = Balance; - type AssetId = AssetId; - type Currency = Balances; - type ForceOrigin = EnsureNever; - type AssetDeposit = AssetDeposit; - type MetadataDepositBase = MetadataDepositBase; - type MetadataDepositPerByte = MetadataDepositPerByte; - type ApprovalDeposit = ApprovalDeposit; - type StringLimit = AssetsStringLimit; - type Freezer = (); - type Extra = (); - type AssetAccountDeposit = ConstU128<{ currency::deposit(1, 18) }>; - type WeightInfo = moonbeam_weights::pallet_assets::WeightInfo; - type RemoveItemsLimit = ConstU32<{ REMOVE_ITEMS_LIMIT }>; - type AssetIdParameter = Compact; - type CreateOrigin = AsEnsureOriginWithArg>; - type CallbackHandle = (); - pallet_assets::runtime_benchmarks_enabled! { - type BenchmarkHelper = BenchmarkHelper; - } -} - // We instruct how to register the Assets // In this case, we tell it to Create an Asset in pallet-assets pub struct AssetRegistrar; @@ -162,15 +136,6 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { min_balance, )?; - // TODO uncomment when we feel comfortable - /* - // The asset has been created. Let's put the revert code in the precompile address - let precompile_address = Runtime::asset_id_to_account(asset); - pallet_evm::AccountCodes::::insert( - precompile_address, - vec![0x60, 0x00, 0x60, 0x00, 0xfd], - );*/ - // Lastly, the metadata Assets::force_set_metadata( RuntimeOrigin::root(), @@ -182,62 +147,10 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { ) } - #[transactional] - fn create_local_asset( - asset: AssetId, - _creator: AccountId, - min_balance: Balance, - is_sufficient: bool, - owner: AccountId, - ) -> DispatchResult { - // We create with root, because we need to decide whether we want to create the asset - // as sufficient. Take into account this does not hold any reserved amount - // in pallet-assets - LocalAssets::force_create( - RuntimeOrigin::root(), - asset.into(), - owner, - is_sufficient, - min_balance, - )?; - - // No metadata needs to be set, as this can be set through regular calls - - // TODO: should we put the revert code? - // The asset has been created. Let's put the revert code in the precompile address - let precompile_address: H160 = - Runtime::asset_id_to_account(LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, asset).into(); - pallet_evm::AccountCodes::::insert( - precompile_address, - vec![0x60, 0x00, 0x60, 0x00, 0xfd], - ); - Ok(()) - } - #[transactional] fn destroy_foreign_asset(asset: AssetId) -> DispatchResult { // Mark the asset as destroying - Assets::start_destroy(RuntimeOrigin::root(), asset.into())?; - - // We remove the EVM revert code - // This does not panick even if there is no code in the address - let precompile_address: H160 = - Runtime::asset_id_to_account(FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, asset).into(); - pallet_evm::AccountCodes::::remove(precompile_address); - Ok(()) - } - - #[transactional] - fn destroy_local_asset(asset: AssetId) -> DispatchResult { - // Mark the asset as destroying - LocalAssets::start_destroy(RuntimeOrigin::root(), asset.into())?; - - // We remove the EVM revert code - // This does not panick even if there is no code in the address - let precompile_address: H160 = - Runtime::asset_id_to_account(LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, asset).into(); - pallet_evm::AccountCodes::::remove(precompile_address); - Ok(()) + Assets::start_destroy(RuntimeOrigin::root(), asset.into()) } fn destroy_asset_dispatch_info_weight(asset: AssetId) -> Weight { @@ -245,20 +158,15 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { // witness // We need to take the dispatch info from the destroy call, which is already annotated in // the assets pallet - // Additionally, we need to add a DB write for removing the precompile revert code in the - // EVM // This is the dispatch info of destroy - let call_weight = RuntimeCall::Assets( + RuntimeCall::Assets( pallet_assets::Call::::start_destroy { id: asset.into(), }, ) .get_dispatch_info() - .weight; - - // This is the db write - call_weight.saturating_add(::DbWeight::get().writes(1)) + .weight } } @@ -322,9 +230,7 @@ impl AccountIdAssetIdConversion for Runtime { let h160_account: H160 = account.into(); let mut data = [0u8; 16]; let (prefix_part, id_part) = h160_account.as_fixed_bytes().split_at(4); - if prefix_part == FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX - || prefix_part == LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX - { + if prefix_part == FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX { data.copy_from_slice(id_part); let asset_id: AssetId = u128::from_be_bytes(data).into(); Some((prefix_part.to_vec(), asset_id)) diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 01e0ebaaef..62a86158c3 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -108,7 +108,6 @@ use nimbus_primitives::CanAuthor; mod precompiles; pub use precompiles::{ MoonriverPrecompiles, PrecompileName, FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, - LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX, }; #[cfg(any(feature = "std", test))] @@ -1133,13 +1132,14 @@ impl pallet_migrations::Config for Runtime { type XcmExecutionManager = XcmExecutionManager; } +impl pallet_moonbeam_lazy_migrations::Config for Runtime {} + /// Maintenance mode Call filter pub struct MaintenanceFilter; impl Contains for MaintenanceFilter { fn contains(c: &RuntimeCall) -> bool { match c { RuntimeCall::Assets(_) => false, - RuntimeCall::LocalAssets(_) => false, RuntimeCall::Balances(_) => false, RuntimeCall::CrowdloanRewards(_) => false, RuntimeCall::Ethereum(_) => false, @@ -1178,16 +1178,6 @@ impl Contains for NormalFilter { pallet_assets::Call::finish_destroy { .. } => true, _ => false, }, - // We want to disable create, as we dont want users to be choosing the - // assetId of their choice - // We also disable destroy, as we want to route destroy through the - // asset-manager, which guarantees the removal both at the EVM and - // substrate side of things - RuntimeCall::LocalAssets(method) => match method { - pallet_assets::Call::create { .. } => false, - pallet_assets::Call::start_destroy { .. } => false, - _ => true, - }, // We just want to enable this in case of live chains, since the default version // is populated at genesis RuntimeCall::PolkadotXcm(method) => match method { @@ -1499,9 +1489,10 @@ construct_runtime! { AssetManager: pallet_asset_manager::{Pallet, Call, Storage, Event} = 105, XTokens: orml_xtokens::{Pallet, Call, Storage, Event} = 106, XcmTransactor: pallet_xcm_transactor::{Pallet, Call, Storage, Event} = 107, - LocalAssets: pallet_assets::::{Pallet, Call, Storage, Event} = 108, + // Previously 108: pallet_assets:: EthereumXcm: pallet_ethereum_xcm::{Pallet, Call, Storage, Origin} = 109, Erc20XcmBridge: pallet_erc20_xcm_bridge::{Pallet} = 110, + MoonbeamLazyMigrations: pallet_moonbeam_lazy_migrations::{Pallet, Call, Storage} = 111, // Randomness Randomness: pallet_randomness::{Pallet, Call, Storage, Event, Inherent} = 120, @@ -1752,6 +1743,10 @@ mod tests { std::mem::size_of::>() <= CALL_ALIGN as usize ); assert!(std::mem::size_of::>() <= CALL_ALIGN as usize); + assert!( + std::mem::size_of::>() + <= CALL_ALIGN as usize + ); assert!( std::mem::size_of::>() <= CALL_ALIGN as usize diff --git a/runtime/moonriver/src/precompiles.rs b/runtime/moonriver/src/precompiles.rs index d07a30ee11..4d9045f8d4 100644 --- a/runtime/moonriver/src/precompiles.rs +++ b/runtime/moonriver/src/precompiles.rs @@ -15,9 +15,8 @@ // along with Moonbeam. If not, see . use crate::{ - asset_config::{ForeignAssetInstance, LocalAssetInstance}, - xcm_config::XcmExecutorConfig, - CouncilInstance, OpenTechCommitteeInstance, TechCommitteeInstance, TreasuryCouncilInstance, + asset_config::ForeignAssetInstance, xcm_config::XcmExecutorConfig, CouncilInstance, + OpenTechCommitteeInstance, TechCommitteeInstance, TreasuryCouncilInstance, }; use frame_support::parameter_types; use pallet_evm_precompile_author_mapping::AuthorMappingPrecompile; @@ -47,7 +46,7 @@ use pallet_evm_precompile_xcm_transactor::{ }; use pallet_evm_precompile_xcm_utils::XcmUtilsPrecompile; use pallet_evm_precompile_xtokens::XtokensPrecompile; -use pallet_evm_precompileset_assets_erc20::{Erc20AssetsPrecompileSet, IsForeign, IsLocal}; +use pallet_evm_precompileset_assets_erc20::Erc20AssetsPrecompileSet; use precompile_utils::precompile_set::*; pub struct NativeErc20Metadata; @@ -79,13 +78,9 @@ impl Erc20Metadata for NativeErc20Metadata { /// The asset precompile address prefix. Addresses that match against this prefix will be routed /// to Erc20AssetsPrecompileSet being marked as foreign pub const FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX: &[u8] = &[255u8; 4]; -/// The asset precompile address prefix. Addresses that match against this prefix will be routed -/// to Erc20AssetsPrecompileSet being marked as local -pub const LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX: &[u8] = &[255u8, 255u8, 255u8, 254u8]; parameter_types! { pub ForeignAssetPrefix: &'static [u8] = FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX; - pub LocalAssetPrefix: &'static [u8] = LOCAL_ASSET_PRECOMPILE_ADDRESS_PREFIX; } type EthereumPrecompilesChecks = (AcceptDelegateCall, CallableByContract, CallableByPrecompile); @@ -261,13 +256,11 @@ pub type MoonriverPrecompiles = PrecompileSetBuilder< // Prefixed precompile sets (XC20) PrecompileSetStartingWith< ForeignAssetPrefix, - Erc20AssetsPrecompileSet, - CallableByContract, - >, - PrecompileSetStartingWith< - LocalAssetPrefix, - Erc20AssetsPrecompileSet, + Erc20AssetsPrecompileSet, CallableByContract, >, + // Moonriver never had any local assets (No blacklist needed + // https://moonriver.subscan.io/event?module=localassets&event_id=created + // https://moonriver.subscan.io/event?module=localassets&event_id=forcecreated ), >; diff --git a/runtime/moonriver/src/xcm_config.rs b/runtime/moonriver/src/xcm_config.rs index 18c828cb24..394737f06c 100644 --- a/runtime/moonriver/src/xcm_config.rs +++ b/runtime/moonriver/src/xcm_config.rs @@ -19,8 +19,8 @@ use super::{ governance, AccountId, AssetId, AssetManager, Assets, Balance, Balances, DealWithFees, - Erc20XcmBridge, LocalAssets, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, - RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, + Erc20XcmBridge, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, + RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, }; use frame_support::{ @@ -40,12 +40,11 @@ use sp_core::{ConstU32, H160, H256}; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, - CurrencyAdapter as XcmCurrencyAdapter, DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, - FungiblesAdapter, HashedDescription, NoChecking, ParentIsPreset, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, - SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, - WithComputedOrigin, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, + DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, FungiblesAdapter, HashedDescription, + NoChecking, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, + TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin, }; use xcm::latest::prelude::*; @@ -88,16 +87,6 @@ parameter_types! { PalletInstance(::index() as u8) ) }; - - // This is the relative view of our local assets. - // Indentified by thix prefix + generalIndex(assetId) - // We use the RELATIVE multilocation - pub LocalAssetsPalletLocation: MultiLocation = MultiLocation { - parents:0, - interior: Junctions::X1( - PalletInstance(::index() as u8) - ) - }; } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used @@ -162,31 +151,6 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< (), >; -/// Means for transacting local assets besides the native currency on this chain. -pub type LocalFungiblesTransactor = FungiblesAdapter< - // Use this fungibles implementation: - LocalAssets, - // Use this currency when it is a fungible asset matching the given location or name: - ( - ConvertedConcreteId< - AssetId, - Balance, - // This just tells to convert an assetId into a GeneralIndex junction prepended - // by LocalAssetsPalletLocationNewReanchor - AsPrefixedGeneralIndex, - JustTry, - >, - ), - // Convert an XCM MultiLocation into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We dont want to allow teleporting assets - NoChecking, - // The account to use for tracking teleports. - (), ->; - // We use all transactors // These correspond to // SelfReserve asset, both pre and post 0.9.16 @@ -197,7 +161,6 @@ pub type LocalFungiblesTransactor = FungiblesAdapter< pub type AssetTransactors = ( LocalAssetTransactor, ForeignFungiblesTransactor, - LocalFungiblesTransactor, Erc20XcmBridge, ); @@ -467,7 +430,7 @@ pub enum CurrencyId { // Assets representing other chains native tokens ForeignAsset(AssetId), // Our local assets - LocalAssetReserve(AssetId), + DeprecatedLocalAssetReserve(AssetId), // Erc20 token Erc20 { contract_address: H160 }, } @@ -479,15 +442,8 @@ impl AccountIdToCurrencyId for Runtime { a if a == H160::from_low_u64_be(2050).into() => CurrencyId::SelfReserve, // the rest of the currencies, by their corresponding erc20 address _ => match Runtime::account_to_asset_id(account) { - // We distinguish by prefix, and depending on it we create either - // Foreign or Local - Some((prefix, asset_id)) => { - if prefix == FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX.to_vec() { - CurrencyId::ForeignAsset(asset_id) - } else { - CurrencyId::LocalAssetReserve(asset_id) - } - } + // A foreign asset + Some((_prefix, asset_id)) => CurrencyId::ForeignAsset(asset_id), // If no known prefix is identified, we consider that it's a "real" erc20 token // (i.e. managed by a real smart contract) None => CurrencyId::Erc20 { @@ -517,11 +473,7 @@ where Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), - CurrencyId::LocalAssetReserve(asset) => { - let mut location = LocalAssetsPalletLocation::get(); - location.push_interior(Junction::GeneralIndex(asset)).ok(); - Some(location) - } + CurrencyId::DeprecatedLocalAssetReserve(_) => None, CurrencyId::Erc20 { contract_address } => { let mut location = Erc20XcmBridgePalletLocation::get(); location diff --git a/runtime/moonriver/tests/common/mod.rs b/runtime/moonriver/tests/common/mod.rs index 21614b44a6..da3092da5e 100644 --- a/runtime/moonriver/tests/common/mod.rs +++ b/runtime/moonriver/tests/common/mod.rs @@ -27,9 +27,9 @@ pub use moonriver_runtime::{ currency::{GIGAWEI, MOVR, SUPPLY_FACTOR, WEI}, xcm_config::AssetType, AccountId, AssetId, AssetManager, Assets, AuthorInherent, Balance, Balances, CrowdloanRewards, - Ethereum, Executive, Header, InflationInfo, LocalAssets, ParachainStaking, Range, Runtime, - RuntimeCall, RuntimeEvent, System, TransactionConverter, TransactionPaymentAsGasPrice, - UncheckedExtrinsic, HOURS, WEEKS, + Ethereum, Executive, Header, InflationInfo, ParachainStaking, Range, Runtime, RuntimeCall, + RuntimeEvent, System, TransactionConverter, TransactionPaymentAsGasPrice, UncheckedExtrinsic, + HOURS, WEEKS, }; use nimbus_primitives::{NimbusId, NIMBUS_ENGINE_ID}; use sp_core::{Encode, H160}; @@ -294,17 +294,8 @@ impl ExtBuilder { genesis_config.assimilate_storage(&mut t).unwrap(); let mut ext = sp_io::TestExternalities::new(t); - let local_assets = self.local_assets.clone(); let xcm_assets = self.xcm_assets.clone(); ext.execute_with(|| { - // If any local assets specified, we create them here - for (asset_id, balances, owner) in local_assets.clone() { - LocalAssets::force_create(root_origin(), asset_id.into(), owner, true, 1).unwrap(); - for (account, balance) in balances { - LocalAssets::mint(origin_of(owner.into()), asset_id.into(), account, balance) - .unwrap(); - } - } // If any xcm assets specified, we register them here for xcm_asset_initialization in xcm_assets { let asset_id: AssetId = xcm_asset_initialization.asset_type.clone().into(); diff --git a/runtime/moonriver/tests/integration_test.rs b/runtime/moonriver/tests/integration_test.rs index 8e86e1216f..cfe5371373 100644 --- a/runtime/moonriver/tests/integration_test.rs +++ b/runtime/moonriver/tests/integration_test.rs @@ -34,7 +34,7 @@ use frame_support::{ }; use moonbeam_xcm_benchmarks::weights::XcmWeight; use moonriver_runtime::{ - asset_config::LocalAssetInstance, + asset_config::ForeignAssetInstance, xcm_config::{CurrencyId, SelfReserve}, AssetId, CouncilCollective, OpenTechCommitteeCollective, PolkadotXcm, Precompiles, RuntimeBlockWeights, TechCommitteeCollective, TransactionPayment, TreasuryCouncilCollective, @@ -43,7 +43,7 @@ use moonriver_runtime::{ use nimbus_primitives::NimbusId; use pallet_evm::PrecompileSet; use pallet_evm_precompileset_assets_erc20::{ - AccountIdAssetIdConversion, IsLocal, SELECTOR_LOG_APPROVAL, SELECTOR_LOG_TRANSFER, + AccountIdAssetIdConversion, SELECTOR_LOG_APPROVAL, SELECTOR_LOG_TRANSFER, }; use pallet_transaction_payment::Multiplier; use pallet_xcm_transactor::{Currency, CurrencyPayment, TransactWeights}; @@ -74,10 +74,9 @@ type XcmUtilsPCall = pallet_evm_precompile_xcm_utils::XcmUtilsPrecompileCall< moonriver_runtime::xcm_config::XcmExecutorConfig, >; type XtokensPCall = pallet_evm_precompile_xtokens::XtokensPrecompileCall; -type LocalAssetsPCall = pallet_evm_precompileset_assets_erc20::Erc20AssetsPrecompileSetCall< +type ForeignAssetsPCall = pallet_evm_precompileset_assets_erc20::Erc20AssetsPrecompileSetCall< Runtime, - IsLocal, - LocalAssetInstance, + ForeignAssetInstance, >; type XcmTransactorV2PCall = pallet_evm_precompile_xcm_transactor::v2::XcmTransactorPrecompileV2Call; @@ -151,9 +150,9 @@ fn verify_pallet_prefixes() { is_pallet_prefix::("Migrations"); is_pallet_prefix::("XcmTransactor"); is_pallet_prefix::("ProxyGenesisCompanion"); - is_pallet_prefix::("LocalAssets"); is_pallet_prefix::("MoonbeamOrbiters"); is_pallet_prefix::("TreasuryCouncilCollective"); + is_pallet_prefix::("MoonbeamLazyMigrations"); let prefix = |pallet_name, storage_name| { let mut res = [0u8; 32]; @@ -502,7 +501,7 @@ fn verify_pallet_indices() { is_pallet_index::(105); is_pallet_index::(106); is_pallet_index::(107); - is_pallet_index::(108); + is_pallet_index::(111); } #[test] @@ -515,7 +514,8 @@ fn verify_reserved_indices() { }; // 40: Sudo // 53: BaseFee - let reserved = vec![40, 53]; + // 108: pallet_assets:: + let reserved = vec![40, 53, 108]; let existing = metadata .pallets .iter() @@ -1700,31 +1700,6 @@ fn asset_can_be_registered() { }); } -#[test] -fn local_assets_cannot_be_create_by_signed_origins() { - ExtBuilder::default() - .with_balances(vec![ - (AccountId::from(ALICE), 2_000 * MOVR * SUPPLY_FACTOR), - (AccountId::from(BOB), 1_000 * MOVR * SUPPLY_FACTOR), - ]) - .build() - .execute_with(|| { - assert_noop!( - RuntimeCall::LocalAssets( - pallet_assets::Call::::create { - id: 11u128.into(), - admin: AccountId::from(ALICE), - min_balance: 1u128 - } - ) - .dispatch(::RuntimeOrigin::signed( - AccountId::from(ALICE) - )), - frame_system::Error::::CallFiltered - ); - }); -} - #[test] fn xcm_asset_erc20_precompiles_supply_and_balance() { ExtBuilder::default() @@ -1762,7 +1737,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::total_supply {}, + ForeignAssetsPCall::total_supply {}, ) .expect_cost(2000) .expect_no_logs() @@ -1773,7 +1748,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::balance_of { + ForeignAssetsPCall::balance_of { who: Address(ALICE.into()), }, ) @@ -1817,7 +1792,7 @@ fn xcm_asset_erc20_precompiles_transfer() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::transfer { + ForeignAssetsPCall::transfer { to: Address(BOB.into()), value: { 400 * MOVR }.into(), }, @@ -1837,7 +1812,7 @@ fn xcm_asset_erc20_precompiles_transfer() { .prepare_test( BOB, asset_precompile_address, - LocalAssetsPCall::balance_of { + ForeignAssetsPCall::balance_of { who: Address(BOB.into()), }, ) @@ -1881,7 +1856,7 @@ fn xcm_asset_erc20_precompiles_approve() { .prepare_test( ALICE, asset_precompile_address, - LocalAssetsPCall::approve { + ForeignAssetsPCall::approve { spender: Address(BOB.into()), value: { 400 * MOVR }.into(), }, @@ -1901,7 +1876,7 @@ fn xcm_asset_erc20_precompiles_approve() { .prepare_test( BOB, asset_precompile_address, - LocalAssetsPCall::transfer_from { + ForeignAssetsPCall::transfer_from { from: Address(ALICE.into()), to: Address(CHARLIE.into()), value: { 400 * MOVR }.into(), @@ -1922,7 +1897,7 @@ fn xcm_asset_erc20_precompiles_approve() { .prepare_test( CHARLIE, asset_precompile_address, - LocalAssetsPCall::balance_of { + ForeignAssetsPCall::balance_of { who: Address(CHARLIE.into()), }, ) diff --git a/runtime/moonriver/tests/xcm_mock/mod.rs b/runtime/moonriver/tests/xcm_mock/mod.rs index b2910d172a..8d5d6e8c6c 100644 --- a/runtime/moonriver/tests/xcm_mock/mod.rs +++ b/runtime/moonriver/tests/xcm_mock/mod.rs @@ -264,9 +264,7 @@ pub type StatemineAssets = pallet_assets::Pallet; pub type ParachainPalletXcm = pallet_xcm::Pallet; pub type Assets = pallet_assets::Pallet; -pub type LocalAssets = pallet_assets::Pallet; -pub type Balances = pallet_balances::Pallet; pub type Treasury = pallet_treasury::Pallet; pub type AssetManager = pallet_asset_manager::Pallet; pub type XTokens = orml_xtokens::Pallet; diff --git a/runtime/moonriver/tests/xcm_mock/parachain.rs b/runtime/moonriver/tests/xcm_mock/parachain.rs index 3e5b1f320a..f6f1843fc8 100644 --- a/runtime/moonriver/tests/xcm_mock/parachain.rs +++ b/runtime/moonriver/tests/xcm_mock/parachain.rs @@ -49,11 +49,11 @@ use xcm::latest::{ }; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId, - CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, - FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, WithComputedOrigin, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, + EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, FungiblesAdapter, IsConcrete, + NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, + TakeWeightCredit, WithComputedOrigin, }; use xcm_executor::{traits::JustTry, Config, XcmExecutor}; @@ -124,7 +124,6 @@ impl pallet_balances::Config for Runtime { } pub type ForeignAssetInstance = (); -pub type LocalAssetInstance = pallet_assets::Instance1; // Required for runtime benchmarks pallet_assets::runtime_benchmarks_enabled! { @@ -172,30 +171,6 @@ impl pallet_assets::Config for Runtime { } } -impl pallet_assets::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Balance = Balance; - type AssetId = AssetId; - type Currency = Balances; - type ForceOrigin = EnsureRoot; - type AssetDeposit = AssetDeposit; - type MetadataDepositBase = MetadataDepositBase; - type MetadataDepositPerByte = MetadataDepositPerByte; - type ApprovalDeposit = ApprovalDeposit; - type StringLimit = AssetsStringLimit; - type Freezer = (); - type Extra = (); - type AssetAccountDeposit = AssetAccountDeposit; - type WeightInfo = pallet_assets::weights::SubstrateWeight; - type RemoveItemsLimit = ConstU32<656>; - type AssetIdParameter = AssetId; - type CreateOrigin = AsEnsureOriginWithArg>; - type CallbackHandle = (); - pallet_assets::runtime_benchmarks_enabled! { - type BenchmarkHelper = BenchmarkHelper; - } -} - /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. @@ -273,35 +248,8 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< (), >; -/// Means for transacting local assets besides the native currency on this chain. -pub type LocalFungiblesTransactor = FungiblesAdapter< - // Use this fungibles implementation: - LocalAssets, - // Use this currency when it is a fungible asset matching the given location or name: - ( - ConvertedConcreteId< - AssetId, - Balance, - AsPrefixedGeneralIndex, - JustTry, - >, - ), - // Convert an XCM MultiLocation into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We dont want to allow teleporting assets - NoChecking, - // The account to use for tracking teleports. - (), ->; - // We use both transactors -pub type AssetTransactors = ( - LocalAssetTransactor, - ForeignFungiblesTransactor, - LocalFungiblesTransactor, -); +pub type AssetTransactors = (LocalAssetTransactor, ForeignFungiblesTransactor); pub type XcmRouter = super::ParachainXcmRouter; @@ -358,13 +306,6 @@ parameter_types! { pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); - pub LocalAssetsPalletLocation: MultiLocation = MultiLocation { - parents:0, - interior: Junctions::X1( - PalletInstance(::index() as u8) - ) - }; - // This is used to match it against our Balances pallet when we receive such a MultiLocation // (Parent, Self Para Id, Self Balances pallet index) pub SelfReserve: MultiLocation = MultiLocation { @@ -430,7 +371,6 @@ impl cumulus_pallet_xcm::Config for Runtime { pub enum CurrencyId { SelfReserve, ForeignAsset(AssetId), - LocalAssetReserve(AssetId), } // How to convert from CurrencyId to MultiLocation @@ -452,11 +392,6 @@ where Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), - CurrencyId::LocalAssetReserve(asset) => { - let mut location = LocalAssetsPalletLocation::get(); - location.push_interior(Junction::GeneralIndex(asset)).ok(); - Some(location) - } } } } @@ -839,31 +774,6 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { ) } - fn create_local_asset( - asset: AssetId, - _creator: AccountId, - min_balance: Balance, - is_sufficient: bool, - owner: AccountId, - ) -> DispatchResult { - LocalAssets::force_create( - RuntimeOrigin::root(), - asset, - owner, - is_sufficient, - min_balance, - )?; - - // TODO uncomment when we feel comfortable - /* - // The asset has been created. Let's put the revert code in the precompile address - let precompile_address = Runtime::asset_id_to_account(ASSET_PRECOMPILE_ADDRESS_PREFIX, asset); - pallet_evm::AccountCodes::::insert( - precompile_address, - vec![0x60, 0x00, 0x60, 0x00, 0xfd], - );*/ - Ok(()) - } fn destroy_foreign_asset(asset: AssetId) -> DispatchResult { // Mark the asset as destroying Assets::start_destroy(RuntimeOrigin::root(), asset)?; @@ -871,13 +781,6 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { Ok(()) } - fn destroy_local_asset(asset: AssetId) -> DispatchResult { - // Mark the asset as destroying - LocalAssets::start_destroy(RuntimeOrigin::root(), asset)?; - - Ok(()) - } - fn destroy_asset_dispatch_info_weight(asset: AssetId) -> Weight { RuntimeCall::Assets( pallet_assets::Call::::start_destroy { id: asset }, @@ -1197,7 +1100,6 @@ construct_runtime!( AssetManager: pallet_asset_manager, XcmTransactor: pallet_xcm_transactor, Treasury: pallet_treasury, - LocalAssets: pallet_assets::, Proxy: pallet_proxy, Timestamp: pallet_timestamp, diff --git a/runtime/moonriver/tests/xcm_tests.rs b/runtime/moonriver/tests/xcm_tests.rs index fb60951ca6..1868ecd47f 100644 --- a/runtime/moonriver/tests/xcm_tests.rs +++ b/runtime/moonriver/tests/xcm_tests.rs @@ -23,7 +23,6 @@ use frame_support::{ weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight}, BoundedVec, }; -use pallet_asset_manager::LocalAssetIdCreator; use sp_core::ConstU32; use xcm::latest::prelude::*; use xcm::{VersionedMultiLocation, WrapVersion}; @@ -34,7 +33,6 @@ use xcm_mock::relay_chain; use xcm_mock::*; use xcm_simulator::TestExt; mod common; -use common::ExtBuilder; use cumulus_primitives_core::relay_chain::HrmpChannelId; use pallet_xcm_transactor::{ Currency, CurrencyPayment, HrmpInitParams, HrmpOperation, TransactWeights, @@ -2601,246 +2599,6 @@ fn test_statemine_like() { }); } -#[test] -fn send_para_a_local_asset_to_para_b() { - ExtBuilder::default().build().execute_with(|| { - MockNet::reset(); - - let asset_id = parachain::LocalAssetIdCreator::create_asset_id_from_metadata(0); - let para_a_local_asset = MultiLocation::new( - 1, - X3(Parachain(1), PalletInstance(11u8), GeneralIndex(asset_id)), - ); - let source_location = parachain::AssetType::Xcm(para_a_local_asset); - let source_id: parachain::AssetId = source_location.clone().into(); - - let asset_metadata = parachain::AssetMetadata { - name: b"ParaALocalAsset".to_vec(), - symbol: b"ParaALocalAsset".to_vec(), - decimals: 12, - }; - - ParaA::execute_with(|| { - assert_ok!(AssetManager::register_local_asset( - parachain::RuntimeOrigin::root(), - PARAALICE.into(), - PARAALICE.into(), - true, - 1 - )); - - assert_ok!(LocalAssets::mint( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - asset_id, - PARAALICE.into(), - 300000000000000 - )); - }); - - ParaB::execute_with(|| { - assert_ok!(AssetManager::register_foreign_asset( - parachain::RuntimeOrigin::root(), - source_location.clone(), - asset_metadata, - 1u128, - true - )); - assert_ok!(AssetManager::set_asset_units_per_second( - parachain::RuntimeOrigin::root(), - source_location, - 0u128, - 0 - )); - }); - - let dest = MultiLocation { - parents: 1, - interior: X2( - Parachain(2), - AccountKey20 { - network: None, - key: PARAALICE.into(), - }, - ), - }; - - ParaA::execute_with(|| { - // free execution, full amount received - assert_ok!(XTokens::transfer( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - parachain::CurrencyId::LocalAssetReserve(asset_id), - 100, - Box::new(VersionedMultiLocation::V3(dest)), - WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) - )); - }); - - ParaB::execute_with(|| { - // free execution, full amount received - assert_eq!(Assets::balance(source_id, &PARAALICE.into()), 100); - }); - }); -} - -#[test] -fn send_para_a_local_asset_to_para_b_and_send_it_back_together_with_some_dev() { - ExtBuilder::default().build().execute_with(|| { - MockNet::reset(); - - let asset_id = parachain::LocalAssetIdCreator::create_asset_id_from_metadata(0); - let para_a_local_asset = MultiLocation::new( - 1, - X3(Parachain(1), PalletInstance(11u8), GeneralIndex(asset_id)), - ); - let source_location_local_asset = parachain::AssetType::Xcm(para_a_local_asset); - let source_id_local_asset: parachain::AssetId = source_location_local_asset.clone().into(); - - let asset_metadata_local_asset = parachain::AssetMetadata { - name: b"ParaALocalAsset".to_vec(), - symbol: b"ParaALocalAsset".to_vec(), - decimals: 12, - }; - - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location_balances = parachain::AssetType::Xcm(para_a_balances); - let source_id_balances: parachain::AssetId = source_location_balances.clone().into(); - - let asset_metadata_balances = parachain::AssetMetadata { - name: b"ParaAToken".to_vec(), - symbol: b"ParaA".to_vec(), - decimals: 18, - }; - - ParaB::execute_with(|| { - assert_ok!(AssetManager::register_foreign_asset( - parachain::RuntimeOrigin::root(), - source_location_local_asset.clone(), - asset_metadata_local_asset, - 1u128, - true - )); - assert_ok!(AssetManager::set_asset_units_per_second( - parachain::RuntimeOrigin::root(), - source_location_local_asset, - 0u128, - 0 - )); - - assert_ok!(AssetManager::register_foreign_asset( - parachain::RuntimeOrigin::root(), - source_location_balances.clone(), - asset_metadata_balances, - 1u128, - true - )); - assert_ok!(AssetManager::set_asset_units_per_second( - parachain::RuntimeOrigin::root(), - source_location_balances, - 0u128, - 1 - )); - }); - - ParaA::execute_with(|| { - assert_ok!(AssetManager::register_local_asset( - parachain::RuntimeOrigin::root(), - PARAALICE.into(), - PARAALICE.into(), - true, - 1 - )); - - assert_ok!(LocalAssets::mint( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - asset_id, - PARAALICE.into(), - 300000000000000 - )); - }); - - let dest = MultiLocation { - parents: 1, - interior: X2( - Parachain(2), - AccountKey20 { - network: None, - key: PARAALICE.into(), - }, - ), - }; - - ParaA::execute_with(|| { - // free execution, full amount received - assert_ok!(XTokens::transfer_multicurrencies( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - vec![ - (parachain::CurrencyId::LocalAssetReserve(asset_id), 100), - (parachain::CurrencyId::SelfReserve, 1000000) - ], - 0, - Box::new(VersionedMultiLocation::V3(dest)), - WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) - )); - }); - - let mut alith_balance_asset_before = 0; - let mut alith_balance_native_token_before = 0; - - ParaA::execute_with(|| { - alith_balance_asset_before = LocalAssets::balance(asset_id, &PARAALICE.into()); - alith_balance_native_token_before = Balances::free_balance(&PARAALICE.into()); - }); - - let new_dest = MultiLocation { - parents: 1, - interior: X2( - Parachain(1), - AccountKey20 { - network: None, - key: PARAALICE.into(), - }, - ), - }; - - ParaB::execute_with(|| { - // free execution, full amount received - assert_eq!( - Assets::balance(source_id_local_asset, &PARAALICE.into()), - 100 - ); - assert_eq!( - Assets::balance(source_id_balances, &PARAALICE.into()), - 1000000 - ); - - // free execution, full amount received - assert_ok!(XTokens::transfer_multicurrencies( - parachain::RuntimeOrigin::signed(PARAALICE.into()), - vec![ - (parachain::CurrencyId::ForeignAsset(source_id_balances), 4), - ( - parachain::CurrencyId::ForeignAsset(source_id_local_asset), - 50 - ) - ], - 0, - Box::new(VersionedMultiLocation::V3(new_dest)), - WeightLimit::Limited(Weight::from_parts(4u64, DEFAULT_PROOF_SIZE)) - )); - }); - - ParaA::execute_with(|| { - let alith_balance_asset_after = LocalAssets::balance(asset_id, &PARAALICE.into()); - let alith_balance_native_token_after = Balances::free_balance(&PARAALICE.into()); - assert_eq!(alith_balance_asset_after, alith_balance_asset_before + 50); - assert_eq!( - alith_balance_native_token_before, - alith_balance_native_token_after - ); - }); - }); -} - #[test] fn send_statemint_asset_from_para_a_to_statemine_with_relay_fee() { MockNet::reset(); diff --git a/test/.gitignore b/test/.gitignore index 04577b58da..3122718739 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -4,6 +4,7 @@ tmp/* *.zip moonbeam +!suites/dev/moonbeam polkadot *spec.json diff --git a/test/moonwall.config.json b/test/moonwall.config.json index b33fdfa26c..039f374c4f 100644 --- a/test/moonwall.config.json +++ b/test/moonwall.config.json @@ -364,9 +364,51 @@ } ] }, + { + "name": "dev_moonbeam", + "testFileDir": ["suites/dev/moonbeam"], + "include": ["**/*test*"], + "timeout": 180000, + "contracts": "contracts/", + "runScripts": [ + "compile-contracts.ts compile", + "compile-wasm.ts compile -b ../target/release/moonbeam -o wasm -c moonbeam-dev" + ], + "multiThreads": 8, + "envVars": ["DEBUG_COLORS=1"], + "reporters": ["basic", "html", "json"], + "reportFile": { + "json": "./tmp/testResults.json" + }, + "foundation": { + "type": "dev", + "launchSpec": [ + { + "name": "moonbeam", + "binPath": "../target/release/moonbeam", + "newRpcBehaviour": true, + "options": [ + "--ethapi=txpool", + "--no-hardware-benchmarks", + "--no-telemetry", + "--wasmtime-precompiled=wasm", + "--reserved-only", + "--no-grandpa", + "--no-prometheus", + "--force-authoring", + "--rpc-cors=all", + "--alice", + "--chain=moonbeam-dev", + "--sealing=manual", + "--tmp" + ] + } + ] + } + }, { "name": "dev_moonbase", - "testFileDir": ["suites/dev/"], + "testFileDir": ["suites/dev/moonbase"], "include": ["**/*test*"], "timeout": 180000, "contracts": "contracts/", @@ -451,6 +493,7 @@ "testFileDir": ["suites/dev/"], "contracts": "contracts/", "runScripts": ["compile-contracts.ts compile"], + "envVars": ["DEBUG_COLORS=1"], "foundation": { "type": "dev", "launchSpec": [ diff --git a/test/scripts/combine-imports.ts b/test/scripts/combine-imports.ts index b6e020494f..4728ba91f7 100644 --- a/test/scripts/combine-imports.ts +++ b/test/scripts/combine-imports.ts @@ -20,7 +20,7 @@ const processFile = async (filePath: string): Promise => { } if (allImports.length > 0) { - const combinedImport = `import { ${allImports.join(", ")} } from "../../../helpers";\n`; + const combinedImport = `import { ${allImports.join(", ")} } from "../../../../helpers";\n`; let updatedContent = content.slice(0, firstMatchIndex) + diff --git a/test/suites/dev/archive/archive-length-fees.ts b/test/suites/dev/moonbase/archive/archive-length-fees.ts similarity index 100% rename from test/suites/dev/archive/archive-length-fees.ts rename to test/suites/dev/moonbase/archive/archive-length-fees.ts diff --git a/test/suites/dev/archive/archive-precompile-dispatch.ts b/test/suites/dev/moonbase/archive/archive-precompile-dispatch.ts similarity index 100% rename from test/suites/dev/archive/archive-precompile-dispatch.ts rename to test/suites/dev/moonbase/archive/archive-precompile-dispatch.ts diff --git a/test/suites/dev/archive/archive-precompile-xcm-utils.ts b/test/suites/dev/moonbase/archive/archive-precompile-xcm-utils.ts similarity index 100% rename from test/suites/dev/archive/archive-precompile-xcm-utils.ts rename to test/suites/dev/moonbase/archive/archive-precompile-xcm-utils.ts diff --git a/test/suites/dev/sample/sample_basic.ts b/test/suites/dev/moonbase/sample/sample_basic.ts similarity index 100% rename from test/suites/dev/sample/sample_basic.ts rename to test/suites/dev/moonbase/sample/sample_basic.ts diff --git a/test/suites/dev/test-assets/test-assets-destroy.ts b/test/suites/dev/moonbase/test-assets/test-assets-destroy.ts similarity index 97% rename from test/suites/dev/test-assets/test-assets-destroy.ts rename to test/suites/dev/moonbase/test-assets/test-assets-destroy.ts index d5550f6e1f..2c11f09565 100644 --- a/test/suites/dev/test-assets/test-assets-destroy.ts +++ b/test/suites/dev/moonbase/test-assets/test-assets-destroy.ts @@ -4,7 +4,7 @@ import { ALITH_ADDRESS, BALTATHAR_ADDRESS, alith, baltathar } from "@moonwall/ut import { ApiPromise } from "@polkadot/api"; import { u128 } from "@polkadot/types"; import type { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; -import { expectOk, mockAssetBalance } from "../../../helpers"; +import { expectOk, mockAssetBalance } from "../../../../helpers"; const ARBITRARY_ASSET_ID = 42259045809535163221576417993425387648n; diff --git a/test/suites/dev/test-assets/test-assets-drain-asset.ts b/test/suites/dev/moonbase/test-assets/test-assets-drain-asset.ts similarity index 98% rename from test/suites/dev/test-assets/test-assets-drain-asset.ts rename to test/suites/dev/moonbase/test-assets/test-assets-drain-asset.ts index 5ad4294794..6b6c865adc 100644 --- a/test/suites/dev/test-assets/test-assets-drain-asset.ts +++ b/test/suites/dev/moonbase/test-assets/test-assets-drain-asset.ts @@ -5,7 +5,7 @@ import { ApiPromise } from "@polkadot/api"; import { u128 } from "@polkadot/types"; import type { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; import { BN } from "@polkadot/util"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; const ARBITRARY_ASSET_ID = 42259045809535163221576417993425387648n; const ARBITRARY_TRANSFER_AMOUNT = 10000000000000n; diff --git a/test/suites/dev/test-assets/test-assets-drain-both.ts b/test/suites/dev/moonbase/test-assets/test-assets-drain-both.ts similarity index 98% rename from test/suites/dev/test-assets/test-assets-drain-both.ts rename to test/suites/dev/moonbase/test-assets/test-assets-drain-both.ts index 00134dc318..7819e19807 100644 --- a/test/suites/dev/test-assets/test-assets-drain-both.ts +++ b/test/suites/dev/moonbase/test-assets/test-assets-drain-both.ts @@ -5,7 +5,7 @@ import { ApiPromise } from "@polkadot/api"; import { u128 } from "@polkadot/types"; import type { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; import { BN } from "@polkadot/util"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; const ARBITRARY_ASSET_ID = 42259045809535163221576417993425387648n; const ARBITRARY_TRANSFER_AMOUNT = 10000000000000n; diff --git a/test/suites/dev/test-assets/test-assets-insufficients.ts b/test/suites/dev/moonbase/test-assets/test-assets-insufficients.ts similarity index 98% rename from test/suites/dev/test-assets/test-assets-insufficients.ts rename to test/suites/dev/moonbase/test-assets/test-assets-insufficients.ts index eefbe978cb..5c687c0dfa 100644 --- a/test/suites/dev/test-assets/test-assets-insufficients.ts +++ b/test/suites/dev/moonbase/test-assets/test-assets-insufficients.ts @@ -5,7 +5,7 @@ import { ApiPromise } from "@polkadot/api"; import { u128 } from "@polkadot/types"; import type { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; import { BN } from "@polkadot/util"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; const ARBITRARY_ASSET_ID = 42259045809535163221576417993425387648n; const ARBITRARY_TRANSFER_AMOUNT = 10000000000000n; diff --git a/test/suites/dev/test-assets/test-assets-transfer.ts b/test/suites/dev/moonbase/test-assets/test-assets-transfer.ts similarity index 97% rename from test/suites/dev/test-assets/test-assets-transfer.ts rename to test/suites/dev/moonbase/test-assets/test-assets-transfer.ts index d2c5d99da0..d212689094 100644 --- a/test/suites/dev/test-assets/test-assets-transfer.ts +++ b/test/suites/dev/moonbase/test-assets/test-assets-transfer.ts @@ -5,7 +5,7 @@ import "@polkadot/api-augment"; import { u128 } from "@polkadot/types"; import { ApiPromise } from "@polkadot/api"; import type { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; const ARBITRARY_ASSET_ID = 42259045809535163221576417993425387648n; diff --git a/test/suites/dev/test-assets/test-change-existing-asset.ts b/test/suites/dev/moonbase/test-assets/test-change-existing-asset.ts similarity index 98% rename from test/suites/dev/test-assets/test-change-existing-asset.ts rename to test/suites/dev/moonbase/test-assets/test-change-existing-asset.ts index 8517fa633c..96a72995da 100644 --- a/test/suites/dev/test-assets/test-change-existing-asset.ts +++ b/test/suites/dev/moonbase/test-assets/test-change-existing-asset.ts @@ -8,7 +8,7 @@ import { registerForeignAsset, relayAssetMetadata, verifyLatestBlockFees, -} from "../../../helpers"; +} from "../../../../helpers"; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ diff --git a/test/suites/dev/test-assets/test-destroy-foreign-asset.ts b/test/suites/dev/moonbase/test-assets/test-destroy-foreign-asset.ts similarity index 98% rename from test/suites/dev/test-assets/test-destroy-foreign-asset.ts rename to test/suites/dev/moonbase/test-assets/test-destroy-foreign-asset.ts index 02eb5d2456..412745eff2 100644 --- a/test/suites/dev/test-assets/test-destroy-foreign-asset.ts +++ b/test/suites/dev/moonbase/test-assets/test-destroy-foreign-asset.ts @@ -7,7 +7,7 @@ import { registerForeignAsset, relayAssetMetadata, verifyLatestBlockFees, -} from "../../../helpers"; +} from "../../../../helpers"; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; diff --git a/test/suites/dev/test-assets/test-foreign-asset.ts b/test/suites/dev/moonbase/test-assets/test-foreign-asset.ts similarity index 97% rename from test/suites/dev/test-assets/test-foreign-asset.ts rename to test/suites/dev/moonbase/test-assets/test-foreign-asset.ts index fe626e2897..d626fefbf8 100644 --- a/test/suites/dev/test-assets/test-foreign-asset.ts +++ b/test/suites/dev/moonbase/test-assets/test-foreign-asset.ts @@ -5,7 +5,7 @@ import { relayAssetMetadata, registerForeignAsset, verifyLatestBlockFees, -} from "../../../helpers"; +} from "../../../../helpers"; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; diff --git a/test/suites/dev/test-assets/test-remove-asset.ts b/test/suites/dev/moonbase/test-assets/test-remove-asset.ts similarity index 98% rename from test/suites/dev/test-assets/test-remove-asset.ts rename to test/suites/dev/moonbase/test-assets/test-remove-asset.ts index 6b0ad18866..adf7a6ecb6 100644 --- a/test/suites/dev/test-assets/test-remove-asset.ts +++ b/test/suites/dev/moonbase/test-assets/test-remove-asset.ts @@ -63,4 +63,4 @@ import { relayAssetMetadata, registerForeignAsset, verifyLatestBlockFees, -} from "../../../helpers"; +} from "../../../../helpers"; diff --git a/test/suites/dev/test-author/test-author-double-registration.ts b/test/suites/dev/moonbase/test-author/test-author-double-registration.ts similarity index 98% rename from test/suites/dev/test-author/test-author-double-registration.ts rename to test/suites/dev/moonbase/test-author/test-author-double-registration.ts index 5bff033a68..07f78f5a9f 100644 --- a/test/suites/dev/test-author/test-author-double-registration.ts +++ b/test/suites/dev/moonbase/test-author/test-author-double-registration.ts @@ -9,7 +9,7 @@ import { DEFAULT_GENESIS_MAPPING, } from "@moonwall/util"; import { ApiPromise } from "@polkadot/api"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; describeSuite({ id: "D0201", diff --git a/test/suites/dev/test-author/test-author-failed-association.ts b/test/suites/dev/moonbase/test-author/test-author-failed-association.ts similarity index 98% rename from test/suites/dev/test-author/test-author-failed-association.ts rename to test/suites/dev/moonbase/test-author/test-author-failed-association.ts index 248d659cfe..53444b572f 100644 --- a/test/suites/dev/test-author/test-author-failed-association.ts +++ b/test/suites/dev/moonbase/test-author/test-author-failed-association.ts @@ -8,7 +8,7 @@ import { baltathar, } from "@moonwall/util"; import { ApiPromise } from "@polkadot/api"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; describeSuite({ id: "D0202", diff --git a/test/suites/dev/test-author/test-author-first-time-keys.ts b/test/suites/dev/moonbase/test-author/test-author-first-time-keys.ts similarity index 100% rename from test/suites/dev/test-author/test-author-first-time-keys.ts rename to test/suites/dev/moonbase/test-author/test-author-first-time-keys.ts diff --git a/test/suites/dev/test-author/test-author-missing-deposit-fail.ts b/test/suites/dev/moonbase/test-author/test-author-missing-deposit-fail.ts similarity index 98% rename from test/suites/dev/test-author/test-author-missing-deposit-fail.ts rename to test/suites/dev/moonbase/test-author/test-author-missing-deposit-fail.ts index 6f1f28f2ab..a15be78673 100644 --- a/test/suites/dev/test-author/test-author-missing-deposit-fail.ts +++ b/test/suites/dev/moonbase/test-author/test-author-missing-deposit-fail.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { BALTATHAR_SESSION_ADDRESS, generateKeyringPair } from "@moonwall/util"; import { expect, describeSuite, beforeAll } from "@moonwall/cli"; import { ApiPromise } from "@polkadot/api"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; describeSuite({ id: "D0204", diff --git a/test/suites/dev/test-author/test-author-non-author-clearing.ts b/test/suites/dev/moonbase/test-author/test-author-non-author-clearing.ts similarity index 95% rename from test/suites/dev/test-author/test-author-non-author-clearing.ts rename to test/suites/dev/moonbase/test-author/test-author-non-author-clearing.ts index aef01b11d4..8fd18ae875 100644 --- a/test/suites/dev/test-author/test-author-non-author-clearing.ts +++ b/test/suites/dev/moonbase/test-author/test-author-non-author-clearing.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, baltathar, BALTATHAR_SESSION_ADDRESS } from "@moonwall/util"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; describeSuite({ id: "D0205", diff --git a/test/suites/dev/test-author/test-author-non-author-rotate.ts b/test/suites/dev/moonbase/test-author/test-author-non-author-rotate.ts similarity index 96% rename from test/suites/dev/test-author/test-author-non-author-rotate.ts rename to test/suites/dev/moonbase/test-author/test-author-non-author-rotate.ts index d24792e4dc..7b20ec691b 100644 --- a/test/suites/dev/test-author/test-author-non-author-rotate.ts +++ b/test/suites/dev/moonbase/test-author/test-author-non-author-rotate.ts @@ -7,7 +7,7 @@ import { CHARLETH_SESSION_ADDRESS, } from "@moonwall/util"; import { ApiPromise } from "@polkadot/api"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; describeSuite({ id: "D0206", diff --git a/test/suites/dev/test-author/test-author-registered-clear.ts b/test/suites/dev/moonbase/test-author/test-author-registered-clear.ts similarity index 96% rename from test/suites/dev/test-author/test-author-registered-clear.ts rename to test/suites/dev/moonbase/test-author/test-author-registered-clear.ts index f16e195ac5..9ab575349f 100644 --- a/test/suites/dev/test-author/test-author-registered-clear.ts +++ b/test/suites/dev/moonbase/test-author/test-author-registered-clear.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { alith, ALITH_ADDRESS, BALTATHAR_SESSION_ADDRESS } from "@moonwall/util"; import { expect, describeSuite } from "@moonwall/cli"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; describeSuite({ id: "D0207", diff --git a/test/suites/dev/test-author/test-author-registered-rotation.ts b/test/suites/dev/moonbase/test-author/test-author-registered-rotation.ts similarity index 95% rename from test/suites/dev/test-author/test-author-registered-rotation.ts rename to test/suites/dev/moonbase/test-author/test-author-registered-rotation.ts index 7de6311d03..0d4d09b2cf 100644 --- a/test/suites/dev/test-author/test-author-registered-rotation.ts +++ b/test/suites/dev/moonbase/test-author/test-author-registered-rotation.ts @@ -1,6 +1,6 @@ import "@moonbeam-network/api-augment"; import { ALITH_ADDRESS, BALTATHAR_SESSION_ADDRESS, CHARLETH_SESSION_ADDRESS } from "@moonwall/util"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; import { expect, describeSuite } from "@moonwall/cli"; describeSuite({ diff --git a/test/suites/dev/test-author/test-author-removing-author.ts b/test/suites/dev/moonbase/test-author/test-author-removing-author.ts similarity index 100% rename from test/suites/dev/test-author/test-author-removing-author.ts rename to test/suites/dev/moonbase/test-author/test-author-removing-author.ts diff --git a/test/suites/dev/test-author/test-author-removing-keys.ts b/test/suites/dev/moonbase/test-author/test-author-removing-keys.ts similarity index 100% rename from test/suites/dev/test-author/test-author-removing-keys.ts rename to test/suites/dev/moonbase/test-author/test-author-removing-keys.ts diff --git a/test/suites/dev/test-author/test-author-same-key-rotation.ts b/test/suites/dev/moonbase/test-author/test-author-same-key-rotation.ts similarity index 100% rename from test/suites/dev/test-author/test-author-same-key-rotation.ts rename to test/suites/dev/moonbase/test-author/test-author-same-key-rotation.ts diff --git a/test/suites/dev/test-author/test-author-simple-association.ts b/test/suites/dev/moonbase/test-author/test-author-simple-association.ts similarity index 97% rename from test/suites/dev/test-author/test-author-simple-association.ts rename to test/suites/dev/moonbase/test-author/test-author-simple-association.ts index df353b397f..c28c0d2732 100644 --- a/test/suites/dev/test-author/test-author-simple-association.ts +++ b/test/suites/dev/moonbase/test-author/test-author-simple-association.ts @@ -9,7 +9,7 @@ import { } from "@moonwall/util"; import { expect, describeSuite } from "@moonwall/cli"; import { ApiPromise } from "@polkadot/api"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; describeSuite({ id: "D0212", diff --git a/test/suites/dev/test-author/test-author-unregistered-clear.ts b/test/suites/dev/moonbase/test-author/test-author-unregistered-clear.ts similarity index 95% rename from test/suites/dev/test-author/test-author-unregistered-clear.ts rename to test/suites/dev/moonbase/test-author/test-author-unregistered-clear.ts index cad5489dc7..535abdd948 100644 --- a/test/suites/dev/test-author/test-author-unregistered-clear.ts +++ b/test/suites/dev/moonbase/test-author/test-author-unregistered-clear.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { BALTATHAR_SESSION_ADDRESS } from "@moonwall/util"; import { expect, describeSuite } from "@moonwall/cli"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; describeSuite({ id: "D0213", diff --git a/test/suites/dev/test-author/test-author-unregistered-rotation.ts b/test/suites/dev/moonbase/test-author/test-author-unregistered-rotation.ts similarity index 94% rename from test/suites/dev/test-author/test-author-unregistered-rotation.ts rename to test/suites/dev/moonbase/test-author/test-author-unregistered-rotation.ts index 029f5ec8cb..23c1dfeca4 100644 --- a/test/suites/dev/test-author/test-author-unregistered-rotation.ts +++ b/test/suites/dev/moonbase/test-author/test-author-unregistered-rotation.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { BALTATHAR_SESSION_ADDRESS, CHARLETH_SESSION_ADDRESS, alith } from "@moonwall/util"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; describeSuite({ id: "D0214", diff --git a/test/suites/dev/test-author/test-author-update-diff-keys.ts b/test/suites/dev/moonbase/test-author/test-author-update-diff-keys.ts similarity index 100% rename from test/suites/dev/test-author/test-author-update-diff-keys.ts rename to test/suites/dev/moonbase/test-author/test-author-update-diff-keys.ts diff --git a/test/suites/dev/test-author/test-author-update-nimbus-key.ts b/test/suites/dev/moonbase/test-author/test-author-update-nimbus-key.ts similarity index 100% rename from test/suites/dev/test-author/test-author-update-nimbus-key.ts rename to test/suites/dev/moonbase/test-author/test-author-update-nimbus-key.ts diff --git a/test/suites/dev/test-balance/test-balance-existential.ts b/test/suites/dev/moonbase/test-balance/test-balance-existential.ts similarity index 100% rename from test/suites/dev/test-balance/test-balance-existential.ts rename to test/suites/dev/moonbase/test-balance/test-balance-existential.ts diff --git a/test/suites/dev/test-balance/test-balance-extrinsics.ts b/test/suites/dev/moonbase/test-balance/test-balance-extrinsics.ts similarity index 100% rename from test/suites/dev/test-balance/test-balance-extrinsics.ts rename to test/suites/dev/moonbase/test-balance/test-balance-extrinsics.ts diff --git a/test/suites/dev/test-balance/test-balance-genesis.ts b/test/suites/dev/moonbase/test-balance/test-balance-genesis.ts similarity index 93% rename from test/suites/dev/test-balance/test-balance-genesis.ts rename to test/suites/dev/moonbase/test-balance/test-balance-genesis.ts index 2079fc0563..176d8b2391 100644 --- a/test/suites/dev/test-balance/test-balance-genesis.ts +++ b/test/suites/dev/moonbase/test-balance/test-balance-genesis.ts @@ -5,7 +5,7 @@ import { ALITH_GENESIS_FREE_BALANCE, ALITH_GENESIS_RESERVE_BALANCE, } from "@moonwall/util"; -import { ALITH_GENESIS_TRANSFERABLE_BALANCE } from "../../../helpers"; +import { ALITH_GENESIS_TRANSFERABLE_BALANCE } from "../../../../helpers"; describeSuite({ id: "D0303", diff --git a/test/suites/dev/test-balance/test-balance-reducible.ts b/test/suites/dev/moonbase/test-balance/test-balance-reducible.ts similarity index 100% rename from test/suites/dev/test-balance/test-balance-reducible.ts rename to test/suites/dev/moonbase/test-balance/test-balance-reducible.ts diff --git a/test/suites/dev/test-balance/test-balance-transfer-txwrapper-substrate.ts b/test/suites/dev/moonbase/test-balance/test-balance-transfer-txwrapper-substrate.ts similarity index 98% rename from test/suites/dev/test-balance/test-balance-transfer-txwrapper-substrate.ts rename to test/suites/dev/moonbase/test-balance/test-balance-transfer-txwrapper-substrate.ts index 584a57fd09..0671fc193c 100644 --- a/test/suites/dev/test-balance/test-balance-transfer-txwrapper-substrate.ts +++ b/test/suites/dev/moonbase/test-balance/test-balance-transfer-txwrapper-substrate.ts @@ -8,7 +8,7 @@ import { createSignedTx, createSigningPayload } from "@substrate/txwrapper-core/ import { getRegistryBase } from "@substrate/txwrapper-core/lib/core/metadata"; import { methods as substrateMethods } from "@substrate/txwrapper-substrate"; import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; -import { verifyLatestBlockFees, signWith } from "../../../helpers"; +import { verifyLatestBlockFees, signWith } from "../../../../helpers"; describeSuite({ id: "D0305", diff --git a/test/suites/dev/test-balance/test-balance-transfer.ts b/test/suites/dev/moonbase/test-balance/test-balance-transfer.ts similarity index 99% rename from test/suites/dev/test-balance/test-balance-transfer.ts rename to test/suites/dev/moonbase/test-balance/test-balance-transfer.ts index e560348620..1c3912d409 100644 --- a/test/suites/dev/test-balance/test-balance-transfer.ts +++ b/test/suites/dev/moonbase/test-balance/test-balance-transfer.ts @@ -14,7 +14,7 @@ import { generateKeyringPair, sendRawTransaction, } from "@moonwall/util"; -import { ALITH_GENESIS_TRANSFERABLE_BALANCE, verifyLatestBlockFees } from "../../../helpers"; +import { ALITH_GENESIS_TRANSFERABLE_BALANCE, verifyLatestBlockFees } from "../../../../helpers"; import { parseGwei } from "viem"; diff --git a/test/suites/dev/test-balance/test-balance-transferable.ts b/test/suites/dev/moonbase/test-balance/test-balance-transferable.ts similarity index 98% rename from test/suites/dev/test-balance/test-balance-transferable.ts rename to test/suites/dev/moonbase/test-balance/test-balance-transferable.ts index 9911795b6d..770d1d7a72 100644 --- a/test/suites/dev/test-balance/test-balance-transferable.ts +++ b/test/suites/dev/moonbase/test-balance/test-balance-transferable.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, GLMR, baltathar, checkBalance, generateKeyringPair } from "@moonwall/util"; -import { createProposal } from "../../../helpers/voting.ts"; +import { createProposal } from "../../../../helpers/voting.ts"; describeSuite({ id: "D4005", diff --git a/test/suites/dev/test-block/test-block-1.ts b/test/suites/dev/moonbase/test-block/test-block-1.ts similarity index 100% rename from test/suites/dev/test-block/test-block-1.ts rename to test/suites/dev/moonbase/test-block/test-block-1.ts diff --git a/test/suites/dev/test-block/test-block-2.ts b/test/suites/dev/moonbase/test-block/test-block-2.ts similarity index 100% rename from test/suites/dev/test-block/test-block-2.ts rename to test/suites/dev/moonbase/test-block/test-block-2.ts diff --git a/test/suites/dev/test-block/test-block-gas.ts b/test/suites/dev/moonbase/test-block/test-block-gas.ts similarity index 100% rename from test/suites/dev/test-block/test-block-gas.ts rename to test/suites/dev/moonbase/test-block/test-block-gas.ts diff --git a/test/suites/dev/test-block/test-block-genesis.ts b/test/suites/dev/moonbase/test-block/test-block-genesis.ts similarity index 100% rename from test/suites/dev/test-block/test-block-genesis.ts rename to test/suites/dev/moonbase/test-block/test-block-genesis.ts diff --git a/test/suites/dev/test-block/test-block-mocked-relay.ts b/test/suites/dev/moonbase/test-block/test-block-mocked-relay.ts similarity index 100% rename from test/suites/dev/test-block/test-block-mocked-relay.ts rename to test/suites/dev/moonbase/test-block/test-block-mocked-relay.ts diff --git a/test/suites/dev/test-chain/test-fork-chain.ts b/test/suites/dev/moonbase/test-chain/test-fork-chain.ts similarity index 100% rename from test/suites/dev/test-chain/test-fork-chain.ts rename to test/suites/dev/moonbase/test-chain/test-fork-chain.ts diff --git a/test/suites/dev/test-contract/test-contract-creation.ts b/test/suites/dev/moonbase/test-contract/test-contract-creation.ts similarity index 98% rename from test/suites/dev/test-contract/test-contract-creation.ts rename to test/suites/dev/moonbase/test-contract/test-contract-creation.ts index 35bd541f3a..2ebd73922c 100644 --- a/test/suites/dev/test-contract/test-contract-creation.ts +++ b/test/suites/dev/moonbase/test-contract/test-contract-creation.ts @@ -9,7 +9,7 @@ import { import { ALITH_ADDRESS } from "@moonwall/util"; import { hexToU8a } from "@polkadot/util"; import { encodeDeployData, keccak256, numberToHex, toRlp } from "viem"; -import { verifyLatestBlockFees } from "../../../helpers"; +import { verifyLatestBlockFees } from "../../../../helpers"; // TODO: expand these tests to do multiple txn types when added to viem describeSuite({ diff --git a/test/suites/dev/test-contract/test-contract-delegate-call.ts b/test/suites/dev/moonbase/test-contract/test-contract-delegate-call.ts similarity index 100% rename from test/suites/dev/test-contract/test-contract-delegate-call.ts rename to test/suites/dev/moonbase/test-contract/test-contract-delegate-call.ts diff --git a/test/suites/dev/test-contract/test-contract-error.ts b/test/suites/dev/moonbase/test-contract/test-contract-error.ts similarity index 97% rename from test/suites/dev/test-contract/test-contract-error.ts rename to test/suites/dev/moonbase/test-contract/test-contract-error.ts index 10ae7c3cff..37f4ee695e 100644 --- a/test/suites/dev/test-contract/test-contract-error.ts +++ b/test/suites/dev/moonbase/test-contract/test-contract-error.ts @@ -8,7 +8,7 @@ import { } from "@moonwall/cli"; import { ALITH_ADDRESS, createEthersTransaction } from "@moonwall/util"; import { encodeFunctionData, Abi } from "viem"; -import { verifyLatestBlockFees } from "../../../helpers"; +import { verifyLatestBlockFees } from "../../../../helpers"; // TODO: expand these tests to do multiple txn types when added to viem describeSuite({ diff --git a/test/suites/dev/test-contract/test-contract-event.ts b/test/suites/dev/moonbase/test-contract/test-contract-event.ts similarity index 100% rename from test/suites/dev/test-contract/test-contract-event.ts rename to test/suites/dev/moonbase/test-contract/test-contract-event.ts diff --git a/test/suites/dev/test-contract/test-contract-evm-limits.ts b/test/suites/dev/moonbase/test-contract/test-contract-evm-limits.ts similarity index 100% rename from test/suites/dev/test-contract/test-contract-evm-limits.ts rename to test/suites/dev/moonbase/test-contract/test-contract-evm-limits.ts diff --git a/test/suites/dev/test-contract/test-contract-fibonacci.ts b/test/suites/dev/moonbase/test-contract/test-contract-fibonacci.ts similarity index 100% rename from test/suites/dev/test-contract/test-contract-fibonacci.ts rename to test/suites/dev/moonbase/test-contract/test-contract-fibonacci.ts diff --git a/test/suites/dev/test-contract/test-contract-incr-loop.ts b/test/suites/dev/moonbase/test-contract/test-contract-incr-loop.ts similarity index 97% rename from test/suites/dev/test-contract/test-contract-incr-loop.ts rename to test/suites/dev/moonbase/test-contract/test-contract-incr-loop.ts index 6e2ddbb27e..44daed770a 100644 --- a/test/suites/dev/test-contract/test-contract-incr-loop.ts +++ b/test/suites/dev/moonbase/test-contract/test-contract-incr-loop.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeEach, describeSuite, expect, fetchCompiledContract } from "@moonwall/cli"; import { encodeFunctionData } from "viem"; -import { verifyLatestBlockFees } from "../../../helpers"; +import { verifyLatestBlockFees } from "../../../../helpers"; describeSuite({ id: "D0607", diff --git a/test/suites/dev/test-contract/test-contract-loop-cost.ts b/test/suites/dev/moonbase/test-contract/test-contract-loop-cost.ts similarity index 100% rename from test/suites/dev/test-contract/test-contract-loop-cost.ts rename to test/suites/dev/moonbase/test-contract/test-contract-loop-cost.ts diff --git a/test/suites/dev/test-contract/test-contract-methods.ts b/test/suites/dev/moonbase/test-contract/test-contract-methods.ts similarity index 100% rename from test/suites/dev/test-contract/test-contract-methods.ts rename to test/suites/dev/moonbase/test-contract/test-contract-methods.ts diff --git a/test/suites/dev/test-contract/test-contract-variables.ts b/test/suites/dev/moonbase/test-contract/test-contract-variables.ts similarity index 100% rename from test/suites/dev/test-contract/test-contract-variables.ts rename to test/suites/dev/moonbase/test-contract/test-contract-variables.ts diff --git a/test/suites/dev/test-conviction-voting/test-conviction-batch-delegate-undelegate.ts b/test/suites/dev/moonbase/test-conviction-voting/test-conviction-batch-delegate-undelegate.ts similarity index 99% rename from test/suites/dev/test-conviction-voting/test-conviction-batch-delegate-undelegate.ts rename to test/suites/dev/moonbase/test-conviction-voting/test-conviction-batch-delegate-undelegate.ts index df1ceb5096..c7a33cd80a 100644 --- a/test/suites/dev/test-conviction-voting/test-conviction-batch-delegate-undelegate.ts +++ b/test/suites/dev/moonbase/test-conviction-voting/test-conviction-batch-delegate-undelegate.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { KeyringPair, alith } from "@moonwall/util"; -import { createAccounts, expectSubstrateEvents } from "../../../helpers"; +import { createAccounts, expectSubstrateEvents } from "../../../../helpers"; describeSuite({ id: "D2622", diff --git a/test/suites/dev/test-conviction-voting/test-conviction-delegate-weight-fit.ts b/test/suites/dev/moonbase/test-conviction-voting/test-conviction-delegate-weight-fit.ts similarity index 98% rename from test/suites/dev/test-conviction-voting/test-conviction-delegate-weight-fit.ts rename to test/suites/dev/moonbase/test-conviction-voting/test-conviction-delegate-weight-fit.ts index c188a2feb8..345aa4f2e7 100644 --- a/test/suites/dev/test-conviction-voting/test-conviction-delegate-weight-fit.ts +++ b/test/suites/dev/moonbase/test-conviction-voting/test-conviction-delegate-weight-fit.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { KeyringPair, alith } from "@moonwall/util"; -import { createAccounts, expectSubstrateEvents } from "../../../helpers"; +import { createAccounts, expectSubstrateEvents } from "../../../../helpers"; describeSuite({ id: "D2620", diff --git a/test/suites/dev/test-conviction-voting/test-conviction-delegation-batch.ts b/test/suites/dev/moonbase/test-conviction-voting/test-conviction-delegation-batch.ts similarity index 100% rename from test/suites/dev/test-conviction-voting/test-conviction-delegation-batch.ts rename to test/suites/dev/moonbase/test-conviction-voting/test-conviction-delegation-batch.ts diff --git a/test/suites/dev/test-conviction-voting/test-conviction-delegation.ts b/test/suites/dev/moonbase/test-conviction-voting/test-conviction-delegation.ts similarity index 97% rename from test/suites/dev/test-conviction-voting/test-conviction-delegation.ts rename to test/suites/dev/moonbase/test-conviction-voting/test-conviction-delegation.ts index 555334e389..82152a97f5 100644 --- a/test/suites/dev/test-conviction-voting/test-conviction-delegation.ts +++ b/test/suites/dev/moonbase/test-conviction-voting/test-conviction-delegation.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect, proposeReferendaAndDeposit } from "@moonwall/cli"; import { ALITH_ADDRESS, GLMR, alith, baltathar, faith } from "@moonwall/util"; -import { expectSubstrateEvent } from "../../../helpers"; +import { expectSubstrateEvent } from "../../../../helpers"; describeSuite({ id: "D2600", diff --git a/test/suites/dev/test-conviction-voting/test-conviction-undelegate-weight-fit.ts b/test/suites/dev/moonbase/test-conviction-voting/test-conviction-undelegate-weight-fit.ts similarity index 98% rename from test/suites/dev/test-conviction-voting/test-conviction-undelegate-weight-fit.ts rename to test/suites/dev/moonbase/test-conviction-voting/test-conviction-undelegate-weight-fit.ts index a9286f2447..57855c0ae4 100644 --- a/test/suites/dev/test-conviction-voting/test-conviction-undelegate-weight-fit.ts +++ b/test/suites/dev/moonbase/test-conviction-voting/test-conviction-undelegate-weight-fit.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { KeyringPair, alith } from "@moonwall/util"; -import { createAccounts, chunk, expectSubstrateEvents } from "../../../helpers"; +import { createAccounts, chunk, expectSubstrateEvents } from "../../../../helpers"; describeSuite({ id: "D2621", diff --git a/test/suites/dev/test-conviction-voting/test-delegate.ts b/test/suites/dev/moonbase/test-conviction-voting/test-delegate.ts similarity index 100% rename from test/suites/dev/test-conviction-voting/test-delegate.ts rename to test/suites/dev/moonbase/test-conviction-voting/test-delegate.ts diff --git a/test/suites/dev/test-conviction-voting/test-delegate2.ts b/test/suites/dev/moonbase/test-conviction-voting/test-delegate2.ts similarity index 98% rename from test/suites/dev/test-conviction-voting/test-delegate2.ts rename to test/suites/dev/moonbase/test-conviction-voting/test-delegate2.ts index 9cd42afad4..74679c60ce 100644 --- a/test/suites/dev/test-conviction-voting/test-delegate2.ts +++ b/test/suites/dev/moonbase/test-conviction-voting/test-delegate2.ts @@ -8,7 +8,7 @@ import { alith, generateKeyringPair, } from "@moonwall/util"; -import { chunk } from "../../../helpers"; +import { chunk } from "../../../../helpers"; describeSuite({ id: "D0601-02", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan--proxy-transfer.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan--proxy-transfer.ts similarity index 98% rename from test/suites/dev/test-crowdloan/test-crowdloan--proxy-transfer.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan--proxy-transfer.ts index edb21beeaa..470a7880a3 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan--proxy-transfer.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan--proxy-transfer.ts @@ -5,7 +5,7 @@ import { RELAYCHAIN_ARBITRARY_ADDRESS_1, VESTING_PERIOD, getAccountPayable, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D0701", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-claim-bal.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-claim-bal.ts similarity index 98% rename from test/suites/dev/test-crowdloan/test-crowdloan-claim-bal.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-claim-bal.ts index 0fa9274f7a..6675b0adf9 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-claim-bal.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-claim-bal.ts @@ -6,7 +6,7 @@ import { VESTING_PERIOD, calculate_vested_amount, getAccountPayable, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D0702", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-claim.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-claim.ts similarity index 98% rename from test/suites/dev/test-crowdloan/test-crowdloan-claim.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-claim.ts index eb55464e54..76eee4dbb8 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-claim.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-claim.ts @@ -7,7 +7,7 @@ import { ALITH_GENESIS_TRANSFERABLE_BALANCE, calculate_vested_amount, getAccountPayable, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D0703", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-claim5blocks.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-claim5blocks.ts similarity index 98% rename from test/suites/dev/test-crowdloan/test-crowdloan-claim5blocks.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-claim5blocks.ts index 1f883bc544..ce367c2ab1 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-claim5blocks.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-claim5blocks.ts @@ -6,7 +6,7 @@ import { VESTING_PERIOD, calculate_vested_amount, getAccountPayable, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D0704", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-democracy.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-democracy.ts similarity index 96% rename from test/suites/dev/test-crowdloan/test-crowdloan-democracy.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-democracy.ts index 07073f5c21..239256341f 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-democracy.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-democracy.ts @@ -5,8 +5,8 @@ import { RELAYCHAIN_ARBITRARY_ADDRESS_1, RELAYCHAIN_ARBITRARY_ADDRESS_2, VESTING_PERIOD, -} from "../../../helpers/constants.js"; -import { getAccountPayable } from "../../../helpers"; +} from "../../../../helpers/constants.js"; +import { getAccountPayable } from "../../../../helpers"; describeSuite({ id: "D0705", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-dust.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-dust.ts similarity index 97% rename from test/suites/dev/test-crowdloan/test-crowdloan-dust.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-dust.ts index 31e3057a92..7167670842 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-dust.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-dust.ts @@ -5,7 +5,7 @@ import { RELAYCHAIN_ARBITRARY_ADDRESS_1, RELAYCHAIN_ARBITRARY_ADDRESS_2, VESTING_PERIOD, -} from "../../../helpers/constants.js"; +} from "../../../../helpers/constants.js"; describeSuite({ id: "D0706", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-identity.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-identity.ts similarity index 99% rename from test/suites/dev/test-crowdloan/test-crowdloan-identity.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-identity.ts index 344ba8f581..e7c3be938c 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-identity.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-identity.ts @@ -7,7 +7,7 @@ import { VESTING_PERIOD, calculate_vested_amount, getAccountPayable, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D0707", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-init.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-init.ts similarity index 98% rename from test/suites/dev/test-crowdloan/test-crowdloan-init.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-init.ts index caf3a65ad0..96658935e4 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-init.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-init.ts @@ -6,7 +6,7 @@ import { VESTING_PERIOD, getAccountPayable, verifyLatestBlockFees, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D0708", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-proxy-claim.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-proxy-claim.ts similarity index 98% rename from test/suites/dev/test-crowdloan/test-crowdloan-proxy-claim.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-proxy-claim.ts index fbe3af986c..a279d9b388 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-proxy-claim.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-proxy-claim.ts @@ -6,7 +6,7 @@ import { VESTING_PERIOD, calculate_vested_amount, getAccountPayable, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D0709", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-register-accs.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-register-accs.ts similarity index 97% rename from test/suites/dev/test-crowdloan/test-crowdloan-register-accs.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-register-accs.ts index 197fda37bf..8bc4f232f6 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-register-accs.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-register-accs.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { GLMR, alith } from "@moonwall/util"; import { PrivateKeyAccount, generatePrivateKey, privateKeyToAccount } from "viem/accounts"; -import { VESTING_PERIOD, getAccountPayable } from "../../../helpers"; +import { VESTING_PERIOD, getAccountPayable } from "../../../../helpers"; describeSuite({ id: "D0710", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-register-batch.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-register-batch.ts similarity index 97% rename from test/suites/dev/test-crowdloan/test-crowdloan-register-batch.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-register-batch.ts index 87752d9f0f..b17f1a4db4 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-register-batch.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-register-batch.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { GLMR, alith } from "@moonwall/util"; import { PrivateKeyAccount, generatePrivateKey, privateKeyToAccount } from "viem/accounts"; -import { VESTING_PERIOD, getAccountPayable } from "../../../helpers"; +import { VESTING_PERIOD, getAccountPayable } from "../../../../helpers"; describeSuite({ id: "D0711", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-small-amt.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-small-amt.ts similarity index 98% rename from test/suites/dev/test-crowdloan/test-crowdloan-small-amt.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-small-amt.ts index 887b930945..a035f83a58 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-small-amt.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-small-amt.ts @@ -6,7 +6,7 @@ import { VESTING_PERIOD, calculate_vested_amount, getAccountPayable, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D0712", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-update-address-relay.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-update-address-relay.ts similarity index 97% rename from test/suites/dev/test-crowdloan/test-crowdloan-update-address-relay.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-update-address-relay.ts index 8b272114a2..2abf84f3d0 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-update-address-relay.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-update-address-relay.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { GLMR, generateKeyringPair } from "@moonwall/util"; import { stringToU8a } from "@polkadot/util"; -import { VESTING_PERIOD, getAccountPayable } from "../../../helpers"; +import { VESTING_PERIOD, getAccountPayable } from "../../../../helpers"; describeSuite({ id: "D0713", diff --git a/test/suites/dev/test-crowdloan/test-crowdloan-update-address.ts b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-update-address.ts similarity index 98% rename from test/suites/dev/test-crowdloan/test-crowdloan-update-address.ts rename to test/suites/dev/moonbase/test-crowdloan/test-crowdloan-update-address.ts index 39df0606a7..d1e097e34e 100644 --- a/test/suites/dev/test-crowdloan/test-crowdloan-update-address.ts +++ b/test/suites/dev/moonbase/test-crowdloan/test-crowdloan-update-address.ts @@ -6,7 +6,7 @@ import { VESTING_PERIOD, calculate_vested_amount, getAccountPayable, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D0714", diff --git a/test/suites/dev/test-democracy/test-democracy-instant-fastrack.ts b/test/suites/dev/moonbase/test-democracy/test-democracy-instant-fastrack.ts similarity index 100% rename from test/suites/dev/test-democracy/test-democracy-instant-fastrack.ts rename to test/suites/dev/moonbase/test-democracy/test-democracy-instant-fastrack.ts diff --git a/test/suites/dev/test-democracy/test-democracy-preimage.ts b/test/suites/dev/moonbase/test-democracy/test-democracy-preimage.ts similarity index 100% rename from test/suites/dev/test-democracy/test-democracy-preimage.ts rename to test/suites/dev/moonbase/test-democracy/test-democracy-preimage.ts diff --git a/test/suites/dev/test-democracy/test-democracy-proposal.ts b/test/suites/dev/moonbase/test-democracy/test-democracy-proposal.ts similarity index 100% rename from test/suites/dev/test-democracy/test-democracy-proposal.ts rename to test/suites/dev/moonbase/test-democracy/test-democracy-proposal.ts diff --git a/test/suites/dev/test-democracy/test-democracy-referendum.ts b/test/suites/dev/moonbase/test-democracy/test-democracy-referendum.ts similarity index 100% rename from test/suites/dev/test-democracy/test-democracy-referendum.ts rename to test/suites/dev/moonbase/test-democracy/test-democracy-referendum.ts diff --git a/test/suites/dev/test-democracy/test-referenda-general-admin.ts b/test/suites/dev/moonbase/test-democracy/test-referenda-general-admin.ts similarity index 100% rename from test/suites/dev/test-democracy/test-referenda-general-admin.ts rename to test/suites/dev/moonbase/test-democracy/test-referenda-general-admin.ts diff --git a/test/suites/dev/test-eth-call/test-eth-call-state-override.ts b/test/suites/dev/moonbase/test-eth-call/test-eth-call-state-override.ts similarity index 99% rename from test/suites/dev/test-eth-call/test-eth-call-state-override.ts rename to test/suites/dev/moonbase/test-eth-call/test-eth-call-state-override.ts index cf478996f0..f4fbecbe6b 100644 --- a/test/suites/dev/test-eth-call/test-eth-call-state-override.ts +++ b/test/suites/dev/moonbase/test-eth-call/test-eth-call-state-override.ts @@ -10,7 +10,7 @@ import { import { ALITH_ADDRESS, GLMR, baltathar, createEthersTransaction } from "@moonwall/util"; import { hexToBigInt, nToHex } from "@polkadot/util"; import { encodeFunctionData, encodePacked, keccak256, pad, parseEther, Abi } from "viem"; -import { expectOk } from "../../../helpers"; +import { expectOk } from "../../../../helpers"; describeSuite({ id: "D0901", diff --git a/test/suites/dev/test-eth-fee/test-eth-fee-history.ts b/test/suites/dev/moonbase/test-eth-fee/test-eth-fee-history.ts similarity index 100% rename from test/suites/dev/test-eth-fee/test-eth-fee-history.ts rename to test/suites/dev/moonbase/test-eth-fee/test-eth-fee-history.ts diff --git a/test/suites/dev/test-eth-fee/test-eth-paysFee.ts b/test/suites/dev/moonbase/test-eth-fee/test-eth-paysFee.ts similarity index 100% rename from test/suites/dev/test-eth-fee/test-eth-paysFee.ts rename to test/suites/dev/moonbase/test-eth-fee/test-eth-paysFee.ts diff --git a/test/suites/dev/test-eth-fee/test-eth-txn-weights.ts b/test/suites/dev/moonbase/test-eth-fee/test-eth-txn-weights.ts similarity index 100% rename from test/suites/dev/test-eth-fee/test-eth-txn-weights.ts rename to test/suites/dev/moonbase/test-eth-fee/test-eth-txn-weights.ts diff --git a/test/suites/dev/test-eth-pool/test-eth-pool-discard.ts b/test/suites/dev/moonbase/test-eth-pool/test-eth-pool-discard.ts similarity index 100% rename from test/suites/dev/test-eth-pool/test-eth-pool-discard.ts rename to test/suites/dev/moonbase/test-eth-pool/test-eth-pool-discard.ts diff --git a/test/suites/dev/test-eth-pool/test-eth-pool-error.ts b/test/suites/dev/moonbase/test-eth-pool/test-eth-pool-error.ts similarity index 98% rename from test/suites/dev/test-eth-pool/test-eth-pool-error.ts rename to test/suites/dev/moonbase/test-eth-pool/test-eth-pool-error.ts index 4cb3a21bbb..19d46eeffa 100644 --- a/test/suites/dev/test-eth-pool/test-eth-pool-error.ts +++ b/test/suites/dev/moonbase/test-eth-pool/test-eth-pool-error.ts @@ -13,7 +13,7 @@ import { sendRawTransaction, } from "@moonwall/util"; import { parseGwei } from "viem"; -import { ALITH_GENESIS_TRANSFERABLE_BALANCE } from "../../../helpers"; +import { ALITH_GENESIS_TRANSFERABLE_BALANCE } from "../../../../helpers"; describeSuite({ id: "D1102", diff --git a/test/suites/dev/test-eth-pool/test-eth-pool-multiple.ts b/test/suites/dev/moonbase/test-eth-pool/test-eth-pool-multiple.ts similarity index 100% rename from test/suites/dev/test-eth-pool/test-eth-pool-multiple.ts rename to test/suites/dev/moonbase/test-eth-pool/test-eth-pool-multiple.ts diff --git a/test/suites/dev/test-eth-pool/test-eth-pool-nonce-future.ts b/test/suites/dev/moonbase/test-eth-pool/test-eth-pool-nonce-future.ts similarity index 100% rename from test/suites/dev/test-eth-pool/test-eth-pool-nonce-future.ts rename to test/suites/dev/moonbase/test-eth-pool/test-eth-pool-nonce-future.ts diff --git a/test/suites/dev/test-eth-pool/test-eth-pool-resubmit-txn.ts b/test/suites/dev/moonbase/test-eth-pool/test-eth-pool-resubmit-txn.ts similarity index 100% rename from test/suites/dev/test-eth-pool/test-eth-pool-resubmit-txn.ts rename to test/suites/dev/moonbase/test-eth-pool/test-eth-pool-resubmit-txn.ts diff --git a/test/suites/dev/test-eth-rpc/test-eth-rpc-constants.ts b/test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-constants.ts similarity index 100% rename from test/suites/dev/test-eth-rpc/test-eth-rpc-constants.ts rename to test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-constants.ts diff --git a/test/suites/dev/test-eth-rpc/test-eth-rpc-deprecated.ts b/test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-deprecated.ts similarity index 100% rename from test/suites/dev/test-eth-rpc/test-eth-rpc-deprecated.ts rename to test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-deprecated.ts diff --git a/test/suites/dev/test-eth-rpc/test-eth-rpc-log-filtering.ts b/test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-log-filtering.ts similarity index 100% rename from test/suites/dev/test-eth-rpc/test-eth-rpc-log-filtering.ts rename to test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-log-filtering.ts diff --git a/test/suites/dev/test-eth-rpc/test-eth-rpc-transaction-receipt.ts b/test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-transaction-receipt.ts similarity index 100% rename from test/suites/dev/test-eth-rpc/test-eth-rpc-transaction-receipt.ts rename to test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-transaction-receipt.ts diff --git a/test/suites/dev/test-eth-rpc/test-eth-rpc-tx-index.ts b/test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-tx-index.ts similarity index 100% rename from test/suites/dev/test-eth-rpc/test-eth-rpc-tx-index.ts rename to test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-tx-index.ts diff --git a/test/suites/dev/test-eth-rpc/test-eth-rpc-version.ts b/test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-version.ts similarity index 100% rename from test/suites/dev/test-eth-rpc/test-eth-rpc-version.ts rename to test/suites/dev/moonbase/test-eth-rpc/test-eth-rpc-version.ts diff --git a/test/suites/dev/test-eth-tx/test-eth-tx-size.ts b/test/suites/dev/moonbase/test-eth-tx/test-eth-tx-size.ts similarity index 100% rename from test/suites/dev/test-eth-tx/test-eth-tx-size.ts rename to test/suites/dev/moonbase/test-eth-tx/test-eth-tx-size.ts diff --git a/test/suites/dev/test-eth-tx/test-eth-tx-types.ts b/test/suites/dev/moonbase/test-eth-tx/test-eth-tx-types.ts similarity index 98% rename from test/suites/dev/test-eth-tx/test-eth-tx-types.ts rename to test/suites/dev/moonbase/test-eth-tx/test-eth-tx-types.ts index 2c5090154d..a6c8a6943a 100644 --- a/test/suites/dev/test-eth-tx/test-eth-tx-types.ts +++ b/test/suites/dev/moonbase/test-eth-tx/test-eth-tx-types.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, BALTATHAR_ADDRESS, createEthersTransaction } from "@moonwall/util"; import { EthereumTransactionTransactionV2 } from "@polkadot/types/lookup"; -import { DEFAULT_TXN_MAX_BASE_FEE } from "../../../helpers"; +import { DEFAULT_TXN_MAX_BASE_FEE } from "../../../../helpers"; describeSuite({ id: "D1302", diff --git a/test/suites/dev/test-eth-tx/test-test-tx-nonce.ts b/test/suites/dev/moonbase/test-eth-tx/test-test-tx-nonce.ts similarity index 100% rename from test/suites/dev/test-eth-tx/test-test-tx-nonce.ts rename to test/suites/dev/moonbase/test-eth-tx/test-test-tx-nonce.ts diff --git a/test/suites/dev/test-ethers/test-ethers.ts b/test/suites/dev/moonbase/test-ethers/test-ethers.ts similarity index 100% rename from test/suites/dev/test-ethers/test-ethers.ts rename to test/suites/dev/moonbase/test-ethers/test-ethers.ts diff --git a/test/suites/dev/test-evm/test-pallet-evm-overflow.ts b/test/suites/dev/moonbase/test-evm/test-pallet-evm-overflow.ts similarity index 100% rename from test/suites/dev/test-evm/test-pallet-evm-overflow.ts rename to test/suites/dev/moonbase/test-evm/test-pallet-evm-overflow.ts diff --git a/test/suites/dev/test-evm/test-pallet-evm-transfer.ts b/test/suites/dev/moonbase/test-evm/test-pallet-evm-transfer.ts similarity index 100% rename from test/suites/dev/test-evm/test-pallet-evm-transfer.ts rename to test/suites/dev/moonbase/test-evm/test-pallet-evm-transfer.ts diff --git a/test/suites/dev/test-fees/test-fee-multiplier-genesis.ts b/test/suites/dev/moonbase/test-fees/test-fee-multiplier-genesis.ts similarity index 100% rename from test/suites/dev/test-fees/test-fee-multiplier-genesis.ts rename to test/suites/dev/moonbase/test-fees/test-fee-multiplier-genesis.ts diff --git a/test/suites/dev/test-fees/test-fee-multiplier-max.ts b/test/suites/dev/moonbase/test-fees/test-fee-multiplier-max.ts similarity index 100% rename from test/suites/dev/test-fees/test-fee-multiplier-max.ts rename to test/suites/dev/moonbase/test-fees/test-fee-multiplier-max.ts diff --git a/test/suites/dev/test-fees/test-fee-multiplier-min.ts b/test/suites/dev/moonbase/test-fees/test-fee-multiplier-min.ts similarity index 100% rename from test/suites/dev/test-fees/test-fee-multiplier-min.ts rename to test/suites/dev/moonbase/test-fees/test-fee-multiplier-min.ts diff --git a/test/suites/dev/test-fees/test-fee-multiplier-xcm.ts b/test/suites/dev/moonbase/test-fees/test-fee-multiplier-xcm.ts similarity index 99% rename from test/suites/dev/test-fees/test-fee-multiplier-xcm.ts rename to test/suites/dev/moonbase/test-fees/test-fee-multiplier-xcm.ts index 739b296766..57fdfc15aa 100644 --- a/test/suites/dev/test-fees/test-fee-multiplier-xcm.ts +++ b/test/suites/dev/moonbase/test-fees/test-fee-multiplier-xcm.ts @@ -8,7 +8,7 @@ import { descendOriginFromAddress20, expectOk, injectHrmpMessageAndSeal, -} from "../../../helpers"; +} from "../../../../helpers"; // Below should be the calculation: // export const TARGET_FILL_AMOUNT = diff --git a/test/suites/dev/test-fees/test-fees-repartition.ts b/test/suites/dev/moonbase/test-fees/test-fees-repartition.ts similarity index 100% rename from test/suites/dev/test-fees/test-fees-repartition.ts rename to test/suites/dev/moonbase/test-fees/test-fees-repartition.ts diff --git a/test/suites/dev/test-fees/test-length-fees.ts b/test/suites/dev/moonbase/test-fees/test-length-fees.ts similarity index 100% rename from test/suites/dev/test-fees/test-length-fees.ts rename to test/suites/dev/moonbase/test-fees/test-length-fees.ts diff --git a/test/suites/dev/test-fees/test-length-fees2.ts b/test/suites/dev/moonbase/test-fees/test-length-fees2.ts similarity index 100% rename from test/suites/dev/test-fees/test-length-fees2.ts rename to test/suites/dev/moonbase/test-fees/test-length-fees2.ts diff --git a/test/suites/dev/test-filter/test-filter-api-creation.ts b/test/suites/dev/moonbase/test-filter/test-filter-api-creation.ts similarity index 100% rename from test/suites/dev/test-filter/test-filter-api-creation.ts rename to test/suites/dev/moonbase/test-filter/test-filter-api-creation.ts diff --git a/test/suites/dev/test-filter/test-filter-api-pending.ts b/test/suites/dev/moonbase/test-filter/test-filter-api-pending.ts similarity index 100% rename from test/suites/dev/test-filter/test-filter-api-pending.ts rename to test/suites/dev/moonbase/test-filter/test-filter-api-pending.ts diff --git a/test/suites/dev/test-filter/test-filter-api-polling.ts b/test/suites/dev/moonbase/test-filter/test-filter-api-polling.ts similarity index 100% rename from test/suites/dev/test-filter/test-filter-api-polling.ts rename to test/suites/dev/moonbase/test-filter/test-filter-api-polling.ts diff --git a/test/suites/dev/test-gas/test-gas-contract-creation.ts b/test/suites/dev/moonbase/test-gas/test-gas-contract-creation.ts similarity index 100% rename from test/suites/dev/test-gas/test-gas-contract-creation.ts rename to test/suites/dev/moonbase/test-gas/test-gas-contract-creation.ts diff --git a/test/suites/dev/test-gas/test-gas-estimation-allcontracts.ts b/test/suites/dev/moonbase/test-gas/test-gas-estimation-allcontracts.ts similarity index 98% rename from test/suites/dev/test-gas/test-gas-estimation-allcontracts.ts rename to test/suites/dev/moonbase/test-gas/test-gas-estimation-allcontracts.ts index 3c99c6f444..5e90626dd8 100644 --- a/test/suites/dev/test-gas/test-gas-estimation-allcontracts.ts +++ b/test/suites/dev/moonbase/test-gas/test-gas-estimation-allcontracts.ts @@ -16,7 +16,7 @@ import { } from "@moonwall/util"; import { randomBytes } from "ethers"; import { encodeDeployData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D1802", diff --git a/test/suites/dev/test-gas/test-gas-estimation-contracts.ts b/test/suites/dev/moonbase/test-gas/test-gas-estimation-contracts.ts similarity index 100% rename from test/suites/dev/test-gas/test-gas-estimation-contracts.ts rename to test/suites/dev/moonbase/test-gas/test-gas-estimation-contracts.ts diff --git a/test/suites/dev/test-gas/test-gas-estimation-multiply.ts b/test/suites/dev/moonbase/test-gas/test-gas-estimation-multiply.ts similarity index 100% rename from test/suites/dev/test-gas/test-gas-estimation-multiply.ts rename to test/suites/dev/moonbase/test-gas/test-gas-estimation-multiply.ts diff --git a/test/suites/dev/test-locks/test-locks-multiple-locks.ts b/test/suites/dev/moonbase/test-locks/test-locks-multiple-locks.ts similarity index 97% rename from test/suites/dev/test-locks/test-locks-multiple-locks.ts rename to test/suites/dev/moonbase/test-locks/test-locks-multiple-locks.ts index 426367688e..d275c6ad5c 100644 --- a/test/suites/dev/test-locks/test-locks-multiple-locks.ts +++ b/test/suites/dev/moonbase/test-locks/test-locks-multiple-locks.ts @@ -7,7 +7,7 @@ import { createRawTransfer, generateKeyringPair, } from "@moonwall/util"; -import { createProposal } from "../../../helpers"; +import { createProposal } from "../../../../helpers"; describeSuite({ id: "D2580", diff --git a/test/suites/dev/test-maintenance/test-maintenance-filter.ts b/test/suites/dev/moonbase/test-maintenance/test-maintenance-filter.ts similarity index 99% rename from test/suites/dev/test-maintenance/test-maintenance-filter.ts rename to test/suites/dev/moonbase/test-maintenance/test-maintenance-filter.ts index 6c6b723869..a9ad4bc71b 100644 --- a/test/suites/dev/test-maintenance/test-maintenance-filter.ts +++ b/test/suites/dev/moonbase/test-maintenance/test-maintenance-filter.ts @@ -12,7 +12,7 @@ import { import { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; import { hexToU8a } from "@polkadot/util"; import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; const ARBITRARY_ASSET_ID = 42259045809535163221576417993425387648n; const RELAYCHAIN_ARBITRARY_ADDRESS_1: string = diff --git a/test/suites/dev/test-maintenance/test-maintenance-filter2.ts b/test/suites/dev/moonbase/test-maintenance/test-maintenance-filter2.ts similarity index 99% rename from test/suites/dev/test-maintenance/test-maintenance-filter2.ts rename to test/suites/dev/moonbase/test-maintenance/test-maintenance-filter2.ts index 62f41ef392..c2ece0b3ed 100644 --- a/test/suites/dev/test-maintenance/test-maintenance-filter2.ts +++ b/test/suites/dev/moonbase/test-maintenance/test-maintenance-filter2.ts @@ -9,7 +9,7 @@ import { import { ALITH_ADDRESS, alith, baltathar } from "@moonwall/util"; import { u128 } from "@polkadot/types-codec"; import { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; -import { RELAY_SOURCE_LOCATION, mockAssetBalance } from "../../../helpers"; +import { RELAY_SOURCE_LOCATION, mockAssetBalance } from "../../../../helpers"; const ARBITRARY_ASSET_ID = 42259045809535163221576417993425387648n; diff --git a/test/suites/dev/test-maintenance/test-maintenance-filter3.ts b/test/suites/dev/moonbase/test-maintenance/test-maintenance-filter3.ts similarity index 100% rename from test/suites/dev/test-maintenance/test-maintenance-filter3.ts rename to test/suites/dev/moonbase/test-maintenance/test-maintenance-filter3.ts diff --git a/test/suites/dev/test-maintenance/test-maintenance-mode.ts b/test/suites/dev/moonbase/test-maintenance/test-maintenance-mode.ts similarity index 100% rename from test/suites/dev/test-maintenance/test-maintenance-mode.ts rename to test/suites/dev/moonbase/test-maintenance/test-maintenance-mode.ts diff --git a/test/suites/dev/test-moon/test-moon-rpc.ts b/test/suites/dev/moonbase/test-moon/test-moon-rpc.ts similarity index 98% rename from test/suites/dev/test-moon/test-moon-rpc.ts rename to test/suites/dev/moonbase/test-moon/test-moon-rpc.ts index f651e5443f..3f015fb215 100644 --- a/test/suites/dev/test-moon/test-moon-rpc.ts +++ b/test/suites/dev/moonbase/test-moon/test-moon-rpc.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { customDevRpcRequest, describeSuite, expect } from "@moonwall/cli"; import { BALTATHAR_ADDRESS, createViemTransaction } from "@moonwall/util"; -import { DEFAULT_TXN_MAX_BASE_FEE } from "../../../helpers"; +import { DEFAULT_TXN_MAX_BASE_FEE } from "../../../../helpers"; describeSuite({ id: "D2001", diff --git a/test/suites/dev/test-multisigs/test-multisigs.ts b/test/suites/dev/moonbase/test-multisigs/test-multisigs.ts similarity index 100% rename from test/suites/dev/test-multisigs/test-multisigs.ts rename to test/suites/dev/moonbase/test-multisigs/test-multisigs.ts diff --git a/test/suites/dev/test-node-rpc/test-node-rpc-peer.ts b/test/suites/dev/moonbase/test-node-rpc/test-node-rpc-peer.ts similarity index 100% rename from test/suites/dev/test-node-rpc/test-node-rpc-peer.ts rename to test/suites/dev/moonbase/test-node-rpc/test-node-rpc-peer.ts diff --git a/test/suites/dev/test-polkadot-js/test-polkadot-api.ts b/test/suites/dev/moonbase/test-polkadot-js/test-polkadot-api.ts similarity index 100% rename from test/suites/dev/test-polkadot-js/test-polkadot-api.ts rename to test/suites/dev/moonbase/test-polkadot-js/test-polkadot-api.ts diff --git a/test/suites/dev/test-polkadot-js/test-polkadot-chain-info.ts b/test/suites/dev/moonbase/test-polkadot-js/test-polkadot-chain-info.ts similarity index 100% rename from test/suites/dev/test-polkadot-js/test-polkadot-chain-info.ts rename to test/suites/dev/moonbase/test-polkadot-js/test-polkadot-chain-info.ts diff --git a/test/suites/dev/test-pov/test-evm-over-pov.ts b/test/suites/dev/moonbase/test-pov/test-evm-over-pov.ts similarity index 99% rename from test/suites/dev/test-pov/test-evm-over-pov.ts rename to test/suites/dev/moonbase/test-pov/test-evm-over-pov.ts index d5791c094b..11be685155 100644 --- a/test/suites/dev/test-pov/test-evm-over-pov.ts +++ b/test/suites/dev/moonbase/test-pov/test-evm-over-pov.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, deployCreateCompiledContract, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, createEthersTransaction } from "@moonwall/util"; import { Abi, encodeFunctionData } from "viem"; -import { expectEVMResult, HeavyContract, deployHeavyContracts } from "../../../helpers"; +import { expectEVMResult, HeavyContract, deployHeavyContracts } from "../../../../helpers"; describeSuite({ id: "D2401", diff --git a/test/suites/dev/test-pov/test-evm-over-pov2.ts b/test/suites/dev/moonbase/test-pov/test-evm-over-pov2.ts similarity index 97% rename from test/suites/dev/test-pov/test-evm-over-pov2.ts rename to test/suites/dev/moonbase/test-pov/test-evm-over-pov2.ts index abb407ee68..64d124a6b9 100644 --- a/test/suites/dev/test-pov/test-evm-over-pov2.ts +++ b/test/suites/dev/moonbase/test-pov/test-evm-over-pov2.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, deployCreateCompiledContract, describeSuite, expect } from "@moonwall/cli"; import { MAX_ETH_POV_PER_TX, createEthersTransaction } from "@moonwall/util"; import { Abi, encodeFunctionData } from "viem"; -import { HeavyContract, deployHeavyContracts } from "../../../helpers"; +import { HeavyContract, deployHeavyContracts } from "../../../../helpers"; describeSuite({ id: "D2402", diff --git a/test/suites/dev/moonbase/test-pov/test-lazy-migrations-storage-removal.ts b/test/suites/dev/moonbase/test-pov/test-lazy-migrations-storage-removal.ts new file mode 100644 index 0000000000..a4a8104409 --- /dev/null +++ b/test/suites/dev/moonbase/test-pov/test-lazy-migrations-storage-removal.ts @@ -0,0 +1,94 @@ +import "@moonbeam-network/api-augment"; +import { beforeAll, describeSuite, expect } from "@moonwall/cli"; +import { alith, baltathar } from "@moonwall/util"; +import { ApiPromise } from "@polkadot/api"; +import { u128 } from "@polkadot/types"; + +describeSuite({ + id: "D2406", + title: "Remove LocalAssets storage - PoV Size validation", + foundationMethods: "dev", + testCases: ({ context, it, log }) => { + let assetId: u128; + let api: ApiPromise; + beforeAll(async () => { + api = context.polkadotJs(); + + await context.createBlock(api.tx.assets.transfer(assetId, baltathar.address, 1000)); + }); + + it({ + id: "T01", + title: "Validate storage removal uses a reasonable proof size", + test: async function () { + const total_entries = 9000; + // sp_io::hashing::twox_128("LocalAssets".as_bytes()); + const pallet_name_hash = "0xbebaa96ee6c1d0e946832368c6396271"; + + const dummy_storage: [string, string][] = []; + for (let i = 0; i < total_entries; i++) { + const dummy_data = i.toString(16).padStart(200, "0"); + dummy_storage.push([pallet_name_hash + dummy_data, dummy_data]); + } + + // Insert 500 entries per block to not reach limits + for (let i = 0; i < total_entries; i += 500) { + await context.createBlock( + api.tx.sudo + .sudo(api.tx.system.setStorage(dummy_storage.slice(i, i + 500))) + .signAsync(alith) + ); + } + + // Check the pallet storage size + const full_size = (await api.rpc.state.getStorageSize(pallet_name_hash)).toNumber(); + expect(full_size).to.be.equal(1_800_000); + + // editorconfig-checker-disable + // The constant `MAX_POV_SIZE` comes from: https://github.com/paritytech/polkadot-sdk/blob/b79bf4fb1fec1f7a7483f9a2baa0a1e7a4fcb9c8/polkadot/primitives/src/v6/mod.rs#L391 + // editorconfig-checker-enable + const MAX_POV_SIZE = 5 * 1024 * 1024; // 5MB + const reasonable_max_pov_size = MAX_POV_SIZE / 5; // 1MB + + let current_size = full_size; + while (current_size > 0) { + // The migration is not complet yet + expect( + (await api.query["moonbeamLazyMigrations"].localAssetsMigrationCompleted()).toHuman() + ).to.be.false; + + // Remove 2000 entries each time + const entries_to_remove = 2000; + const result = await context.createBlock( + api.tx["moonbeamLazyMigrations"] + .clearLocalAssetsStorage(entries_to_remove) + .signAsync(alith) + ); + + // Validate that we are within the reasonable proof size + expect(result.block.proofSize).to.be.lessThan(reasonable_max_pov_size); + log( + `Removed ${entries_to_remove} entries from LocalAssets \ + storage (proof_size: ${result.block.proofSize}).` + ); + + // Validate that some storage got removed + const new_size = (await api.rpc.state.getStorageSize(pallet_name_hash)).toNumber(); + expect(new_size).to.be.lessThan(current_size); + + // Update current storage size + current_size = new_size; + } + + // Validate that the whole storage got removed + current_size = (await api.rpc.state.getStorageSize(pallet_name_hash)).toNumber(); + expect(current_size).to.be.equal(0); + + // The migration should be complete + expect( + (await api.query["moonbeamLazyMigrations"].localAssetsMigrationCompleted()).toHuman() + ).to.be.true; + }, + }); + }, +}); diff --git a/test/suites/dev/test-pov/test-precompile-over-pov.ts b/test/suites/dev/moonbase/test-pov/test-precompile-over-pov.ts similarity index 99% rename from test/suites/dev/test-pov/test-precompile-over-pov.ts rename to test/suites/dev/moonbase/test-pov/test-precompile-over-pov.ts index 8745051f77..4d1587d916 100644 --- a/test/suites/dev/test-pov/test-precompile-over-pov.ts +++ b/test/suites/dev/moonbase/test-pov/test-precompile-over-pov.ts @@ -6,7 +6,7 @@ import { deployCreateCompiledContract, fetchCompiledContract, } from "@moonwall/cli"; -import { HeavyContract, deployHeavyContracts, expectEVMResult } from "../../../helpers"; +import { HeavyContract, deployHeavyContracts, expectEVMResult } from "../../../../helpers"; import { Abi, encodeFunctionData } from "viem"; import { ALITH_ADDRESS, PRECOMPILE_BATCH_ADDRESS, createEthersTransaction } from "@moonwall/util"; diff --git a/test/suites/dev/test-pov/test-precompile-over-pov2.ts b/test/suites/dev/moonbase/test-pov/test-precompile-over-pov2.ts similarity index 97% rename from test/suites/dev/test-pov/test-precompile-over-pov2.ts rename to test/suites/dev/moonbase/test-pov/test-precompile-over-pov2.ts index 0cb4b9524f..8f2b26233b 100644 --- a/test/suites/dev/test-pov/test-precompile-over-pov2.ts +++ b/test/suites/dev/moonbase/test-pov/test-precompile-over-pov2.ts @@ -12,7 +12,7 @@ import { createEthersTransaction, } from "@moonwall/util"; import { Abi, encodeFunctionData } from "viem"; -import { HeavyContract, deployHeavyContracts } from "../../../helpers"; +import { HeavyContract, deployHeavyContracts } from "../../../../helpers"; describeSuite({ id: "D2404", diff --git a/test/suites/dev/test-pov/test-xcm-to-evm-pov.ts b/test/suites/dev/moonbase/test-pov/test-xcm-to-evm-pov.ts similarity index 99% rename from test/suites/dev/test-pov/test-xcm-to-evm-pov.ts rename to test/suites/dev/moonbase/test-pov/test-xcm-to-evm-pov.ts index d3c83b05ca..a871db04f7 100644 --- a/test/suites/dev/test-pov/test-xcm-to-evm-pov.ts +++ b/test/suites/dev/moonbase/test-pov/test-xcm-to-evm-pov.ts @@ -1,14 +1,14 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect, deployCreateCompiledContract } from "@moonwall/cli"; import { Abi, encodeFunctionData } from "viem"; -import { HeavyContract, deployHeavyContracts, expectOk } from "../../../helpers"; +import { HeavyContract, deployHeavyContracts, expectOk } from "../../../../helpers"; import { RawXcmMessage, XcmFragment, descendOriginFromAddress20, injectHrmpMessage, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; import { GAS_LIMIT_POV_RATIO } from "@moonwall/util"; describeSuite({ diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20-local-assets-removal.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20-local-assets-removal.ts new file mode 100644 index 0000000000..3573447f8a --- /dev/null +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20-local-assets-removal.ts @@ -0,0 +1,122 @@ +import "@moonbeam-network/api-augment"; +import { beforeAll, deployCreateCompiledContract, describeSuite, expect } from "@moonwall/cli"; +import { ALITH_ADDRESS, createEthersTransaction } from "@moonwall/util"; +import { Abi, encodeFunctionData } from "viem"; +import { extractRevertReason } from "../../../../helpers"; + +describeSuite({ + id: "D2584", + title: "Precompiles - Assets-ERC20 (LocalAssets Removal)", + foundationMethods: "dev", + testCases: ({ context, it, log }) => { + const precompileRegistryAddress = "0x0000000000000000000000000000000000000815"; + const localAssets = [ + "0xfffffffe88fc55121922ed6780b7e0c8ab0374d2", + "0xfffffffed4524df96c487c197dc9a964543678a6", + "0xfffffffeb184a34c1a2ac403f5afae19d811de72", + "0xfffffffe221e31a529b1a5fc4101352398974a06", + "0xfffffffe960a8ea5ccee2720828ebe2dbd97b69a", + "0xfffffffeb1de27b22dcb3a2e1def6d0edefa3bff", + "0xfffffffe0b00feb2a14ad90d9d4d871eba59dd9c", + "0xfffffffe47b78475160da680caef70959e027bee", + "0xfffffffeff0e8e9e2288fcce5e70afa61baec79d", + "0xfffffffe4b980819e301da7d7b08b1a64299c5ff", + "0xfffffffef0608962d5801b39f437d4cc416939e1", + "0xfffffffefd9d0bf45a2947a519a741c4b9e99eb6", + "0xfffffffec002b88d59aa53e9612a00fb2a2d1504", + "0xfffffffe028682475e21a368c4f6e368efe598f0", + "0xfffffffe6d1492e39f1674f65a6f600b4589abd7", + ]; + const notLocalAssets = [ + "0xfffffffe88fc55121922ed6780b7e0c8ab0374d3", + "0xfffffffe221e31a529b1a5fc4101352398974a07", + ]; + let erc20Abi: Abi; + let precompileRegistryAbi: Abi; + + beforeAll(async () => { + const { abi } = await deployCreateCompiledContract(context, "ERC20Instance"); + erc20Abi = abi; + const { abi: _precompileRegistryAbi } = await deployCreateCompiledContract( + context, + "PrecompileRegistry" + ); + precompileRegistryAbi = _precompileRegistryAbi; + }); + + it({ + id: "T01", + title: "ensure evm calls on local xc-20 addresses get reverted", + test: async function () { + const addresses = [ + ...localAssets.map((address) => ({ address, local: true })), + ...notLocalAssets.map((address) => ({ address, local: false })), + ]; + + // Call every address and ensure it only local asset addresses get reverted + for (const { address, local } of addresses) { + const rawSigned = await createEthersTransaction(context, { + to: address, + data: encodeFunctionData({ + abi: erc20Abi, + functionName: "approve", + args: [ALITH_ADDRESS, 1000], + }), + }); + + const { result } = await context.createBlock(rawSigned); + const receipt = await context + .viem("public") + .getTransactionReceipt({ hash: result?.hash as `0x${string}` }); + + if (local) { + // The transaction status should be "reverted" when calling a local asset + expect(receipt.status).to.equal("reverted"); + + // Assert expected revert reason + const revertReason = await extractRevertReason(context, result!.hash); + expect(revertReason).to.equal("Removed precompile"); + } else { + // The transaction status should be "success" + expect(receipt.status).to.equal("success"); + } + } + }, + }); + + it({ + id: "T02", + title: "Local assets should be inactive in the precompile registry", + test: async function () { + const addresses = [ + ...localAssets.map((address) => ({ address, local: true })), + ...notLocalAssets.map((address) => ({ address, local: false })), + ]; + + for (const { address, local } of addresses) { + const isPrecompileResult = await context.viem().readContract({ + address: precompileRegistryAddress, + abi: precompileRegistryAbi, + functionName: "isPrecompile", + args: [address], + }); + const isActivePrecompileResult = await context.viem().readContract({ + address: precompileRegistryAddress, + abi: precompileRegistryAbi, + functionName: "isActivePrecompile", + args: [address], + }); + + if (local) { + // All local asset addresses are still considereded precompiles + expect(isPrecompileResult).to.be.true; + // All local asset precompiles should be inactive + expect(isActivePrecompileResult).to.be.false; + } else { + expect(isPrecompileResult).to.be.false; + } + } + }, + }); + }, +}); diff --git a/test/suites/dev/test-precompile/test-precompile-assets-erc20-low-level.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20-low-level.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-assets-erc20-low-level.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20-low-level.ts index 7a1b527502..086b0de119 100644 --- a/test/suites/dev/test-precompile/test-precompile-assets-erc20-low-level.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20-low-level.ts @@ -17,7 +17,7 @@ import { u128 } from "@polkadot/types"; import { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; import { nToHex } from "@polkadot/util"; import { Abi, encodeFunctionData } from "viem"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; describeSuite({ id: "D2501", diff --git a/test/suites/dev/test-precompile/test-precompile-assets-erc20.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-assets-erc20.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20.ts index b7070b3103..ba9abd4fab 100644 --- a/test/suites/dev/test-precompile/test-precompile-assets-erc20.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20.ts @@ -4,7 +4,7 @@ import { ALITH_ADDRESS, alith } from "@moonwall/util"; import { u128 } from "@polkadot/types-codec"; import { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; import { Abi, decodeAbiParameters, encodeFunctionData } from "viem"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; describeSuite({ id: "D2502", diff --git a/test/suites/dev/test-precompile/test-precompile-assets-erc20a.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20a.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-assets-erc20a.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20a.ts index 62eb50083d..68c49cd9c5 100644 --- a/test/suites/dev/test-precompile/test-precompile-assets-erc20a.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20a.ts @@ -3,7 +3,7 @@ import { beforeAll, deployCreateCompiledContract, describeSuite, expect } from " import { ALITH_ADDRESS, BALTATHAR_ADDRESS, alith, createEthersTransaction } from "@moonwall/util"; import { u128 } from "@polkadot/types-codec"; import { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; import { Abi, encodeFunctionData } from "viem"; diff --git a/test/suites/dev/test-precompile/test-precompile-assets-erc20b.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20b.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-assets-erc20b.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20b.ts index 6bac4dc79d..ac6aaaa2bc 100644 --- a/test/suites/dev/test-precompile/test-precompile-assets-erc20b.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20b.ts @@ -11,7 +11,7 @@ import { } from "@moonwall/util"; import { u128 } from "@polkadot/types-codec"; import { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; import { Abi, encodeFunctionData } from "viem"; diff --git a/test/suites/dev/test-precompile/test-precompile-assets-erc20c.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20c.ts similarity index 97% rename from test/suites/dev/test-precompile/test-precompile-assets-erc20c.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20c.ts index 102e6cd6df..f8709ab0f1 100644 --- a/test/suites/dev/test-precompile/test-precompile-assets-erc20c.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20c.ts @@ -4,7 +4,7 @@ import { ALITH_ADDRESS, BALTATHAR_ADDRESS, alith, createViemTransaction } from " import { u128 } from "@polkadot/types-codec"; import { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; import { Abi, encodeFunctionData } from "viem"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; describeSuite({ id: "D2505", diff --git a/test/suites/dev/test-precompile/test-precompile-assets-erc20d.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20d.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-assets-erc20d.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20d.ts index 2f83e9d615..d3cc3d259a 100644 --- a/test/suites/dev/test-precompile/test-precompile-assets-erc20d.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20d.ts @@ -10,7 +10,7 @@ import { import { u128 } from "@polkadot/types-codec"; import { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; import { Abi, encodeFunctionData } from "viem"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; describeSuite({ id: "D2506", diff --git a/test/suites/dev/test-precompile/test-precompile-assets-erc20e.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20e.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-assets-erc20e.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20e.ts index 3c591b93da..ad2ee8e5df 100644 --- a/test/suites/dev/test-precompile/test-precompile-assets-erc20e.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20e.ts @@ -10,7 +10,7 @@ import { import { u128 } from "@polkadot/types-codec"; import { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; import { Abi, encodeFunctionData } from "viem"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; describeSuite({ id: "D2507", diff --git a/test/suites/dev/test-precompile/test-precompile-assets-erc20f.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20f.ts similarity index 97% rename from test/suites/dev/test-precompile/test-precompile-assets-erc20f.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20f.ts index c4f2d17957..44316275bb 100644 --- a/test/suites/dev/test-precompile/test-precompile-assets-erc20f.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-assets-erc20f.ts @@ -4,7 +4,7 @@ import { BALTATHAR_ADDRESS, alith, createViemTransaction } from "@moonwall/util" import { u128 } from "@polkadot/types-codec"; import { PalletAssetsAssetAccount, PalletAssetsAssetDetails } from "@polkadot/types/lookup"; import { Abi, encodeFunctionData } from "viem"; -import { mockAssetBalance } from "../../../helpers"; +import { mockAssetBalance } from "../../../../helpers"; describeSuite({ id: "D2508", diff --git a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-author-mapping-keys.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys.ts index a9133768c1..f63f053b22 100644 --- a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys.ts @@ -5,7 +5,7 @@ import { concatOriginalKeys, originalKeys, setAuthorMappingKeysViaPrecompile, -} from "../../../helpers/precompiles.js"; +} from "../../../../helpers/precompiles.js"; describeSuite({ id: "D2509", diff --git a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys2.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-author-mapping-keys2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys2.ts index 413b754174..996eb5ed40 100644 --- a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys2.ts @@ -5,7 +5,7 @@ import { concatOriginalKeys, originalKeys, setAuthorMappingKeysViaPrecompile, -} from "../../../helpers/precompiles.js"; +} from "../../../../helpers/precompiles.js"; describeSuite({ id: "D2510", diff --git a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys3.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-author-mapping-keys3.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys3.ts index 4651d93d8e..1c8bfb0150 100644 --- a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys3.ts @@ -7,7 +7,7 @@ import { newKeys, originalKeys, setAuthorMappingKeysViaPrecompile, -} from "../../../helpers/precompiles.js"; +} from "../../../../helpers/precompiles.js"; describeSuite({ id: "D2511", diff --git a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys4.ts similarity index 96% rename from test/suites/dev/test-precompile/test-precompile-author-mapping-keys4.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys4.ts index aab5eaecdb..a1b4ace3f0 100644 --- a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys4.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys4.ts @@ -10,8 +10,8 @@ import { concatOriginalKeys, originalKeys, setAuthorMappingKeysViaPrecompile, -} from "../../../helpers/precompiles.js"; -import { sendPrecompileTx } from "../../../helpers"; +} from "../../../../helpers/precompiles.js"; +import { sendPrecompileTx } from "../../../../helpers"; const SELECTORS = { set_keys: "bcb24ddc", diff --git a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys5.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys5.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-author-mapping-keys5.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys5.ts diff --git a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys6.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys6.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-author-mapping-keys6.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys6.ts index bcd8a1f871..b0042488dd 100644 --- a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys6.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys6.ts @@ -10,7 +10,7 @@ import { getBlockExtrinsic, } from "@moonwall/util"; import { encodeFunctionData } from "viem"; -import { originalKeys, setAuthorMappingKeysViaPrecompile } from "../../../helpers"; +import { originalKeys, setAuthorMappingKeysViaPrecompile } from "../../../../helpers"; describeSuite({ id: "D2514", diff --git a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys7.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys7.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-author-mapping-keys7.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys7.ts index 6d88f435f6..ccd2d72b36 100644 --- a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys7.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys7.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { FAITH_ADDRESS, FAITH_PRIVATE_KEY, getBlockExtrinsic } from "@moonwall/util"; -import { originalKeys, setAuthorMappingKeysViaPrecompile } from "../../../helpers"; +import { originalKeys, setAuthorMappingKeysViaPrecompile } from "../../../../helpers"; describeSuite({ id: "D2515", diff --git a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys8.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys8.ts similarity index 93% rename from test/suites/dev/test-precompile/test-precompile-author-mapping-keys8.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys8.ts index f7166c9ee6..835078aa7f 100644 --- a/test/suites/dev/test-precompile/test-precompile-author-mapping-keys8.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping-keys8.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { FAITH_ADDRESS, FAITH_PRIVATE_KEY, getBlockExtrinsic } from "@moonwall/util"; -import { setAuthorMappingKeysViaPrecompile } from "../../../helpers"; +import { setAuthorMappingKeysViaPrecompile } from "../../../../helpers"; describeSuite({ id: "D2516", diff --git a/test/suites/dev/test-precompile/test-precompile-author-mapping.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-author-mapping.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping.ts diff --git a/test/suites/dev/test-precompile/test-precompile-author-mapping2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping2.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-author-mapping2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping2.ts diff --git a/test/suites/dev/test-precompile/test-precompile-author-mapping3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping3.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-author-mapping3.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-author-mapping3.ts diff --git a/test/suites/dev/test-precompile/test-precompile-batch-gas-limit.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-batch-gas-limit.ts similarity index 97% rename from test/suites/dev/test-precompile/test-precompile-batch-gas-limit.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-batch-gas-limit.ts index 146a638827..f95356eabf 100644 --- a/test/suites/dev/test-precompile/test-precompile-batch-gas-limit.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-batch-gas-limit.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { PRECOMPILES, generateKeyringPair, sendRawTransaction } from "@moonwall/util"; import { encodeFunctionData, parseAbiItem } from "viem"; -import { extractRevertReason } from "../../../helpers"; +import { extractRevertReason } from "../../../../helpers"; // Casting of type in solidity is performing truncation: // https://docs.soliditylang.org/en/latest/types.html#conversions-between-elementary-types diff --git a/test/suites/dev/test-precompile/test-precompile-batch.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-batch.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-batch.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-batch.ts index 97ab66adf8..bb023624b4 100644 --- a/test/suites/dev/test-precompile/test-precompile-batch.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-batch.ts @@ -11,7 +11,7 @@ import { sendRawTransaction, } from "@moonwall/util"; import { encodeFunctionData, fromHex } from "viem"; -import { expectEVMResult, getSignatureParameters } from "../../../helpers"; +import { expectEVMResult, getSignatureParameters } from "../../../../helpers"; describeSuite({ id: "D2520", diff --git a/test/suites/dev/test-precompile/test-precompile-blake2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-blake2.ts similarity index 94% rename from test/suites/dev/test-precompile/test-precompile-blake2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-blake2.ts index 062b682960..11375e4c68 100644 --- a/test/suites/dev/test-precompile/test-precompile-blake2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-blake2.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { deployCreateCompiledContract, describeSuite } from "@moonwall/cli"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; import { createViemTransaction } from "@moonwall/util"; import { encodeFunctionData } from "viem"; diff --git a/test/suites/dev/test-precompile/test-precompile-bn128-bounds.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-bn128-bounds.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-bn128-bounds.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-bn128-bounds.ts diff --git a/test/suites/dev/test-precompile/test-precompile-bn128add.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-bn128add.ts similarity index 94% rename from test/suites/dev/test-precompile/test-precompile-bn128add.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-bn128add.ts index 8291533d96..608b97d9ad 100644 --- a/test/suites/dev/test-precompile/test-precompile-bn128add.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-bn128add.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { deployCreateCompiledContract, describeSuite } from "@moonwall/cli"; import { createViemTransaction } from "@moonwall/util"; import { encodeFunctionData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D2523", diff --git a/test/suites/dev/test-precompile/test-precompile-bn128mul.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-bn128mul.ts similarity index 94% rename from test/suites/dev/test-precompile/test-precompile-bn128mul.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-bn128mul.ts index 75d1c40aba..9e491a6aff 100644 --- a/test/suites/dev/test-precompile/test-precompile-bn128mul.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-bn128mul.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { deployCreateCompiledContract, describeSuite } from "@moonwall/cli"; import { createViemTransaction } from "@moonwall/util"; import { encodeFunctionData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D2524", diff --git a/test/suites/dev/test-precompile/test-precompile-bn128pairing.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-bn128pairing.ts similarity index 94% rename from test/suites/dev/test-precompile/test-precompile-bn128pairing.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-bn128pairing.ts index bbf04ef0da..398baea88a 100644 --- a/test/suites/dev/test-precompile/test-precompile-bn128pairing.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-bn128pairing.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { deployCreateCompiledContract, describeSuite } from "@moonwall/cli"; import { createViemTransaction } from "@moonwall/util"; import { encodeFunctionData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D2525", diff --git a/test/suites/dev/test-precompile/test-precompile-call-permit-demo.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-call-permit-demo.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-call-permit-demo.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-call-permit-demo.ts index 1eff0e47c9..253e084ebe 100644 --- a/test/suites/dev/test-precompile/test-precompile-call-permit-demo.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-call-permit-demo.ts @@ -14,7 +14,7 @@ import { createViemTransaction, } from "@moonwall/util"; import { Abi, encodeFunctionData, fromHex } from "viem"; -import { expectEVMResult, getSignatureParameters } from "../../../helpers"; +import { expectEVMResult, getSignatureParameters } from "../../../../helpers"; describeSuite({ id: "D2526", diff --git a/test/suites/dev/test-precompile/test-precompile-collective.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-collective.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-collective.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-collective.ts index 2bb97381cf..0e25e93568 100644 --- a/test/suites/dev/test-precompile/test-precompile-collective.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-collective.ts @@ -20,7 +20,7 @@ import { } from "@moonwall/util"; import { blake2AsHex } from "@polkadot/util-crypto"; import { Abi, encodeFunctionData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; const successfulCouncilCall = async ( context: DevModeContext, diff --git a/test/suites/dev/test-precompile/test-precompile-collective2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-collective2.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-collective2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-collective2.ts diff --git a/test/suites/dev/test-precompile/test-precompile-conviction-voting.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-conviction-voting.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting.ts index fd79fc1f94..63e9bc2e7f 100644 --- a/test/suites/dev/test-precompile/test-precompile-conviction-voting.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting.ts @@ -8,7 +8,7 @@ import { expectSubstrateEvent, createProposal, ConvictionVoting, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2529", diff --git a/test/suites/dev/test-precompile/test-precompile-conviction-voting2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting2.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-conviction-voting2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting2.ts index 8f10d4ae14..eeab406191 100644 --- a/test/suites/dev/test-precompile/test-precompile-conviction-voting2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting2.ts @@ -1,6 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeEach, describeSuite, expect } from "@moonwall/cli"; -import { expectEVMResult, createProposal, ConvictionVoting } from "../../../helpers"; +import { expectEVMResult, createProposal, ConvictionVoting } from "../../../../helpers"; const CONVICTION_VALUES = [0n, 1n, 2n, 3n, 4n, 5n, 6n]; diff --git a/test/suites/dev/test-precompile/test-precompile-conviction-voting3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting3.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-conviction-voting3.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting3.ts index 2f2908bb9f..a8aa62f59c 100644 --- a/test/suites/dev/test-precompile/test-precompile-conviction-voting3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting3.ts @@ -7,7 +7,7 @@ import { createProposal, expectEVMResult, expectSubstrateEvent, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2529-2", diff --git a/test/suites/dev/test-precompile/test-precompile-conviction-voting4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting4.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-conviction-voting4.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting4.ts index 810e97498a..cc22230bed 100644 --- a/test/suites/dev/test-precompile/test-precompile-conviction-voting4.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting4.ts @@ -14,7 +14,7 @@ import { createProposal, expectEVMResult, expectSubstrateEvent, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2529-3", diff --git a/test/suites/dev/test-precompile/test-precompile-conviction-voting5.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting5.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-conviction-voting5.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting5.ts index 946761e656..7528e49b8b 100644 --- a/test/suites/dev/test-precompile/test-precompile-conviction-voting5.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting5.ts @@ -7,7 +7,7 @@ import { extractRevertReason, createProposal, ConvictionVoting, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2529-4", diff --git a/test/suites/dev/test-precompile/test-precompile-conviction-voting6.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting6.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-conviction-voting6.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting6.ts index abee8832da..58164788d4 100644 --- a/test/suites/dev/test-precompile/test-precompile-conviction-voting6.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-conviction-voting6.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, beforeEach, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, BALTATHAR_ADDRESS, BALTATHAR_PRIVATE_KEY, GLMR } from "@moonwall/util"; -import { expectEVMResult, createProposal, ConvictionVoting } from "../../../helpers"; +import { expectEVMResult, createProposal, ConvictionVoting } from "../../../../helpers"; // Each test is instantiating a new proposal (Not ideal for isolation but easier to write) // Be careful to not reach the maximum number of proposals. diff --git a/test/suites/dev/test-precompile/test-precompile-democracy.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-democracy.ts similarity index 97% rename from test/suites/dev/test-precompile/test-precompile-democracy.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-democracy.ts index 2ad2c397bd..881b60cda2 100644 --- a/test/suites/dev/test-precompile/test-precompile-democracy.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-democracy.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, ZERO_ADDRESS } from "@moonwall/util"; -import { notePreimagePrecompile } from "../../../helpers"; +import { notePreimagePrecompile } from "../../../../helpers"; describeSuite({ id: "D2530", diff --git a/test/suites/dev/test-precompile/test-precompile-democracy2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-democracy2.ts similarity index 96% rename from test/suites/dev/test-precompile/test-precompile-democracy2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-democracy2.ts index 482f572e11..5db929292f 100644 --- a/test/suites/dev/test-precompile/test-precompile-democracy2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-democracy2.ts @@ -8,7 +8,7 @@ import { } from "@moonwall/util"; import { nToHex } from "@polkadot/util"; import { Abi, encodeFunctionData } from "viem"; -import { notePreimagePrecompile } from "../../../helpers"; +import { notePreimagePrecompile } from "../../../../helpers"; describeSuite({ id: "D2531", diff --git a/test/suites/dev/test-precompile/test-precompile-dummy-bytecode.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-dummy-bytecode.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-dummy-bytecode.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-dummy-bytecode.ts diff --git a/test/suites/dev/test-precompile/test-precompile-ecpairing.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-ecpairing.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-ecpairing.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-ecpairing.ts diff --git a/test/suites/dev/test-precompile/test-precompile-ecrecover.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-ecrecover.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-ecrecover.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-ecrecover.ts diff --git a/test/suites/dev/test-precompile/test-precompile-erc20-overflow.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-erc20-overflow.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-erc20-overflow.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-erc20-overflow.ts diff --git a/test/suites/dev/test-precompile/test-precompile-erc20.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-erc20.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-erc20.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-erc20.ts index a12579fc3d..3021512d70 100644 --- a/test/suites/dev/test-precompile/test-precompile-erc20.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-erc20.ts @@ -10,7 +10,7 @@ import { } from "@moonwall/util"; import { PrivateKeyAccount, keccak256, pad, parseEther, toBytes, toHex } from "viem"; import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; -import { ALITH_GENESIS_TRANSFERABLE_BALANCE } from "../../../helpers"; +import { ALITH_GENESIS_TRANSFERABLE_BALANCE } from "../../../../helpers"; // const SELECTORS = { // balanceOf: "70a08231", diff --git a/test/suites/dev/test-precompile/test-precompile-identity.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-identity.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity.ts index dc116141a9..2c3849f966 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { alith, baltathar } from "@moonwall/util"; import { toHex } from "viem"; -import { PRECOMPILE_IDENTITY_ADDRESS } from "../../../helpers"; +import { PRECOMPILE_IDENTITY_ADDRESS } from "../../../../helpers"; describeSuite({ id: "D3400", diff --git a/test/suites/dev/test-precompile/test-precompile-identity10.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity10.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-identity10.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity10.ts index 21a674e425..3644c2dd44 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity10.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity10.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { alith, charleth } from "@moonwall/util"; -import { expectEVMResult, PRECOMPILE_IDENTITY_ADDRESS } from "../../../helpers"; +import { expectEVMResult, PRECOMPILE_IDENTITY_ADDRESS } from "../../../../helpers"; describeSuite({ id: "D3409", diff --git a/test/suites/dev/test-precompile/test-precompile-identity11.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity11.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-identity11.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity11.ts index 24472c990e..bef9b56c23 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity11.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity11.ts @@ -6,7 +6,7 @@ import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult, expectSubstrateEvent, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D3410", diff --git a/test/suites/dev/test-precompile/test-precompile-identity12.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity12.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-identity12.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity12.ts index 8ff7748f8e..a3723f721f 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity12.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity12.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { BALTATHAR_PRIVATE_KEY, baltathar, charleth } from "@moonwall/util"; import { toHex } from "viem"; -import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult } from "../../../helpers"; +import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D3411", diff --git a/test/suites/dev/test-precompile/test-precompile-identity13.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity13.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-identity13.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity13.ts index b80238ae30..31728d2d54 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity13.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity13.ts @@ -6,7 +6,7 @@ import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult, expectSubstrateEvent, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D3412", diff --git a/test/suites/dev/test-precompile/test-precompile-identity14.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity14.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-identity14.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity14.ts index 9fccff7216..335f83c521 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity14.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity14.ts @@ -6,7 +6,7 @@ import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult, expectSubstrateEvent, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D3413", diff --git a/test/suites/dev/test-precompile/test-precompile-identity2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity2.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-identity2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity2.ts index 095b074854..a942d48753 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity2.ts @@ -6,7 +6,7 @@ import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult, expectSubstrateEvent, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D3401", diff --git a/test/suites/dev/test-precompile/test-precompile-identity3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity3.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-identity3.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity3.ts index 59fab68efa..b4e5b8de91 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity3.ts @@ -6,7 +6,7 @@ import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult, expectSubstrateEvent, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D3402", diff --git a/test/suites/dev/test-precompile/test-precompile-identity4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity4.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-identity4.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity4.ts index bfaef69ecc..01d0952d6c 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity4.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity4.ts @@ -6,7 +6,7 @@ import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult, expectSubstrateEvent, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D3403", diff --git a/test/suites/dev/test-precompile/test-precompile-identity5.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity5.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-identity5.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity5.ts index 2c6225ed8c..5998744469 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity5.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity5.ts @@ -6,7 +6,7 @@ import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult, expectSubstrateEvent, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D3404", diff --git a/test/suites/dev/test-precompile/test-precompile-identity6.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity6.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-identity6.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity6.ts index 5fb7b21d89..774ee27c99 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity6.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity6.ts @@ -6,7 +6,7 @@ import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult, expectSubstrateEvent, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D3405", diff --git a/test/suites/dev/test-precompile/test-precompile-identity7.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity7.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-identity7.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity7.ts index 8a4498e769..bd8271aaff 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity7.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity7.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { BALTATHAR_PRIVATE_KEY, baltathar, charleth } from "@moonwall/util"; import { toHex } from "viem"; -import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult } from "../../../helpers"; +import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D3406", diff --git a/test/suites/dev/test-precompile/test-precompile-identity8.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity8.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-identity8.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity8.ts index 1c2fd3c8b2..02ded8cc2d 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity8.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity8.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { alith } from "@moonwall/util"; -import { expectEVMResult, PRECOMPILE_IDENTITY_ADDRESS } from "../../../helpers"; +import { expectEVMResult, PRECOMPILE_IDENTITY_ADDRESS } from "../../../../helpers"; describeSuite({ id: "D3407", diff --git a/test/suites/dev/test-precompile/test-precompile-identity9.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity9.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-identity9.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-identity9.ts index 1ee006ad29..3981c1a60c 100644 --- a/test/suites/dev/test-precompile/test-precompile-identity9.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity9.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { alith } from "@moonwall/util"; -import { expectEVMResult, PRECOMPILE_IDENTITY_ADDRESS } from "../../../helpers"; +import { expectEVMResult, PRECOMPILE_IDENTITY_ADDRESS } from "../../../../helpers"; describeSuite({ id: "D3408", diff --git a/test/suites/dev/test-precompile/test-precompile-modexp.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-modexp.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-modexp.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-modexp.ts index 24d0a7837c..9682e2a1c5 100644 --- a/test/suites/dev/test-precompile/test-precompile-modexp.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-modexp.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { EXTRINSIC_GAS_LIMIT, createViemTransaction } from "@moonwall/util"; import { hexToU8a, u8aToHex } from "@polkadot/util"; -import { expectEVMResult, testVectors } from "../../../helpers"; +import { expectEVMResult, testVectors } from "../../../../helpers"; const MODEXP_PRECOMPILE_ADDRESS = "0x0000000000000000000000000000000000000005"; diff --git a/test/suites/dev/test-precompile/test-precompile-preimage.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-preimage.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-preimage.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-preimage.ts index e4f2bfe723..ee11c422dd 100644 --- a/test/suites/dev/test-precompile/test-precompile-preimage.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-preimage.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, beforeEach, describeSuite, expect, fetchCompiledContract } from "@moonwall/cli"; import { Abi, decodeEventLog } from "viem"; -import { Preimage, expectEVMResult, expectSubstrateEvent } from "../../../helpers"; +import { Preimage, expectEVMResult, expectSubstrateEvent } from "../../../../helpers"; // Each test is instantiating a new proposal (Not ideal for isolation but easier to write) // Be careful to not reach the maximum number of proposals. diff --git a/test/suites/dev/test-precompile/test-precompile-proxy-author-mapping.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-author-mapping.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-proxy-author-mapping.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-proxy-author-mapping.ts index 04a8699fb3..2198118dc6 100644 --- a/test/suites/dev/test-precompile/test-precompile-proxy-author-mapping.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-author-mapping.ts @@ -9,7 +9,7 @@ import { PRECOMPILE_AUTHOR_MAPPING_ADDRESS, } from "@moonwall/util"; import { encodeFunctionData } from "viem"; -import { expectEVMResult, getAuthorMappingInfo } from "../../../helpers"; +import { expectEVMResult, getAuthorMappingInfo } from "../../../../helpers"; describeSuite({ id: "D2540", diff --git a/test/suites/dev/test-precompile/test-precompile-proxy-governance.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-governance.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-proxy-governance.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-proxy-governance.ts index b37e4c09bc..730697eebb 100644 --- a/test/suites/dev/test-precompile/test-precompile-proxy-governance.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-governance.ts @@ -18,7 +18,7 @@ import { VOTE_AMOUNT, } from "@moonwall/util"; import { encodeFunctionData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; const proposalHash = "0xf3d039875302d49d52fb1af6877a2c46bc55b004afb8130f94dd9d0489ca3185"; diff --git a/test/suites/dev/test-precompile/test-precompile-proxy-leader-demo.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo.ts similarity index 96% rename from test/suites/dev/test-precompile/test-precompile-proxy-leader-demo.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo.ts index 7cf09e8ddf..952e420581 100644 --- a/test/suites/dev/test-precompile/test-precompile-proxy-leader-demo.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { BALTATHAR_ADDRESS, CHARLETH_ADDRESS, DOROTHY_ADDRESS, GLMR } from "@moonwall/util"; -import { setupPoolWithParticipants } from "../../../helpers"; +import { setupPoolWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2542", diff --git a/test/suites/dev/test-precompile/test-precompile-proxy-leader-demo2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo2.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-proxy-leader-demo2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo2.ts index b1db7ec053..014fa04775 100644 --- a/test/suites/dev/test-precompile/test-precompile-proxy-leader-demo2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo2.ts @@ -1,6 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { expectEVMResult, setupPoolWithParticipants } from "../../../helpers"; +import { expectEVMResult, setupPoolWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2543", diff --git a/test/suites/dev/test-precompile/test-precompile-proxy-leader-demo3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo3.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-proxy-leader-demo3.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo3.ts index c4d9d3daca..7dc9452058 100644 --- a/test/suites/dev/test-precompile/test-precompile-proxy-leader-demo3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo3.ts @@ -7,7 +7,7 @@ import { CHARLETH_ADDRESS, DOROTHY_ADDRESS, } from "@moonwall/util"; -import { setupPoolWithParticipants, expectEVMResult } from "../../../helpers"; +import { setupPoolWithParticipants, expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D2544", diff --git a/test/suites/dev/test-precompile/test-precompile-proxy-non-transfer.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-non-transfer.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-proxy-non-transfer.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-proxy-non-transfer.ts index b0ad2c9d9f..7acf5f86a7 100644 --- a/test/suites/dev/test-precompile/test-precompile-proxy-non-transfer.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-non-transfer.ts @@ -15,7 +15,7 @@ import { createViemTransaction, } from "@moonwall/util"; import { encodeFunctionData } from "viem"; -import { expectEVMResult, getAuthorMappingInfo } from "../../../helpers"; +import { expectEVMResult, getAuthorMappingInfo } from "../../../../helpers"; describeSuite({ id: "D2545", diff --git a/test/suites/dev/test-precompile/test-precompile-proxy-staking-demo.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo.ts similarity index 97% rename from test/suites/dev/test-precompile/test-precompile-proxy-staking-demo.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo.ts index fa574792b0..00cfeceeaa 100644 --- a/test/suites/dev/test-precompile/test-precompile-proxy-staking-demo.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo.ts @@ -10,7 +10,7 @@ import { ethan, } from "@moonwall/util"; import { nToHex } from "@polkadot/util"; -import { setupWithParticipants } from "../../../helpers"; +import { setupWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2546", diff --git a/test/suites/dev/test-precompile/test-precompile-proxy-staking-demo2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo2.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-proxy-staking-demo2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo2.ts index a1ea97f25e..bf6bd4279a 100644 --- a/test/suites/dev/test-precompile/test-precompile-proxy-staking-demo2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo2.ts @@ -13,7 +13,7 @@ import { ethan, } from "@moonwall/util"; import { nToHex } from "@polkadot/util"; -import { setupWithParticipants } from "../../../helpers"; +import { setupWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2547", diff --git a/test/suites/dev/test-precompile/test-precompile-proxy-staking-demo3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo3.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-proxy-staking-demo3.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo3.ts index 49f068e887..4cd5a8ad14 100644 --- a/test/suites/dev/test-precompile/test-precompile-proxy-staking-demo3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo3.ts @@ -11,7 +11,7 @@ import { ethan, } from "@moonwall/util"; import { nToHex } from "@polkadot/util"; -import { setupWithParticipants } from "../../../helpers"; +import { setupWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2548", diff --git a/test/suites/dev/test-precompile/test-precompile-proxy-staking-demo4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo4.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-proxy-staking-demo4.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo4.ts index 9f64f84dd1..3619ae0ac8 100644 --- a/test/suites/dev/test-precompile/test-precompile-proxy-staking-demo4.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo4.ts @@ -10,7 +10,7 @@ import { ethan, } from "@moonwall/util"; import { nToHex } from "@polkadot/util"; -import { setupWithParticipants } from "../../../helpers"; +import { setupWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2549", diff --git a/test/suites/dev/test-precompile/test-precompile-proxy.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-proxy.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-proxy.ts index 4dddb6354d..04d01bbf83 100644 --- a/test/suites/dev/test-precompile/test-precompile-proxy.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy.ts @@ -20,7 +20,7 @@ import { } from "@moonwall/util"; import { encodeFunctionData, parseEther } from "viem"; import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D2550", diff --git a/test/suites/dev/test-precompile/test-precompile-referenda-demo.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-referenda-demo.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-referenda-demo.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-referenda-demo.ts index e330ed7c0e..b646f7dbe4 100644 --- a/test/suites/dev/test-precompile/test-precompile-referenda-demo.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-referenda-demo.ts @@ -12,7 +12,7 @@ import { forceReducedReferendaExecution, expectSubstrateEvent, expectSubstrateEvents, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2551", diff --git a/test/suites/dev/test-precompile/test-precompile-referenda.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-referenda.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-referenda.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-referenda.ts index bc6999c912..a964a65ee2 100644 --- a/test/suites/dev/test-precompile/test-precompile-referenda.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-referenda.ts @@ -2,7 +2,12 @@ import "@moonbeam-network/api-augment"; import { beforeEach, describeSuite, expect, fetchCompiledContract } from "@moonwall/cli"; import { ALITH_ADDRESS, alith } from "@moonwall/util"; import { decodeEventLog } from "viem"; -import { Referenda, cancelProposal, expectEVMResult, expectSubstrateEvent } from "../../../helpers"; +import { + Referenda, + cancelProposal, + expectEVMResult, + expectSubstrateEvent, +} from "../../../../helpers"; // Each test is instantiating a new proposal (Not ideal for isolation but easier to write) describeSuite({ diff --git a/test/suites/dev/test-precompile/test-precompile-relay-encoder.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-relay-encoder.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-relay-encoder.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-relay-encoder.ts diff --git a/test/suites/dev/test-precompile/test-precompile-revert-attack.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-revert-attack.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-revert-attack.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-revert-attack.ts diff --git a/test/suites/dev/test-precompile/test-precompile-ripemd160.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-ripemd160.ts similarity index 95% rename from test/suites/dev/test-precompile/test-precompile-ripemd160.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-ripemd160.ts index 7d3007e579..9d4b54f2cc 100644 --- a/test/suites/dev/test-precompile/test-precompile-ripemd160.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-ripemd160.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { toHex } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D2555", diff --git a/test/suites/dev/test-precompile/test-precompile-sha3fips.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-sha3fips.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-sha3fips.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-sha3fips.ts diff --git a/test/suites/dev/test-precompile/test-precompile-smart-contract-call.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-smart-contract-call.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call.ts index 6353b7f86a..b1d00b89bd 100644 --- a/test/suites/dev/test-precompile/test-precompile-smart-contract-call.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call.ts @@ -9,7 +9,7 @@ import { } from "@moonwall/util"; import { nToHex } from "@polkadot/util"; import { encodeFunctionData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D2557", diff --git a/test/suites/dev/test-precompile/test-precompile-smart-contract-call2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call2.ts similarity index 97% rename from test/suites/dev/test-precompile/test-precompile-smart-contract-call2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call2.ts index e1a459d6ce..54550f92fa 100644 --- a/test/suites/dev/test-precompile/test-precompile-smart-contract-call2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call2.ts @@ -9,7 +9,7 @@ import { } from "@moonwall/util"; import { nToHex } from "@polkadot/util"; import { encodeFunctionData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D2558", diff --git a/test/suites/dev/test-precompile/test-precompile-smart-contract-call3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call3.ts similarity index 97% rename from test/suites/dev/test-precompile/test-precompile-smart-contract-call3.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call3.ts index 90b880178e..87d791d55d 100644 --- a/test/suites/dev/test-precompile/test-precompile-smart-contract-call3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call3.ts @@ -8,7 +8,7 @@ import { baltathar, } from "@moonwall/util"; import { encodeFunctionData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D2559", diff --git a/test/suites/dev/test-precompile/test-precompile-smart-contract-call4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call4.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-smart-contract-call4.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call4.ts index 82b734c0eb..08119f1346 100644 --- a/test/suites/dev/test-precompile/test-precompile-smart-contract-call4.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call4.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect, fetchCompiledContract } from "@moonwall/cli"; import { BALTATHAR_ADDRESS, baltathar } from "@moonwall/util"; import { encodeFunctionData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D2560", diff --git a/test/suites/dev/test-precompile/test-precompile-smart-contract-call5.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call5.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-smart-contract-call5.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call5.ts index 7075e84ee3..3b1da3f7e4 100644 --- a/test/suites/dev/test-precompile/test-precompile-smart-contract-call5.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call5.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect, fetchCompiledContract } from "@moonwall/cli"; import { encodeFunctionData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; describeSuite({ id: "D2561", diff --git a/test/suites/dev/test-precompile/test-precompile-staking.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-staking.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-staking.ts diff --git a/test/suites/dev/test-precompile/test-precompile-staking2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking2.ts similarity index 96% rename from test/suites/dev/test-precompile/test-precompile-staking2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-staking2.ts index 9145395ecd..6c31000304 100644 --- a/test/suites/dev/test-precompile/test-precompile-staking2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-staking2.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, ETHAN_ADDRESS, ETHAN_PRIVATE_KEY, MIN_GLMR_STAKING } from "@moonwall/util"; -import { verifyLatestBlockFees } from "../../../helpers"; +import { verifyLatestBlockFees } from "../../../../helpers"; describeSuite({ id: "D2563", diff --git a/test/suites/dev/test-precompile/test-precompile-staking3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking3.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-staking3.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-staking3.ts diff --git a/test/suites/dev/test-precompile/test-precompile-staking4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking4.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-staking4.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-staking4.ts diff --git a/test/suites/dev/test-precompile/test-precompile-staking5.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking5.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-staking5.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-staking5.ts diff --git a/test/suites/dev/test-precompile/test-precompile-staking6.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking6.ts similarity index 100% rename from test/suites/dev/test-precompile/test-precompile-staking6.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-staking6.ts diff --git a/test/suites/dev/test-precompile/test-precompile-wormhole.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-wormhole.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-wormhole.ts index c069325099..f9ed63440f 100644 --- a/test/suites/dev/test-precompile/test-precompile-wormhole.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole.ts @@ -12,7 +12,7 @@ import { genAssetMeta, genRegisterChainVAA, genTransferWithPayloadVAA, -} from "../../../helpers"; +} from "../../../../helpers"; /* Alphanet 2023-03-17 diff --git a/test/suites/dev/test-precompile/test-precompile-wormhole2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole2.ts similarity index 93% rename from test/suites/dev/test-precompile/test-precompile-wormhole2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-wormhole2.ts index 09c918690f..82717f5767 100644 --- a/test/suites/dev/test-precompile/test-precompile-wormhole2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole2.ts @@ -1,6 +1,6 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; -import { expectEVMResult, extractRevertReason } from "../../../helpers"; +import { expectEVMResult, extractRevertReason } from "../../../../helpers"; describeSuite({ id: "D2569", diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor.ts index 50ed228949..ece92df1df 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor.ts @@ -7,7 +7,7 @@ import { mockAssetBalance, verifyLatestBlockFees, registerXcmTransactorAndContract, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2570", diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor10.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor10.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor10.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor10.ts index 8a5c92d35b..f002ca5d82 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor10.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor10.ts @@ -10,7 +10,7 @@ import { registerForeignAsset, registerXcmTransactorAndContract, PRECOMPILE_XCM_TRANSACTOR_V3_ADDRESS, -} from "../../../helpers"; +} from "../../../../helpers"; const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor11.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor11.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor11.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor11.ts index 42aa8674ca..febc44ba3e 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor11.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor11.ts @@ -9,7 +9,7 @@ import { expectEVMResult, registerXcmTransactorDerivativeIndex, PRECOMPILE_XCM_TRANSACTOR_V3_ADDRESS, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2580", diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor12.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor12.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor12.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor12.ts index f090c74a92..25708f970c 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor12.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor12.ts @@ -9,7 +9,7 @@ import { expectEVMResult, registerXcmTransactorDerivativeIndex, PRECOMPILE_XCM_TRANSACTOR_V3_ADDRESS, -} from "../../../helpers"; +} from "../../../../helpers"; const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor2.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor2.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor2.ts index 9fcd68168b..c105aa08b3 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor2.ts @@ -8,7 +8,7 @@ import { verifyLatestBlockFees, expectEVMResult, registerXcmTransactorAndContract, -} from "../../../helpers"; +} from "../../../../helpers"; const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor3.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor3.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor3.ts index c5ec37f06f..bf66e7ac8a 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor3.ts @@ -8,7 +8,7 @@ import { expectEVMResult, registerForeignAsset, registerXcmTransactorAndContract, -} from "../../../helpers"; +} from "../../../../helpers"; const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor4.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor4.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor4.ts index 221fdd4f1b..01b7af749f 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor4.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor4.ts @@ -5,7 +5,7 @@ import { verifyLatestBlockFees, expectEVMResult, registerXcmTransactorAndContract, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2573", diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor5.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor5.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor5.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor5.ts index 4802e7c858..25224edd21 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor5.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor5.ts @@ -5,7 +5,7 @@ import { verifyLatestBlockFees, expectEVMResult, registerXcmTransactorAndContract, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2574", diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor6.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor6.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor6.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor6.ts index 8fbd0d5319..fabb356ab5 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor6.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor6.ts @@ -8,7 +8,7 @@ import { expectEVMResult, registerForeignAsset, registerXcmTransactorAndContract, -} from "../../../helpers"; +} from "../../../../helpers"; const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor7.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor7.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor7.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor7.ts index 9c355003d5..9478a450d4 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor7.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor7.ts @@ -8,7 +8,7 @@ import { verifyLatestBlockFees, expectEVMResult, registerXcmTransactorDerivativeIndex, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2576", diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor8.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor8.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor8.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor8.ts index db010d1a93..37fcdc5e7c 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor8.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor8.ts @@ -8,7 +8,7 @@ import { verifyLatestBlockFees, expectEVMResult, registerXcmTransactorDerivativeIndex, -} from "../../../helpers"; +} from "../../../../helpers"; const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-transactor9.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor9.ts similarity index 98% rename from test/suites/dev/test-precompile/test-precompile-xcm-transactor9.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor9.ts index ce2d1f7852..78dbf20af6 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-transactor9.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor9.ts @@ -7,7 +7,7 @@ import { expectEVMResult, registerXcmTransactorAndContract, PRECOMPILE_XCM_TRANSACTOR_V3_ADDRESS, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2578", diff --git a/test/suites/dev/test-precompile/test-precompile-xcm-utils.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-utils.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-xcm-utils.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xcm-utils.ts index be2506be37..8c37a40d77 100644 --- a/test/suites/dev/test-precompile/test-precompile-xcm-utils.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-utils.ts @@ -3,7 +3,7 @@ import { describeSuite, expect } from "@moonwall/cli"; import { GLMR, generateKeyringPair } from "@moonwall/util"; import { XcmVersionedXcm } from "@polkadot/types/lookup"; import { u8aToHex } from "@polkadot/util"; -import { expectEVMResult, descendOriginFromAddress20 } from "../../../helpers"; +import { expectEVMResult, descendOriginFromAddress20 } from "../../../../helpers"; export const CLEAR_ORIGIN_WEIGHT = 5_194_000n; diff --git a/test/suites/dev/test-precompile/test-precompile-xtokens.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xtokens.ts similarity index 99% rename from test/suites/dev/test-precompile/test-precompile-xtokens.ts rename to test/suites/dev/moonbase/test-precompile/test-precompile-xtokens.ts index c4b9513eea..28caeb1153 100644 --- a/test/suites/dev/test-precompile/test-precompile-xtokens.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xtokens.ts @@ -1,7 +1,11 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, GLMR, PRECOMPILES } from "@moonwall/util"; -import { verifyLatestBlockFees, expectEVMResult, DEFAULT_TXN_MAX_BASE_FEE } from "../../../helpers"; +import { + verifyLatestBlockFees, + expectEVMResult, + DEFAULT_TXN_MAX_BASE_FEE, +} from "../../../../helpers"; describeSuite({ id: "D2583", diff --git a/test/suites/dev/test-proxy/test-proxy-author-mapping.ts b/test/suites/dev/moonbase/test-proxy/test-proxy-author-mapping.ts similarity index 96% rename from test/suites/dev/test-proxy/test-proxy-author-mapping.ts rename to test/suites/dev/moonbase/test-proxy/test-proxy-author-mapping.ts index 9c5cc06e18..6fef2ea678 100644 --- a/test/suites/dev/test-proxy/test-proxy-author-mapping.ts +++ b/test/suites/dev/moonbase/test-proxy/test-proxy-author-mapping.ts @@ -6,7 +6,7 @@ import { BALTATHAR_SESSION_ADDRESS, baltathar, } from "@moonwall/util"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; describeSuite({ id: "D2601", diff --git a/test/suites/dev/test-proxy/test-proxy-balance.ts b/test/suites/dev/moonbase/test-proxy/test-proxy-balance.ts similarity index 98% rename from test/suites/dev/test-proxy/test-proxy-balance.ts rename to test/suites/dev/moonbase/test-proxy/test-proxy-balance.ts index 3563f279d7..5ff29e551d 100644 --- a/test/suites/dev/test-proxy/test-proxy-balance.ts +++ b/test/suites/dev/moonbase/test-proxy/test-proxy-balance.ts @@ -6,7 +6,7 @@ import { CHARLETH_ADDRESS, baltathar, } from "@moonwall/util"; -import { getMappingInfo } from "../../../helpers"; +import { getMappingInfo } from "../../../../helpers"; describeSuite({ id: "D2602", diff --git a/test/suites/dev/test-proxy/test-proxy-for-contracts.ts b/test/suites/dev/moonbase/test-proxy/test-proxy-for-contracts.ts similarity index 100% rename from test/suites/dev/test-proxy/test-proxy-for-contracts.ts rename to test/suites/dev/moonbase/test-proxy/test-proxy-for-contracts.ts diff --git a/test/suites/dev/test-proxy/test-proxy-governance.ts b/test/suites/dev/moonbase/test-proxy/test-proxy-governance.ts similarity index 100% rename from test/suites/dev/test-proxy/test-proxy-governance.ts rename to test/suites/dev/moonbase/test-proxy/test-proxy-governance.ts diff --git a/test/suites/dev/test-proxy/test-proxy-identity.ts b/test/suites/dev/moonbase/test-proxy/test-proxy-identity.ts similarity index 100% rename from test/suites/dev/test-proxy/test-proxy-identity.ts rename to test/suites/dev/moonbase/test-proxy/test-proxy-identity.ts diff --git a/test/suites/dev/test-proxy/test-proxy.ts b/test/suites/dev/moonbase/test-proxy/test-proxy.ts similarity index 100% rename from test/suites/dev/test-proxy/test-proxy.ts rename to test/suites/dev/moonbase/test-proxy/test-proxy.ts diff --git a/test/suites/dev/test-randomness/test-randomness-babe-lottery.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery.ts similarity index 98% rename from test/suites/dev/test-randomness/test-randomness-babe-lottery.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery.ts index e4f06e6b5e..b1a7bce01a 100644 --- a/test/suites/dev/test-randomness/test-randomness-babe-lottery.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment/moonbase"; import { beforeEach, describeSuite, expect } from "@moonwall/cli"; import { GLMR } from "@moonwall/util"; -import { expectEVMResult, setupLotteryWithParticipants } from "../../../helpers"; +import { expectEVMResult, setupLotteryWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2701", diff --git a/test/suites/dev/test-randomness/test-randomness-babe-lottery2.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery2.ts similarity index 99% rename from test/suites/dev/test-randomness/test-randomness-babe-lottery2.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery2.ts index 9c232c0bad..6314e7ae2c 100644 --- a/test/suites/dev/test-randomness/test-randomness-babe-lottery2.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery2.ts @@ -14,7 +14,7 @@ import { TransactionReceipt, decodeEventLog } from "viem"; import { fakeBabeResultTransaction, setupLotteryWithParticipants, -} from "../../../helpers/randomness.js"; +} from "../../../../helpers/randomness.js"; describeSuite({ id: "D2702", diff --git a/test/suites/dev/test-randomness/test-randomness-babe-lottery3.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery3.ts similarity index 96% rename from test/suites/dev/test-randomness/test-randomness-babe-lottery3.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery3.ts index 79b5385c77..97f0a0b560 100644 --- a/test/suites/dev/test-randomness/test-randomness-babe-lottery3.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery3.ts @@ -7,11 +7,11 @@ import { createViemTransaction, } from "@moonwall/util"; import { encodeFunctionData } from "viem"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; import { fakeBabeResultTransaction, setupLotteryWithParticipants, -} from "../../../helpers/randomness.js"; +} from "../../../../helpers/randomness.js"; describeSuite({ id: "D2703", diff --git a/test/suites/dev/test-randomness/test-randomness-babe-request.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-request.ts similarity index 96% rename from test/suites/dev/test-randomness/test-randomness-babe-request.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-babe-request.ts index 846a1216e3..79f3b6309a 100644 --- a/test/suites/dev/test-randomness/test-randomness-babe-request.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-request.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { CONTRACT_RANDOMNESS_STATUS_DOES_NOT_EXISTS, GLMR, alith } from "@moonwall/util"; -import { SIMPLE_SALT } from "../../../helpers"; +import { SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2704", diff --git a/test/suites/dev/test-randomness/test-randomness-babe-request2.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-request2.ts similarity index 98% rename from test/suites/dev/test-randomness/test-randomness-babe-request2.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-babe-request2.ts index 72776f7a70..6ef6bc8fac 100644 --- a/test/suites/dev/test-randomness/test-randomness-babe-request2.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-request2.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { GLMR, alith } from "@moonwall/util"; -import { SIMPLE_SALT } from "../../../helpers"; +import { SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2705", diff --git a/test/suites/dev/test-randomness/test-randomness-babe-request3.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-request3.ts similarity index 95% rename from test/suites/dev/test-randomness/test-randomness-babe-request3.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-babe-request3.ts index 0d6cbf5a3a..fc3b55023d 100644 --- a/test/suites/dev/test-randomness/test-randomness-babe-request3.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-babe-request3.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { GLMR, alith } from "@moonwall/util"; -import { SIMPLE_SALT } from "../../../helpers"; +import { SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2706", diff --git a/test/suites/dev/test-randomness/test-randomness-result.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-result.ts similarity index 98% rename from test/suites/dev/test-randomness/test-randomness-result.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-result.ts index 157e4c5eb6..07acdd9375 100644 --- a/test/suites/dev/test-randomness/test-randomness-result.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-result.ts @@ -10,7 +10,7 @@ import { } from "@moonwall/util"; import { Option } from "@polkadot/types"; import { PalletRandomnessRandomnessResult } from "@polkadot/types/lookup"; -import { SIMPLE_SALT } from "../../../helpers"; +import { SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2707", diff --git a/test/suites/dev/test-randomness/test-randomness-result2.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-result2.ts similarity index 97% rename from test/suites/dev/test-randomness/test-randomness-result2.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-result2.ts index a8ef639d47..a12bebade0 100644 --- a/test/suites/dev/test-randomness/test-randomness-result2.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-result2.ts @@ -9,7 +9,7 @@ import { } from "@moonwall/util"; import { Option } from "@polkadot/types"; import { PalletRandomnessRandomnessResult } from "@polkadot/types/lookup"; -import { jumpBlocks, SIMPLE_SALT } from "../../../helpers"; +import { jumpBlocks, SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2708", diff --git a/test/suites/dev/test-randomness/test-randomness-result3.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-result3.ts similarity index 96% rename from test/suites/dev/test-randomness/test-randomness-result3.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-result3.ts index 7452266ed6..98b2fb3edb 100644 --- a/test/suites/dev/test-randomness/test-randomness-result3.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-result3.ts @@ -7,7 +7,7 @@ import { GLMR, alith, } from "@moonwall/util"; -import { jumpBlocks, SIMPLE_SALT } from "../../../helpers"; +import { jumpBlocks, SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2709", diff --git a/test/suites/dev/test-randomness/test-randomness-result4.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-result4.ts similarity index 95% rename from test/suites/dev/test-randomness/test-randomness-result4.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-result4.ts index c1c3b5622a..8ebf4637aa 100644 --- a/test/suites/dev/test-randomness/test-randomness-result4.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-result4.ts @@ -3,7 +3,7 @@ import { describeSuite, expect } from "@moonwall/cli"; import { ALITH_PRIVATE_KEY, GLMR, alith } from "@moonwall/util"; import { Option } from "@polkadot/types"; import { PalletRandomnessRandomnessResult } from "@polkadot/types/lookup"; -import { jumpBlocks, SIMPLE_SALT } from "../../../helpers"; +import { jumpBlocks, SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2710", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-lottery.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery.ts similarity index 94% rename from test/suites/dev/test-randomness/test-randomness-vrf-lottery.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery.ts index fd2b12d739..f69e78d4d7 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-lottery.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { GLMR } from "@moonwall/util"; -import { setupLotteryWithParticipants } from "../../../helpers"; +import { setupLotteryWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2711", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-lottery2.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery2.ts similarity index 98% rename from test/suites/dev/test-randomness/test-randomness-vrf-lottery2.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery2.ts index 9e48f85b20..676076033e 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-lottery2.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery2.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite } from "@moonwall/cli"; import { GLMR } from "@moonwall/util"; -import { expectEVMResult, setupLotteryWithParticipants } from "../../../helpers"; +import { expectEVMResult, setupLotteryWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2712", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-lottery3.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery3.ts similarity index 98% rename from test/suites/dev/test-randomness/test-randomness-vrf-lottery3.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery3.ts index 51a2238001..25293e26cb 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-lottery3.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery3.ts @@ -5,7 +5,7 @@ import { expectEVMResult, extractRevertReason, setupLotteryWithParticipants, -} from "../../../helpers"; +} from "../../../../helpers"; describeSuite({ id: "D2713", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-lottery4.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery4.ts similarity index 98% rename from test/suites/dev/test-randomness/test-randomness-vrf-lottery4.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery4.ts index 35195f26cd..a9d5bddfef 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-lottery4.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery4.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite } from "@moonwall/cli"; import { GLMR } from "@moonwall/util"; -import { expectEVMResult, setupLotteryWithParticipants } from "../../../helpers"; +import { expectEVMResult, setupLotteryWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2714", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-lottery5.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery5.ts similarity index 98% rename from test/suites/dev/test-randomness/test-randomness-vrf-lottery5.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery5.ts index b9208de734..1bdb4d3889 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-lottery5.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery5.ts @@ -9,7 +9,7 @@ import { MILLIGLMR, } from "@moonwall/util"; import { TransactionReceipt, decodeEventLog } from "viem"; -import { setupLotteryWithParticipants } from "../../../helpers"; +import { setupLotteryWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2715", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-lottery6.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery6.ts similarity index 97% rename from test/suites/dev/test-randomness/test-randomness-vrf-lottery6.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery6.ts index 2318d56f62..5528023148 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-lottery6.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery6.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { GLMR } from "@moonwall/util"; import { TransactionReceipt } from "viem"; -import { setupLotteryWithParticipants } from "../../../helpers"; +import { setupLotteryWithParticipants } from "../../../../helpers"; describeSuite({ id: "D2716", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-request.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request.ts similarity index 95% rename from test/suites/dev/test-randomness/test-randomness-vrf-request.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request.ts index 101170ac79..b86c0ed6c5 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-request.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment/moonbase"; import { describeSuite, expect } from "@moonwall/cli"; import { GLMR, alith } from "@moonwall/util"; -import { SIMPLE_SALT } from "../../../helpers"; +import { SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2717", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-request2.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request2.ts similarity index 98% rename from test/suites/dev/test-randomness/test-randomness-vrf-request2.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request2.ts index 932e83eb3e..674059754f 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-request2.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request2.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment/moonbase"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { GLMR, alith } from "@moonwall/util"; -import { SIMPLE_SALT } from "../../../helpers"; +import { SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2718", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-request3.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request3.ts similarity index 99% rename from test/suites/dev/test-randomness/test-randomness-vrf-request3.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request3.ts index e39e8f5ffd..6a9a2c8c0c 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-request3.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request3.ts @@ -7,7 +7,7 @@ import { GLMR, alith, } from "@moonwall/util"; -import { expectEVMResult, extractRevertReason, SIMPLE_SALT, jumpBlocks } from "../../../helpers"; +import { expectEVMResult, extractRevertReason, SIMPLE_SALT, jumpBlocks } from "../../../../helpers"; describeSuite({ id: "D2719", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-request4.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request4.ts similarity index 96% rename from test/suites/dev/test-randomness/test-randomness-vrf-request4.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request4.ts index fa6939a2e0..1e79cddfc9 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-request4.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request4.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment/moonbase"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { GLMR, alith } from "@moonwall/util"; -import { SIMPLE_SALT } from "../../../helpers"; +import { SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2720", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-request5.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request5.ts similarity index 96% rename from test/suites/dev/test-randomness/test-randomness-vrf-request5.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request5.ts index 2c5b4cdc6f..9ff0a4357e 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-request5.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request5.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment/moonbase"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { GLMR, alith } from "@moonwall/util"; -import { SIMPLE_SALT } from "../../../helpers"; +import { SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2721", diff --git a/test/suites/dev/test-randomness/test-randomness-vrf-request6.ts b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request6.ts similarity index 97% rename from test/suites/dev/test-randomness/test-randomness-vrf-request6.ts rename to test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request6.ts index d6938a45e8..9992522300 100644 --- a/test/suites/dev/test-randomness/test-randomness-vrf-request6.ts +++ b/test/suites/dev/moonbase/test-randomness/test-randomness-vrf-request6.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment/moonbase"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { GLMR, alith } from "@moonwall/util"; -import { SIMPLE_SALT } from "../../../helpers"; +import { SIMPLE_SALT } from "../../../../helpers"; describeSuite({ id: "D2722", diff --git a/test/suites/dev/test-receipt/test-receipt-revert.ts b/test/suites/dev/moonbase/test-receipt/test-receipt-revert.ts similarity index 100% rename from test/suites/dev/test-receipt/test-receipt-revert.ts rename to test/suites/dev/moonbase/test-receipt/test-receipt-revert.ts diff --git a/test/suites/dev/test-receipt/test-receipt-root.ts b/test/suites/dev/moonbase/test-receipt/test-receipt-root.ts similarity index 100% rename from test/suites/dev/test-receipt/test-receipt-root.ts rename to test/suites/dev/moonbase/test-receipt/test-receipt-root.ts diff --git a/test/suites/dev/test-receipt/test-receipt.ts b/test/suites/dev/moonbase/test-receipt/test-receipt.ts similarity index 100% rename from test/suites/dev/test-receipt/test-receipt.ts rename to test/suites/dev/moonbase/test-receipt/test-receipt.ts diff --git a/test/suites/dev/test-staking/test-candidate-force-join.ts b/test/suites/dev/moonbase/test-staking/test-candidate-force-join.ts similarity index 100% rename from test/suites/dev/test-staking/test-candidate-force-join.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-force-join.ts diff --git a/test/suites/dev/test-staking/test-candidate-join.ts b/test/suites/dev/moonbase/test-staking/test-candidate-join.ts similarity index 100% rename from test/suites/dev/test-staking/test-candidate-join.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-join.ts diff --git a/test/suites/dev/test-staking/test-candidate-join2.ts b/test/suites/dev/moonbase/test-staking/test-candidate-join2.ts similarity index 100% rename from test/suites/dev/test-staking/test-candidate-join2.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-join2.ts diff --git a/test/suites/dev/test-staking/test-candidate-join3.ts b/test/suites/dev/moonbase/test-staking/test-candidate-join3.ts similarity index 100% rename from test/suites/dev/test-staking/test-candidate-join3.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-join3.ts diff --git a/test/suites/dev/test-staking/test-candidate-leave.ts b/test/suites/dev/moonbase/test-staking/test-candidate-leave.ts similarity index 100% rename from test/suites/dev/test-staking/test-candidate-leave.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-leave.ts diff --git a/test/suites/dev/test-staking/test-candidate-leave2.ts b/test/suites/dev/moonbase/test-staking/test-candidate-leave2.ts similarity index 100% rename from test/suites/dev/test-staking/test-candidate-leave2.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-leave2.ts diff --git a/test/suites/dev/test-staking/test-candidate-leave3.ts b/test/suites/dev/moonbase/test-staking/test-candidate-leave3.ts similarity index 100% rename from test/suites/dev/test-staking/test-candidate-leave3.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-leave3.ts diff --git a/test/suites/dev/test-staking/test-candidate-leave4.ts b/test/suites/dev/moonbase/test-staking/test-candidate-leave4.ts similarity index 96% rename from test/suites/dev/test-staking/test-candidate-leave4.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-leave4.ts index 32a0e3b0be..52cd96edb5 100644 --- a/test/suites/dev/test-staking/test-candidate-leave4.ts +++ b/test/suites/dev/moonbase/test-staking/test-candidate-leave4.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_STAKING, alith, ethan } from "@moonwall/util"; -import { jumpRounds } from "../../../helpers"; +import { jumpRounds } from "../../../../helpers"; describeSuite({ id: "D2907", diff --git a/test/suites/dev/test-staking/test-candidate-leave5.ts b/test/suites/dev/moonbase/test-staking/test-candidate-leave5.ts similarity index 97% rename from test/suites/dev/test-staking/test-candidate-leave5.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-leave5.ts index ba67f63ff3..5cd668da2e 100644 --- a/test/suites/dev/test-staking/test-candidate-leave5.ts +++ b/test/suites/dev/moonbase/test-staking/test-candidate-leave5.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_STAKING, alith, ethan } from "@moonwall/util"; -import { jumpRounds } from "../../../helpers"; +import { jumpRounds } from "../../../../helpers"; describeSuite({ id: "D2908", diff --git a/test/suites/dev/test-staking/test-candidate-leave6.ts b/test/suites/dev/moonbase/test-staking/test-candidate-leave6.ts similarity index 97% rename from test/suites/dev/test-staking/test-candidate-leave6.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-leave6.ts index 0e9f0fbf5a..54713264a8 100644 --- a/test/suites/dev/test-staking/test-candidate-leave6.ts +++ b/test/suites/dev/moonbase/test-staking/test-candidate-leave6.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_STAKING, alith, ethan } from "@moonwall/util"; -import { jumpRounds } from "../../../helpers"; +import { jumpRounds } from "../../../../helpers"; describeSuite({ id: "D2909", diff --git a/test/suites/dev/test-staking/test-candidate-leave7.ts b/test/suites/dev/moonbase/test-staking/test-candidate-leave7.ts similarity index 100% rename from test/suites/dev/test-staking/test-candidate-leave7.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-leave7.ts diff --git a/test/suites/dev/test-staking/test-candidate-leave8.ts b/test/suites/dev/moonbase/test-staking/test-candidate-leave8.ts similarity index 100% rename from test/suites/dev/test-staking/test-candidate-leave8.ts rename to test/suites/dev/moonbase/test-staking/test-candidate-leave8.ts diff --git a/test/suites/dev/test-staking/test-delegate-with-auto-compound.ts b/test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegate-with-auto-compound.ts rename to test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound.ts diff --git a/test/suites/dev/test-staking/test-delegate-with-auto-compound2.ts b/test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound2.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegate-with-auto-compound2.ts rename to test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound2.ts diff --git a/test/suites/dev/test-staking/test-delegate-with-auto-compound3.ts b/test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound3.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegate-with-auto-compound3.ts rename to test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound3.ts diff --git a/test/suites/dev/test-staking/test-delegate-with-auto-compound4.ts b/test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound4.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegate-with-auto-compound4.ts rename to test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound4.ts diff --git a/test/suites/dev/test-staking/test-delegate-with-auto-compound5.ts b/test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound5.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegate-with-auto-compound5.ts rename to test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound5.ts diff --git a/test/suites/dev/test-staking/test-delegate-with-auto-compound6.ts b/test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound6.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegate-with-auto-compound6.ts rename to test/suites/dev/moonbase/test-staking/test-delegate-with-auto-compound6.ts diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests.ts diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests10-bondless-collator.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests10-bondless-collator.ts similarity index 97% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests10-bondless-collator.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests10-bondless-collator.ts index af57b0149d..eadc9d082f 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests10-bondless-collator.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests10-bondless-collator.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers/block.js"; +import { jumpToRound } from "../../../../helpers/block.js"; describeSuite({ id: "D2999", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests10.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests10.ts similarity index 98% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests10.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests10.ts index a297f5776e..d9f82afa98 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests10.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests10.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, MIN_GLMR_STAKING, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers"; +import { jumpToRound } from "../../../../helpers"; describeSuite({ id: "D2931", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests11-bondless-collator.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests11-bondless-collator.ts similarity index 97% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests11-bondless-collator.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests11-bondless-collator.ts index 584810c506..6bf976fb3d 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests11-bondless-collator.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests11-bondless-collator.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers/block.js"; +import { jumpToRound } from "../../../../helpers/block.js"; describeSuite({ id: "D3000", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests11.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests11.ts similarity index 98% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests11.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests11.ts index c8fe59112d..5d241d6175 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests11.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests11.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, MIN_GLMR_STAKING, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers"; +import { jumpToRound } from "../../../../helpers"; describeSuite({ id: "D2932", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests12-bondless-collator.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests12-bondless-collator.ts similarity index 98% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests12-bondless-collator.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests12-bondless-collator.ts index 4fb6964d32..38aaef0fbc 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests12-bondless-collator.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests12-bondless-collator.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers/block.js"; +import { jumpToRound } from "../../../../helpers/block.js"; describeSuite({ id: "D3001", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests12.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests12.ts similarity index 98% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests12.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests12.ts index 75e6c21aa9..02a5de3ff8 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests12.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests12.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, MIN_GLMR_STAKING, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers"; +import { jumpToRound } from "../../../../helpers"; describeSuite({ id: "D2933", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests2.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests2.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests2.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests2.ts diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests3.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests3.ts similarity index 96% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests3.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests3.ts index 3fdeda7a66..8d43e37d32 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests3.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests3.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers"; +import { jumpToRound } from "../../../../helpers"; describeSuite({ id: "D2924", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests4-bondless-collator.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests4-bondless-collator.ts similarity index 97% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests4-bondless-collator.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests4-bondless-collator.ts index 39e743843a..dd9e920a2e 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests4-bondless-collator.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests4-bondless-collator.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers/block.js"; +import { jumpToRound } from "../../../../helpers/block.js"; describeSuite({ id: "D2993", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests4.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests4.ts similarity index 97% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests4.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests4.ts index dddeca7cd8..d6484cd10d 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests4.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests4.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, MIN_GLMR_STAKING, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers"; +import { jumpToRound } from "../../../../helpers"; describeSuite({ id: "D2925", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests5-bondless-collator.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests5-bondless-collator.ts similarity index 97% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests5-bondless-collator.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests5-bondless-collator.ts index 514483b920..fe385b7acd 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests5-bondless-collator.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests5-bondless-collator.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers/block.js"; +import { jumpToRound } from "../../../../helpers/block.js"; describeSuite({ id: "D2994", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests5.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests5.ts similarity index 97% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests5.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests5.ts index 70357ba929..1a18dbcdce 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests5.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests5.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, MIN_GLMR_STAKING, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers"; +import { jumpToRound } from "../../../../helpers"; describeSuite({ id: "D2926", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests6-bondless-collator.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests6-bondless-collator.ts similarity index 96% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests6-bondless-collator.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests6-bondless-collator.ts index b57f3853df..ca1bc7bb9c 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests6-bondless-collator.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests6-bondless-collator.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers/block.js"; +import { jumpToRound } from "../../../../helpers/block.js"; describeSuite({ id: "D2995", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests6.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests6.ts similarity index 97% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests6.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests6.ts index d52a558bb2..9613c2f7b1 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests6.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests6.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers"; +import { jumpToRound } from "../../../../helpers"; describeSuite({ id: "D2927", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests7-bondless-collator.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests7-bondless-collator.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests7-bondless-collator.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests7-bondless-collator.ts diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests7.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests7.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests7.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests7.ts diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests8-bondless-collator.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests8-bondless-collator.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests8-bondless-collator.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests8-bondless-collator.ts diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests8.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests8.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests8.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests8.ts diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests9-bondless-collator.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests9-bondless-collator.ts similarity index 96% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests9-bondless-collator.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests9-bondless-collator.ts index 1e49978f59..bdeeab20b8 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests9-bondless-collator.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests9-bondless-collator.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers/block.js"; +import { jumpToRound } from "../../../../helpers/block.js"; describeSuite({ id: "D2998", diff --git a/test/suites/dev/test-staking/test-delegation-scheduled-requests9.ts b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests9.ts similarity index 97% rename from test/suites/dev/test-staking/test-delegation-scheduled-requests9.ts rename to test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests9.ts index ed3d724693..32df723c61 100644 --- a/test/suites/dev/test-staking/test-delegation-scheduled-requests9.ts +++ b/test/suites/dev/moonbase/test-staking/test-delegation-scheduled-requests9.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, beforeAll, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, ethan } from "@moonwall/util"; -import { jumpToRound } from "../../../helpers"; +import { jumpToRound } from "../../../../helpers"; describeSuite({ id: "D2930", diff --git a/test/suites/dev/test-staking/test-delegator-bond-more.ts b/test/suites/dev/moonbase/test-staking/test-delegator-bond-more.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegator-bond-more.ts rename to test/suites/dev/moonbase/test-staking/test-delegator-bond-more.ts diff --git a/test/suites/dev/test-staking/test-delegator-bond-more2.ts b/test/suites/dev/moonbase/test-staking/test-delegator-bond-more2.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegator-bond-more2.ts rename to test/suites/dev/moonbase/test-staking/test-delegator-bond-more2.ts diff --git a/test/suites/dev/test-staking/test-delegator-bond-more3.ts b/test/suites/dev/moonbase/test-staking/test-delegator-bond-more3.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegator-bond-more3.ts rename to test/suites/dev/moonbase/test-staking/test-delegator-bond-more3.ts diff --git a/test/suites/dev/test-staking/test-delegator-join.ts b/test/suites/dev/moonbase/test-staking/test-delegator-join.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegator-join.ts rename to test/suites/dev/moonbase/test-staking/test-delegator-join.ts diff --git a/test/suites/dev/test-staking/test-delegator-join2.ts b/test/suites/dev/moonbase/test-staking/test-delegator-join2.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegator-join2.ts rename to test/suites/dev/moonbase/test-staking/test-delegator-join2.ts diff --git a/test/suites/dev/test-staking/test-delegator-join3.ts b/test/suites/dev/moonbase/test-staking/test-delegator-join3.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegator-join3.ts rename to test/suites/dev/moonbase/test-staking/test-delegator-join3.ts diff --git a/test/suites/dev/test-staking/test-delegator-join4.ts b/test/suites/dev/moonbase/test-staking/test-delegator-join4.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegator-join4.ts rename to test/suites/dev/moonbase/test-staking/test-delegator-join4.ts diff --git a/test/suites/dev/test-staking/test-delegator-join5.ts b/test/suites/dev/moonbase/test-staking/test-delegator-join5.ts similarity index 100% rename from test/suites/dev/test-staking/test-delegator-join5.ts rename to test/suites/dev/moonbase/test-staking/test-delegator-join5.ts diff --git a/test/suites/dev/test-staking/test-genesis.ts b/test/suites/dev/moonbase/test-staking/test-genesis.ts similarity index 100% rename from test/suites/dev/test-staking/test-genesis.ts rename to test/suites/dev/moonbase/test-staking/test-genesis.ts diff --git a/test/suites/dev/test-staking/test-parachain-bond.ts b/test/suites/dev/moonbase/test-staking/test-parachain-bond.ts similarity index 100% rename from test/suites/dev/test-staking/test-parachain-bond.ts rename to test/suites/dev/moonbase/test-staking/test-parachain-bond.ts diff --git a/test/suites/dev/test-staking/test-rewards-auto-compound-pov.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound-pov.ts similarity index 98% rename from test/suites/dev/test-staking/test-rewards-auto-compound-pov.ts rename to test/suites/dev/moonbase/test-staking/test-rewards-auto-compound-pov.ts index 99b085b49c..b1239f64d6 100644 --- a/test/suites/dev/test-staking/test-rewards-auto-compound-pov.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound-pov.ts @@ -8,7 +8,7 @@ import { alith, generateKeyringPair, } from "@moonwall/util"; -import { chunk, jumpRounds } from "../../../helpers"; +import { chunk, jumpRounds } from "../../../../helpers"; describeSuite({ id: "D3542", diff --git a/test/suites/dev/test-staking/test-rewards-auto-compound.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound.ts similarity index 98% rename from test/suites/dev/test-staking/test-rewards-auto-compound.ts rename to test/suites/dev/moonbase/test-staking/test-rewards-auto-compound.ts index 4d0d7441b1..49db1c0930 100644 --- a/test/suites/dev/test-staking/test-rewards-auto-compound.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, ethan } from "@moonwall/util"; -import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../helpers"; +import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../../helpers"; describeSuite({ id: "D2954", diff --git a/test/suites/dev/test-staking/test-rewards-auto-compound10.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound10.ts similarity index 99% rename from test/suites/dev/test-staking/test-rewards-auto-compound10.ts rename to test/suites/dev/moonbase/test-staking/test-rewards-auto-compound10.ts index 4088f26f78..edf187adc7 100644 --- a/test/suites/dev/test-staking/test-rewards-auto-compound10.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound10.ts @@ -10,7 +10,7 @@ import { ethan, generateKeyringPair, } from "@moonwall/util"; -import { chunk } from "../../../helpers"; +import { chunk } from "../../../../helpers"; describeSuite({ id: "D2963", diff --git a/test/suites/dev/test-staking/test-rewards-auto-compound2.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound2.ts similarity index 98% rename from test/suites/dev/test-staking/test-rewards-auto-compound2.ts rename to test/suites/dev/moonbase/test-staking/test-rewards-auto-compound2.ts index 9c5d514000..eb47d95fac 100644 --- a/test/suites/dev/test-staking/test-rewards-auto-compound2.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound2.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, ethan } from "@moonwall/util"; -import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../helpers"; +import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../../helpers"; describeSuite({ id: "D2955", diff --git a/test/suites/dev/test-staking/test-rewards-auto-compound3.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound3.ts similarity index 99% rename from test/suites/dev/test-staking/test-rewards-auto-compound3.ts rename to test/suites/dev/moonbase/test-staking/test-rewards-auto-compound3.ts index 985b3c6026..12ee214b13 100644 --- a/test/suites/dev/test-staking/test-rewards-auto-compound3.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound3.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, Percent, alith, ethan } from "@moonwall/util"; -import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../helpers"; +import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../../helpers"; describeSuite({ id: "D2956", diff --git a/test/suites/dev/test-staking/test-rewards-auto-compound4.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound4.ts similarity index 99% rename from test/suites/dev/test-staking/test-rewards-auto-compound4.ts rename to test/suites/dev/moonbase/test-staking/test-rewards-auto-compound4.ts index 517dcaffbf..e22e1e16bd 100644 --- a/test/suites/dev/test-staking/test-rewards-auto-compound4.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound4.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, Percent, alith, ethan } from "@moonwall/util"; -import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../helpers"; +import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../../helpers"; describeSuite({ id: "D2957", diff --git a/test/suites/dev/test-staking/test-rewards-auto-compound5.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound5.ts similarity index 99% rename from test/suites/dev/test-staking/test-rewards-auto-compound5.ts rename to test/suites/dev/moonbase/test-staking/test-rewards-auto-compound5.ts index 9bc5bc8163..5f55fa676c 100644 --- a/test/suites/dev/test-staking/test-rewards-auto-compound5.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound5.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, ethan } from "@moonwall/util"; -import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../helpers"; +import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../../helpers"; describeSuite({ id: "D2958", diff --git a/test/suites/dev/test-staking/test-rewards-auto-compound6.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound6.ts similarity index 99% rename from test/suites/dev/test-staking/test-rewards-auto-compound6.ts rename to test/suites/dev/moonbase/test-staking/test-rewards-auto-compound6.ts index ce163daac4..35c2e443ae 100644 --- a/test/suites/dev/test-staking/test-rewards-auto-compound6.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound6.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, ethan } from "@moonwall/util"; -import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../helpers"; +import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../../helpers"; describeSuite({ id: "D2959", diff --git a/test/suites/dev/test-staking/test-rewards-auto-compound7.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound7.ts similarity index 99% rename from test/suites/dev/test-staking/test-rewards-auto-compound7.ts rename to test/suites/dev/moonbase/test-staking/test-rewards-auto-compound7.ts index 1d2e61beb6..3e81a00481 100644 --- a/test/suites/dev/test-staking/test-rewards-auto-compound7.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound7.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith, ethan } from "@moonwall/util"; -import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../helpers"; +import { jumpRounds, getRewardedAndCompoundedEvents } from "../../../../helpers"; describeSuite({ id: "D2960", diff --git a/test/suites/dev/test-staking/test-rewards-auto-compound8.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound8.ts similarity index 98% rename from test/suites/dev/test-staking/test-rewards-auto-compound8.ts rename to test/suites/dev/moonbase/test-staking/test-rewards-auto-compound8.ts index f75ab79689..c685682400 100644 --- a/test/suites/dev/test-staking/test-rewards-auto-compound8.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound8.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, MIN_GLMR_STAKING, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpRounds } from "../../../helpers"; +import { jumpRounds } from "../../../../helpers"; describeSuite({ id: "D2961", diff --git a/test/suites/dev/test-staking/test-rewards-auto-compound9.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound9.ts similarity index 98% rename from test/suites/dev/test-staking/test-rewards-auto-compound9.ts rename to test/suites/dev/moonbase/test-staking/test-rewards-auto-compound9.ts index a507412f17..9c1dada4e5 100644 --- a/test/suites/dev/test-staking/test-rewards-auto-compound9.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound9.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, MIN_GLMR_STAKING, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpRounds } from "../../../helpers"; +import { jumpRounds } from "../../../../helpers"; describeSuite({ id: "D2962", diff --git a/test/suites/dev/test-staking/test-rewards.ts b/test/suites/dev/moonbase/test-staking/test-rewards.ts similarity index 97% rename from test/suites/dev/test-staking/test-rewards.ts rename to test/suites/dev/moonbase/test-staking/test-rewards.ts index c692043703..e01490e4c8 100644 --- a/test/suites/dev/test-staking/test-rewards.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_STAKING, alith, ethan } from "@moonwall/util"; -import { jumpRounds } from "../../../helpers"; +import { jumpRounds } from "../../../../helpers"; describeSuite({ id: "D2964", diff --git a/test/suites/dev/test-staking/test-rewards2.ts b/test/suites/dev/moonbase/test-staking/test-rewards2.ts similarity index 97% rename from test/suites/dev/test-staking/test-rewards2.ts rename to test/suites/dev/moonbase/test-staking/test-rewards2.ts index 1839732d99..53fa0f8dac 100644 --- a/test/suites/dev/test-staking/test-rewards2.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards2.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_STAKING, alith, ethan } from "@moonwall/util"; -import { jumpRounds } from "../../../helpers"; +import { jumpRounds } from "../../../../helpers"; describeSuite({ id: "D2965", diff --git a/test/suites/dev/test-staking/test-rewards3.ts b/test/suites/dev/moonbase/test-staking/test-rewards3.ts similarity index 97% rename from test/suites/dev/test-staking/test-rewards3.ts rename to test/suites/dev/moonbase/test-staking/test-rewards3.ts index ac6ad471b1..d0c1544aee 100644 --- a/test/suites/dev/test-staking/test-rewards3.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards3.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_STAKING, alith, ethan } from "@moonwall/util"; -import { jumpRounds } from "../../../helpers"; +import { jumpRounds } from "../../../../helpers"; describeSuite({ id: "D2966", diff --git a/test/suites/dev/test-staking/test-rewards4.ts b/test/suites/dev/moonbase/test-staking/test-rewards4.ts similarity index 98% rename from test/suites/dev/test-staking/test-rewards4.ts rename to test/suites/dev/moonbase/test-staking/test-rewards4.ts index 794897514b..2a526c00ac 100644 --- a/test/suites/dev/test-staking/test-rewards4.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards4.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_STAKING, alith, baltathar, ethan } from "@moonwall/util"; -import { jumpRounds } from "../../../helpers"; +import { jumpRounds } from "../../../../helpers"; describeSuite({ id: "D2967", diff --git a/test/suites/dev/test-staking/test-set-auto-compound.ts b/test/suites/dev/moonbase/test-staking/test-set-auto-compound.ts similarity index 100% rename from test/suites/dev/test-staking/test-set-auto-compound.ts rename to test/suites/dev/moonbase/test-staking/test-set-auto-compound.ts diff --git a/test/suites/dev/test-staking/test-set-auto-compound2.ts b/test/suites/dev/moonbase/test-staking/test-set-auto-compound2.ts similarity index 100% rename from test/suites/dev/test-staking/test-set-auto-compound2.ts rename to test/suites/dev/moonbase/test-staking/test-set-auto-compound2.ts diff --git a/test/suites/dev/test-staking/test-set-auto-compound3.ts b/test/suites/dev/moonbase/test-staking/test-set-auto-compound3.ts similarity index 100% rename from test/suites/dev/test-staking/test-set-auto-compound3.ts rename to test/suites/dev/moonbase/test-staking/test-set-auto-compound3.ts diff --git a/test/suites/dev/test-staking/test-set-auto-compound4.ts b/test/suites/dev/moonbase/test-staking/test-set-auto-compound4.ts similarity index 100% rename from test/suites/dev/test-staking/test-set-auto-compound4.ts rename to test/suites/dev/moonbase/test-staking/test-set-auto-compound4.ts diff --git a/test/suites/dev/test-staking/test-set-auto-compound5.ts b/test/suites/dev/moonbase/test-staking/test-set-auto-compound5.ts similarity index 100% rename from test/suites/dev/test-staking/test-set-auto-compound5.ts rename to test/suites/dev/moonbase/test-staking/test-set-auto-compound5.ts diff --git a/test/suites/dev/test-staking/test-set-auto-compound6.ts b/test/suites/dev/moonbase/test-staking/test-set-auto-compound6.ts similarity index 100% rename from test/suites/dev/test-staking/test-set-auto-compound6.ts rename to test/suites/dev/moonbase/test-staking/test-set-auto-compound6.ts diff --git a/test/suites/dev/test-staking/test-staking-consts.ts b/test/suites/dev/moonbase/test-staking/test-staking-consts.ts similarity index 98% rename from test/suites/dev/test-staking/test-staking-consts.ts rename to test/suites/dev/moonbase/test-staking/test-staking-consts.ts index 23b693f554..93dbbff356 100644 --- a/test/suites/dev/test-staking/test-staking-consts.ts +++ b/test/suites/dev/moonbase/test-staking/test-staking-consts.ts @@ -9,7 +9,7 @@ import { alith, generateKeyringPair, } from "@moonwall/util"; -import { chunk } from "../../../helpers"; +import { chunk } from "../../../../helpers"; describeSuite({ id: "D2974", diff --git a/test/suites/dev/test-staking/test-staking-locks.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks.ts similarity index 100% rename from test/suites/dev/test-staking/test-staking-locks.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks.ts diff --git a/test/suites/dev/test-staking/test-staking-locks10.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks10.ts similarity index 100% rename from test/suites/dev/test-staking/test-staking-locks10.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks10.ts diff --git a/test/suites/dev/test-staking/test-staking-locks11.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks11.ts similarity index 98% rename from test/suites/dev/test-staking/test-staking-locks11.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks11.ts index 8e0d78167d..9c201e27f7 100644 --- a/test/suites/dev/test-staking/test-staking-locks11.ts +++ b/test/suites/dev/moonbase/test-staking/test-staking-locks11.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { GLMR, KeyringPair, MIN_GLMR_DELEGATOR, alith, generateKeyringPair } from "@moonwall/util"; -import { chunk } from "../../../helpers"; +import { chunk } from "../../../../helpers"; describeSuite({ id: "D2985", diff --git a/test/suites/dev/test-staking/test-staking-locks12.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks12.ts similarity index 99% rename from test/suites/dev/test-staking/test-staking-locks12.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks12.ts index 4bfbcd9608..bc1a713268 100644 --- a/test/suites/dev/test-staking/test-staking-locks12.ts +++ b/test/suites/dev/moonbase/test-staking/test-staking-locks12.ts @@ -9,7 +9,7 @@ import { generateKeyringPair, } from "@moonwall/util"; import { fromBytes } from "viem"; -import { chunk } from "../../../helpers"; +import { chunk } from "../../../../helpers"; describeSuite({ id: "D2986", diff --git a/test/suites/dev/test-staking/test-staking-locks2.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks2.ts similarity index 100% rename from test/suites/dev/test-staking/test-staking-locks2.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks2.ts diff --git a/test/suites/dev/test-staking/test-staking-locks3.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks3.ts similarity index 100% rename from test/suites/dev/test-staking/test-staking-locks3.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks3.ts diff --git a/test/suites/dev/test-staking/test-staking-locks4.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks4.ts similarity index 100% rename from test/suites/dev/test-staking/test-staking-locks4.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks4.ts diff --git a/test/suites/dev/test-staking/test-staking-locks5.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks5.ts similarity index 100% rename from test/suites/dev/test-staking/test-staking-locks5.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks5.ts diff --git a/test/suites/dev/test-staking/test-staking-locks6.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks6.ts similarity index 100% rename from test/suites/dev/test-staking/test-staking-locks6.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks6.ts diff --git a/test/suites/dev/test-staking/test-staking-locks7.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks7.ts similarity index 97% rename from test/suites/dev/test-staking/test-staking-locks7.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks7.ts index 04f0a30516..c1b18aae2c 100644 --- a/test/suites/dev/test-staking/test-staking-locks7.ts +++ b/test/suites/dev/moonbase/test-staking/test-staking-locks7.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { GLMR, MIN_GLMR_DELEGATOR, alith, generateKeyringPair } from "@moonwall/util"; -import { jumpRounds } from "../../../helpers"; +import { jumpRounds } from "../../../../helpers"; describeSuite({ id: "D2981", diff --git a/test/suites/dev/test-staking/test-staking-locks8.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks8.ts similarity index 98% rename from test/suites/dev/test-staking/test-staking-locks8.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks8.ts index cf338f9e8e..76075cf2a3 100644 --- a/test/suites/dev/test-staking/test-staking-locks8.ts +++ b/test/suites/dev/moonbase/test-staking/test-staking-locks8.ts @@ -8,7 +8,7 @@ import { generateKeyringPair, } from "@moonwall/util"; import { fromBytes } from "viem"; -import { jumpRounds } from "../../../helpers"; +import { jumpRounds } from "../../../../helpers"; describeSuite({ id: "D2982", diff --git a/test/suites/dev/test-staking/test-staking-locks9.ts b/test/suites/dev/moonbase/test-staking/test-staking-locks9.ts similarity index 98% rename from test/suites/dev/test-staking/test-staking-locks9.ts rename to test/suites/dev/moonbase/test-staking/test-staking-locks9.ts index 3300a9d62a..673daab69e 100644 --- a/test/suites/dev/test-staking/test-staking-locks9.ts +++ b/test/suites/dev/moonbase/test-staking/test-staking-locks9.ts @@ -9,7 +9,7 @@ import { generateKeyringPair, } from "@moonwall/util"; import { fromBytes } from "viem"; -import { chunk } from "../../../helpers"; +import { chunk } from "../../../../helpers"; describeSuite({ id: "D2983", diff --git a/test/suites/dev/test-staking/test-weights.ts b/test/suites/dev/moonbase/test-staking/test-weights.ts similarity index 97% rename from test/suites/dev/test-staking/test-weights.ts rename to test/suites/dev/moonbase/test-staking/test-weights.ts index 5e4c7bd302..40af5315a5 100644 --- a/test/suites/dev/test-staking/test-weights.ts +++ b/test/suites/dev/moonbase/test-staking/test-weights.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { GLMR, MIN_GLMR_DELEGATOR, MIN_GLMR_STAKING, alith } from "@moonwall/util"; -import { createAccounts, countExtrinsics } from "../../../helpers"; +import { createAccounts, countExtrinsics } from "../../../../helpers"; const INITIAL_AMOUNT = 12n * MIN_GLMR_STAKING + 50n * GLMR; diff --git a/test/suites/dev/test-staking/test-weights2.ts b/test/suites/dev/moonbase/test-staking/test-weights2.ts similarity index 95% rename from test/suites/dev/test-staking/test-weights2.ts rename to test/suites/dev/moonbase/test-staking/test-weights2.ts index 8f63e3aef9..9be86917ab 100644 --- a/test/suites/dev/test-staking/test-weights2.ts +++ b/test/suites/dev/moonbase/test-staking/test-weights2.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { GLMR, MIN_GLMR_DELEGATOR, MIN_GLMR_STAKING, alith } from "@moonwall/util"; -import { createAccounts, countExtrinsics } from "../../../helpers"; +import { createAccounts, countExtrinsics } from "../../../../helpers"; const INITIAL_AMOUNT = 12n * MIN_GLMR_STAKING + 50n * GLMR; diff --git a/test/suites/dev/test-staking/test-weights3.ts b/test/suites/dev/moonbase/test-staking/test-weights3.ts similarity index 99% rename from test/suites/dev/test-staking/test-weights3.ts rename to test/suites/dev/moonbase/test-staking/test-weights3.ts index 3b0d9a7c1c..6e2e965a38 100644 --- a/test/suites/dev/test-staking/test-weights3.ts +++ b/test/suites/dev/moonbase/test-staking/test-weights3.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { MIN_GLMR_DELEGATOR, alith } from "@moonwall/util"; -import { chunk, createAccounts, countExtrinsics } from "../../../helpers"; +import { chunk, createAccounts, countExtrinsics } from "../../../../helpers"; describeSuite({ id: "D2989", diff --git a/test/suites/dev/test-staking/test-weights4.ts b/test/suites/dev/moonbase/test-staking/test-weights4.ts similarity index 99% rename from test/suites/dev/test-staking/test-weights4.ts rename to test/suites/dev/moonbase/test-staking/test-weights4.ts index 24ee190f10..f93a2fcab6 100644 --- a/test/suites/dev/test-staking/test-weights4.ts +++ b/test/suites/dev/moonbase/test-staking/test-weights4.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { GLMR, MIN_GLMR_DELEGATOR, MIN_GLMR_STAKING, alith } from "@moonwall/util"; -import { chunk, createAccounts, countExtrinsics } from "../../../helpers"; +import { chunk, createAccounts, countExtrinsics } from "../../../../helpers"; const INITIAL_AMOUNT = 12n * MIN_GLMR_STAKING + 50n * GLMR; diff --git a/test/suites/dev/test-staking/test-weights5.ts b/test/suites/dev/moonbase/test-staking/test-weights5.ts similarity index 99% rename from test/suites/dev/test-staking/test-weights5.ts rename to test/suites/dev/moonbase/test-staking/test-weights5.ts index 125d59f028..791ae7fac0 100644 --- a/test/suites/dev/test-staking/test-weights5.ts +++ b/test/suites/dev/moonbase/test-staking/test-weights5.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; import { GLMR, MIN_GLMR_DELEGATOR, MIN_GLMR_STAKING, alith } from "@moonwall/util"; -import { chunk, createAccounts, countExtrinsics } from "../../../helpers"; +import { chunk, createAccounts, countExtrinsics } from "../../../../helpers"; const INITIAL_AMOUNT = 12n * MIN_GLMR_STAKING + 50n * GLMR; diff --git a/test/suites/dev/test-storage-growth/test-block-storage-growth.ts b/test/suites/dev/moonbase/test-storage-growth/test-block-storage-growth.ts similarity index 100% rename from test/suites/dev/test-storage-growth/test-block-storage-growth.ts rename to test/suites/dev/moonbase/test-storage-growth/test-block-storage-growth.ts diff --git a/test/suites/dev/test-storage-growth/test-evm-create-storage-growth.ts b/test/suites/dev/moonbase/test-storage-growth/test-evm-create-storage-growth.ts similarity index 100% rename from test/suites/dev/test-storage-growth/test-evm-create-storage-growth.ts rename to test/suites/dev/moonbase/test-storage-growth/test-evm-create-storage-growth.ts diff --git a/test/suites/dev/test-storage-growth/test-evm-store-storage-growth.ts b/test/suites/dev/moonbase/test-storage-growth/test-evm-store-storage-growth.ts similarity index 100% rename from test/suites/dev/test-storage-growth/test-evm-store-storage-growth.ts rename to test/suites/dev/moonbase/test-storage-growth/test-evm-store-storage-growth.ts diff --git a/test/suites/dev/test-storage-growth/test-precompile-storage-growth.ts b/test/suites/dev/moonbase/test-storage-growth/test-precompile-storage-growth.ts similarity index 100% rename from test/suites/dev/test-storage-growth/test-precompile-storage-growth.ts rename to test/suites/dev/moonbase/test-storage-growth/test-precompile-storage-growth.ts diff --git a/test/suites/dev/test-subscription/test-subscription-logs.ts b/test/suites/dev/moonbase/test-subscription/test-subscription-logs.ts similarity index 100% rename from test/suites/dev/test-subscription/test-subscription-logs.ts rename to test/suites/dev/moonbase/test-subscription/test-subscription-logs.ts diff --git a/test/suites/dev/test-subscription/test-subscription-logs2.ts b/test/suites/dev/moonbase/test-subscription/test-subscription-logs2.ts similarity index 100% rename from test/suites/dev/test-subscription/test-subscription-logs2.ts rename to test/suites/dev/moonbase/test-subscription/test-subscription-logs2.ts diff --git a/test/suites/dev/test-subscription/test-subscription-past-events.ts b/test/suites/dev/moonbase/test-subscription/test-subscription-past-events.ts similarity index 98% rename from test/suites/dev/test-subscription/test-subscription-past-events.ts rename to test/suites/dev/moonbase/test-subscription/test-subscription-past-events.ts index 7dd323d9c8..bd15bdc923 100644 --- a/test/suites/dev/test-subscription/test-subscription-past-events.ts +++ b/test/suites/dev/moonbase/test-subscription/test-subscription-past-events.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect, fetchCompiledContract } from "@moonwall/cli"; import { ALITH_ADDRESS, ALITH_CONTRACT_ADDRESSES, createEthersTransaction } from "@moonwall/util"; import { encodeDeployData } from "viem"; -import { web3SubscribeHistoricalLogs } from "../../../helpers"; +import { web3SubscribeHistoricalLogs } from "../../../../helpers"; describeSuite({ id: "D3003", diff --git a/test/suites/dev/test-subscription/test-subscription-pending.ts b/test/suites/dev/moonbase/test-subscription/test-subscription-pending.ts similarity index 100% rename from test/suites/dev/test-subscription/test-subscription-pending.ts rename to test/suites/dev/moonbase/test-subscription/test-subscription-pending.ts diff --git a/test/suites/dev/test-subscription/test-subscription.ts b/test/suites/dev/moonbase/test-subscription/test-subscription.ts similarity index 100% rename from test/suites/dev/test-subscription/test-subscription.ts rename to test/suites/dev/moonbase/test-subscription/test-subscription.ts diff --git a/test/suites/dev/test-sudo/test-sudo.ts b/test/suites/dev/moonbase/test-sudo/test-sudo.ts similarity index 99% rename from test/suites/dev/test-sudo/test-sudo.ts rename to test/suites/dev/moonbase/test-sudo/test-sudo.ts index f270a6f90e..fca85c9737 100644 --- a/test/suites/dev/test-sudo/test-sudo.ts +++ b/test/suites/dev/moonbase/test-sudo/test-sudo.ts @@ -8,7 +8,7 @@ import { baltathar, generateKeyringPair, } from "@moonwall/util"; -import { ALITH_GENESIS_TRANSFERABLE_BALANCE, verifyLatestBlockFees } from "../../../helpers"; +import { ALITH_GENESIS_TRANSFERABLE_BALANCE, verifyLatestBlockFees } from "../../../../helpers"; describeSuite({ id: "D3101", diff --git a/test/suites/dev/test-treasury/test-treasury-proposal.ts b/test/suites/dev/moonbase/test-treasury/test-treasury-proposal.ts similarity index 100% rename from test/suites/dev/test-treasury/test-treasury-proposal.ts rename to test/suites/dev/moonbase/test-treasury/test-treasury-proposal.ts diff --git a/test/suites/dev/test-treasury/test-treasury-proposal10.ts b/test/suites/dev/moonbase/test-treasury/test-treasury-proposal10.ts similarity index 100% rename from test/suites/dev/test-treasury/test-treasury-proposal10.ts rename to test/suites/dev/moonbase/test-treasury/test-treasury-proposal10.ts diff --git a/test/suites/dev/test-treasury/test-treasury-proposal2.ts b/test/suites/dev/moonbase/test-treasury/test-treasury-proposal2.ts similarity index 100% rename from test/suites/dev/test-treasury/test-treasury-proposal2.ts rename to test/suites/dev/moonbase/test-treasury/test-treasury-proposal2.ts diff --git a/test/suites/dev/test-treasury/test-treasury-proposal3.ts b/test/suites/dev/moonbase/test-treasury/test-treasury-proposal3.ts similarity index 100% rename from test/suites/dev/test-treasury/test-treasury-proposal3.ts rename to test/suites/dev/moonbase/test-treasury/test-treasury-proposal3.ts diff --git a/test/suites/dev/test-treasury/test-treasury-proposal4.ts b/test/suites/dev/moonbase/test-treasury/test-treasury-proposal4.ts similarity index 100% rename from test/suites/dev/test-treasury/test-treasury-proposal4.ts rename to test/suites/dev/moonbase/test-treasury/test-treasury-proposal4.ts diff --git a/test/suites/dev/test-treasury/test-treasury-proposal5.ts b/test/suites/dev/moonbase/test-treasury/test-treasury-proposal5.ts similarity index 100% rename from test/suites/dev/test-treasury/test-treasury-proposal5.ts rename to test/suites/dev/moonbase/test-treasury/test-treasury-proposal5.ts diff --git a/test/suites/dev/test-treasury/test-treasury-proposal6.ts b/test/suites/dev/moonbase/test-treasury/test-treasury-proposal6.ts similarity index 100% rename from test/suites/dev/test-treasury/test-treasury-proposal6.ts rename to test/suites/dev/moonbase/test-treasury/test-treasury-proposal6.ts diff --git a/test/suites/dev/test-treasury/test-treasury-proposal7.ts b/test/suites/dev/moonbase/test-treasury/test-treasury-proposal7.ts similarity index 100% rename from test/suites/dev/test-treasury/test-treasury-proposal7.ts rename to test/suites/dev/moonbase/test-treasury/test-treasury-proposal7.ts diff --git a/test/suites/dev/test-treasury/test-treasury-proposal8.ts b/test/suites/dev/moonbase/test-treasury/test-treasury-proposal8.ts similarity index 100% rename from test/suites/dev/test-treasury/test-treasury-proposal8.ts rename to test/suites/dev/moonbase/test-treasury/test-treasury-proposal8.ts diff --git a/test/suites/dev/test-treasury/test-treasury-proposal9.ts b/test/suites/dev/moonbase/test-treasury/test-treasury-proposal9.ts similarity index 100% rename from test/suites/dev/test-treasury/test-treasury-proposal9.ts rename to test/suites/dev/moonbase/test-treasury/test-treasury-proposal9.ts diff --git a/test/suites/dev/test-txpool/test-txpool-fairness.ts b/test/suites/dev/moonbase/test-txpool/test-txpool-fairness.ts similarity index 100% rename from test/suites/dev/test-txpool/test-txpool-fairness.ts rename to test/suites/dev/moonbase/test-txpool/test-txpool-fairness.ts diff --git a/test/suites/dev/test-txpool/test-txpool-future.ts b/test/suites/dev/moonbase/test-txpool/test-txpool-future.ts similarity index 100% rename from test/suites/dev/test-txpool/test-txpool-future.ts rename to test/suites/dev/moonbase/test-txpool/test-txpool-future.ts diff --git a/test/suites/dev/test-txpool/test-txpool-limits.ts b/test/suites/dev/moonbase/test-txpool/test-txpool-limits.ts similarity index 100% rename from test/suites/dev/test-txpool/test-txpool-limits.ts rename to test/suites/dev/moonbase/test-txpool/test-txpool-limits.ts diff --git a/test/suites/dev/test-txpool/test-txpool-limits2.ts b/test/suites/dev/moonbase/test-txpool/test-txpool-limits2.ts similarity index 100% rename from test/suites/dev/test-txpool/test-txpool-limits2.ts rename to test/suites/dev/moonbase/test-txpool/test-txpool-limits2.ts diff --git a/test/suites/dev/test-txpool/test-txpool-limits3.ts b/test/suites/dev/moonbase/test-txpool/test-txpool-limits3.ts similarity index 100% rename from test/suites/dev/test-txpool/test-txpool-limits3.ts rename to test/suites/dev/moonbase/test-txpool/test-txpool-limits3.ts diff --git a/test/suites/dev/test-txpool/test-txpool-limits4.ts b/test/suites/dev/moonbase/test-txpool/test-txpool-limits4.ts similarity index 100% rename from test/suites/dev/test-txpool/test-txpool-limits4.ts rename to test/suites/dev/moonbase/test-txpool/test-txpool-limits4.ts diff --git a/test/suites/dev/test-txpool/test-txpool-pending.ts b/test/suites/dev/moonbase/test-txpool/test-txpool-pending.ts similarity index 100% rename from test/suites/dev/test-txpool/test-txpool-pending.ts rename to test/suites/dev/moonbase/test-txpool/test-txpool-pending.ts diff --git a/test/suites/dev/test-txpool/test-txpool-pending2.ts b/test/suites/dev/moonbase/test-txpool/test-txpool-pending2.ts similarity index 100% rename from test/suites/dev/test-txpool/test-txpool-pending2.ts rename to test/suites/dev/moonbase/test-txpool/test-txpool-pending2.ts diff --git a/test/suites/dev/test-txpool/test-txpool-reset.ts b/test/suites/dev/moonbase/test-txpool/test-txpool-reset.ts similarity index 100% rename from test/suites/dev/test-txpool/test-txpool-reset.ts rename to test/suites/dev/moonbase/test-txpool/test-txpool-reset.ts diff --git a/test/suites/dev/test-txpool/test-txpool-reset2.ts b/test/suites/dev/moonbase/test-txpool/test-txpool-reset2.ts similarity index 100% rename from test/suites/dev/test-txpool/test-txpool-reset2.ts rename to test/suites/dev/moonbase/test-txpool/test-txpool-reset2.ts diff --git a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-1.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-1.ts similarity index 96% rename from test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-1.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-1.ts index e020a66eee..40e1692895 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-1.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; @@ -74,7 +74,7 @@ describeSuite({ // Make sure ALITH did not reveive anything const alith_dot_balance = await context .polkadotJs() - .query.localAssets.account(assetId, alith.address); + .query.assets.account(assetId, alith.address); expect(alith_dot_balance.isNone, "Alith's DOT balance is not empty").to.be.true; }, diff --git a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-2.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-2.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-2.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-2.ts index 6116650f14..9929abce32 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-2.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-3.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-3.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-3.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-3.ts index dbd463ff42..7b37c697d0 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-3.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-4.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-4.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-4.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-4.ts index c89ef1c998..e89af34b5f 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-4.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-5.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-5.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-5.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-5.ts index a2592eb33c..d1365caa9a 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-5.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-6.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-6.ts similarity index 97% rename from test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-6.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-6.ts index 84fa72ed73..129c141493 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-dmp-error-and-appendix-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-6.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; @@ -68,7 +68,7 @@ describeSuite({ // Make sure ALITH did not reveive anything const alith_dot_balance = await context .polkadotJs() - .query.localAssets.account(assetId, alith.address); + .query.assets.account(assetId, alith.address); expect(alith_dot_balance.isNone).to.be.true; }); diff --git a/test/suites/dev/test-xcm-v2/test-mock-dmp-queue.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-queue.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-dmp-queue.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-queue.ts index 78d87a3e46..1418159e8a 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-dmp-queue.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-queue.ts @@ -3,7 +3,7 @@ import { customDevRpcRequest, describeSuite, expect } from "@moonwall/cli"; import { GLMR } from "@moonwall/util"; import type { XcmVersionedXcm } from "@polkadot/types/lookup"; import { u8aToHex } from "@polkadot/util"; -import { XcmFragment, weightMessage } from "../../../helpers"; +import { XcmFragment, weightMessage } from "../../../../helpers"; describeSuite({ id: "D3407", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-1.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-1.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-1.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-1.ts index 424b006ea8..9cbdffa2da 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-1.ts @@ -8,7 +8,7 @@ import { XcmFragment, RawXcmMessage, injectHrmpMessageAndSeal, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; const statemint_para_id = 1001; diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-2.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-2.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-2.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-2.ts index 8c94457527..86d082ce50 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-2.ts @@ -8,7 +8,7 @@ import { XcmFragment, RawXcmMessage, injectHrmpMessageAndSeal, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const FOREIGN_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-3.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-3.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-3.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-3.ts index 6800abae8c..d6dd1f2622 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-3.ts @@ -9,7 +9,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, sovereignAccountOfSibling, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const foreign_para_id = 2000; diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-4.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-4.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-4.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-4.ts index 27beb06087..dfe74c5481 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-4.ts @@ -10,7 +10,7 @@ import { injectHrmpMessageAndSeal, weightMessage, sovereignAccountOfSibling, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const foreign_para_id = 2000; diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-5.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-5.ts similarity index 99% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-5.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-5.ts index 3f123f6c74..8b59f19d6d 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-5.ts @@ -10,7 +10,7 @@ import { XcmFragment, RawXcmMessage, injectHrmpMessageAndSeal, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const FOREIGN_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-6.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-6.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-6.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-6.ts index 8fffad53cb..ee02094f6f 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-asset-transfer-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-6.ts @@ -8,7 +8,7 @@ import { XcmFragment, RawXcmMessage, injectHrmpMessageAndSeal, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; const statemint_para_id = 1001; diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-1.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-1.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-1.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-1.ts index d25349a8ae..0a55dc9665 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-1.ts @@ -9,7 +9,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3416", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-2.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-2.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-2.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-2.ts index 7bdcaa214b..25b41edebf 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-2.ts @@ -9,7 +9,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3417", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-3.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-3.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-3.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-3.ts index 18d266e84b..ea798db5a7 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-3.ts @@ -9,7 +9,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3418", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-4.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-4.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-4.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-4.ts index 6f6956a8a0..c84ca0507e 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-4.ts @@ -9,7 +9,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3419", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-1.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-1.ts similarity index 99% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-1.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-1.ts index d386683151..f536d7cac1 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-1.ts @@ -9,7 +9,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3420", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-10.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-10.ts similarity index 99% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-10.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-10.ts index d0bfe74cc7..e3c9c76678 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-10.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-10.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3429", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-2.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-2.ts similarity index 99% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-2.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-2.ts index a9977f9d63..5f5fb4ec8e 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-2.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3421", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-3.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-3.ts similarity index 99% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-3.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-3.ts index ee5dc318fd..8175aebf61 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-3.ts @@ -13,7 +13,7 @@ import { MultiLocation, registerForeignAsset, weightMessage, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3422", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-4.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-4.ts similarity index 99% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-4.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-4.ts index 5d80f1c50d..4d3192f2a2 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-4.ts @@ -9,7 +9,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3423", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-5.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-5.ts similarity index 99% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-5.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-5.ts index d8e01ec7d8..ba32790698 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-5.ts @@ -9,7 +9,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3424", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-6.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-6.ts similarity index 99% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-6.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-6.ts index bb15565296..49e5f3e3f7 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-6.ts @@ -9,7 +9,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3425", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-7.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-7.ts similarity index 99% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-7.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-7.ts index c00da57bd4..d28ebdedcd 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-7.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-7.ts @@ -9,7 +9,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3426", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-8.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-8.ts similarity index 99% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-8.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-8.ts index 3076d9e749..49e066c7c8 100644 --- a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-8.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-8.ts @@ -9,7 +9,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3427", diff --git a/test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-9.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-9.ts similarity index 100% rename from test/suites/dev/test-xcm-v2/test-mock-hrmp-transact-ethereum-9.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-9.ts diff --git a/test/suites/dev/test-xcm-v2/test-xcm-erc20-transfer-two-ERC20.ts b/test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer-two-ERC20.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-xcm-erc20-transfer-two-ERC20.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer-two-ERC20.ts index 9bcf501adf..483f2028ba 100644 --- a/test/suites/dev/test-xcm-v2/test-xcm-erc20-transfer-two-ERC20.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer-two-ERC20.ts @@ -2,13 +2,13 @@ import { beforeEach, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, BALTATHAR_ADDRESS, CHARLETH_ADDRESS, alith } from "@moonwall/util"; import { ApiPromise } from "@polkadot/api"; import { parseEther } from "ethers"; -import { expectEVMResult, getTransactionFees } from "../../../helpers"; +import { expectEVMResult, getTransactionFees } from "../../../../helpers"; import { XcmFragment, XcmFragmentConfig, injectHrmpMessageAndSeal, sovereignAccountOfSibling, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; diff --git a/test/suites/dev/test-xcm-v2/test-xcm-erc20-transfer.ts b/test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-xcm-erc20-transfer.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer.ts index 28c0686986..f64f475c7f 100644 --- a/test/suites/dev/test-xcm-v2/test-xcm-erc20-transfer.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer.ts @@ -3,13 +3,13 @@ import { beforeEach, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, BALTATHAR_ADDRESS, CHARLETH_ADDRESS, alith } from "@moonwall/util"; import { ApiPromise } from "@polkadot/api"; import { parseEther } from "ethers"; -import { expectEVMResult, getTransactionFees } from "../../../helpers"; +import { expectEVMResult, getTransactionFees } from "../../../../helpers"; import { XcmFragment, XcmFragmentConfig, injectHrmpMessageAndSeal, sovereignAccountOfSibling, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; diff --git a/test/suites/dev/test-xcm-v2/test-xcm-ver-conversion-1.ts b/test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-1.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-xcm-ver-conversion-1.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-1.ts index f202fbb945..899b2d0b77 100644 --- a/test/suites/dev/test-xcm-v2/test-xcm-ver-conversion-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-1.ts @@ -10,7 +10,7 @@ import { injectHrmpMessageAndSeal, weightMessage, sovereignAccountOfSibling, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const foreign_para_id = 2000; diff --git a/test/suites/dev/test-xcm-v2/test-xcm-ver-conversion-2.ts b/test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-2.ts similarity index 98% rename from test/suites/dev/test-xcm-v2/test-xcm-ver-conversion-2.ts rename to test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-2.ts index ea188863ed..f58e640506 100644 --- a/test/suites/dev/test-xcm-v2/test-xcm-ver-conversion-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-2.ts @@ -10,7 +10,7 @@ import { injectHrmpMessageAndSeal, weightMessage, sovereignAccountOfSibling, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const foreign_para_id = 2000; diff --git a/test/suites/dev/test-xcm-v3/test-mock-dmp-asset-transfer.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-asset-transfer.ts similarity index 93% rename from test/suites/dev/test-xcm-v3/test-mock-dmp-asset-transfer.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-asset-transfer.ts index 65e2359d42..3c96e97c90 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-dmp-asset-transfer.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-asset-transfer.ts @@ -1,7 +1,11 @@ import "@moonbeam-network/api-augment"; import { beforeAll, customDevRpcRequest, describeSuite, expect } from "@moonwall/cli"; import { alith } from "@moonwall/util"; -import { RELAY_SOURCE_LOCATION, registerForeignAsset, relayAssetMetadata } from "../../../helpers"; +import { + RELAY_SOURCE_LOCATION, + registerForeignAsset, + relayAssetMetadata, +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-1.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-1.ts similarity index 96% rename from test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-1.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-1.ts index 5398406f1d..8496f3f240 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-1.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; @@ -74,7 +74,7 @@ describeSuite({ // Make sure ALITH did not reveive anything const alith_dot_balance = await context .polkadotJs() - .query.localAssets.account(assetId, alith.address); + .query.assets.account(assetId, alith.address); expect(alith_dot_balance.isNone, "Alith's DOT balance is not empty").to.be.true; }, diff --git a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-2.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-2.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-2.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-2.ts index bcacc36e82..34be4d18cd 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-2.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-3.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-3.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-3.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-3.ts index 5dd57d4b81..1589fc3617 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-3.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-4.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-4.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-4.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-4.ts index 0b73ce758f..4d8767b421 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-4.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-5.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-5.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-5.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-5.ts index fdb84613cd..977891cfa2 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-5.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-6.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-6.ts similarity index 97% rename from test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-6.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-6.ts index 558433b8b3..ea58d83cdc 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-dmp-error-and-appendix-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-6.ts @@ -7,7 +7,7 @@ import { XcmFragment, registerForeignAsset, relayAssetMetadata, -} from "../../../helpers"; +} from "../../../../helpers"; // Twelve decimal places in the moonbase relay chain's token const RELAY_TOKEN = 1_000_000_000_000n; @@ -68,7 +68,7 @@ describeSuite({ // Make sure ALITH did not reveive anything const alith_dot_balance = await context .polkadotJs() - .query.localAssets.account(assetId, alith.address); + .query.assets.account(assetId, alith.address); expect(alith_dot_balance.isNone).to.be.true; }); diff --git a/test/suites/dev/test-xcm-v3/test-mock-dmp-queue.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-queue.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-dmp-queue.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-queue.ts index 44ef5aafff..456c882dbc 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-dmp-queue.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-queue.ts @@ -3,7 +3,7 @@ import { customDevRpcRequest, describeSuite, expect } from "@moonwall/cli"; import { GLMR } from "@moonwall/util"; import type { XcmVersionedXcm } from "@polkadot/types/lookup"; import { u8aToHex } from "@polkadot/util"; -import { XcmFragment, weightMessage } from "../../../helpers"; +import { XcmFragment, weightMessage } from "../../../../helpers"; describeSuite({ id: "D3508", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-1.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-1.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-1.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-1.ts index c979423828..3ba52e5ce0 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-1.ts @@ -1,7 +1,7 @@ import "@moonbeam-network/api-augment"; import { beforeAll, customDevRpcRequest, describeSuite, expect } from "@moonwall/cli"; import { alith } from "@moonwall/util"; -import { PARA_2000_SOURCE_LOCATION, registerForeignAsset } from "../../../helpers"; +import { PARA_2000_SOURCE_LOCATION, registerForeignAsset } from "../../../../helpers"; const FOREIGN_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-2.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-2.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-2.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-2.ts index eee5e03e4b..3ad67d2a72 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-2.ts @@ -8,7 +8,7 @@ import { XcmFragment, RawXcmMessage, injectHrmpMessageAndSeal, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; const statemint_para_id = 1001; diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-3.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-3.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-3.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-3.ts index 2ae20a9e75..23afa491ee 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-3.ts @@ -7,7 +7,7 @@ import { XcmFragment, RawXcmMessage, injectHrmpMessageAndSeal, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const FOREIGN_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-4.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-4.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-4.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-4.ts index 24e00bb78e..64fc0dfd35 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-4.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, sovereignAccountOfSibling, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const foreign_para_id = 2000; diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-5.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-5.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-5.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-5.ts index 1ae9c99a0e..e9e800a5ac 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-5.ts @@ -9,7 +9,7 @@ import { injectHrmpMessageAndSeal, weightMessage, sovereignAccountOfSibling, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const foreign_para_id = 2000; diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-6.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-6.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-6.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-6.ts index 7e8b329ce1..ed9ad1a7e7 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-6.ts @@ -8,7 +8,7 @@ import { XcmFragment, RawXcmMessage, injectHrmpMessageAndSeal, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const FOREIGN_TOKEN = 1_000_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-8.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-8.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-8.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-8.ts index eb55d96472..c54fb2402f 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-asset-transfer-8.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-8.ts @@ -7,7 +7,7 @@ import { XcmFragment, RawXcmMessage, injectHrmpMessageAndSeal, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; const statemint_para_id = 1001; diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-1.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-1.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-1.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-1.ts index 3f56e18baa..f8883c1de8 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-1.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3518", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-2.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-2.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-2.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-2.ts index 1dcaa0eff0..82d0def04c 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-2.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3519", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-3.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-3.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-3.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-3.ts index 4e294451c4..bc8cfdc4b4 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-3.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3520", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-4.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-4.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-4.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-4.ts index ff3163057f..b5827982ef 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-4.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3521", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts index 7bcde94ed6..a79b78e8d6 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3522", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-10.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-10.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-10.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-10.ts index 0a7eeb193c..754ef31e13 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-10.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-10.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3531", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-11.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-11.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-11.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-11.ts index c87d8f6da8..f80bbb048f 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-11.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-11.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3532", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts index 8b0783b534..aebcc10a4a 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3533", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-2.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-2.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-2.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-2.ts index 6eb4aac5dd..03d4573b73 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-2.ts @@ -7,7 +7,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; import { GAS_LIMIT_POV_RATIO } from "@moonwall/util"; diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts index e1ed2e1ff1..fd07d2393d 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts @@ -13,7 +13,7 @@ import { MultiLocation, registerForeignAsset, weightMessage, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3524", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-4.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-4.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-4.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-4.ts index d484d6869f..57857e63f6 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-4.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3525", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-5.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-5.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-5.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-5.ts index 0d809a2d56..33f568bcdb 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-5.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3526", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts index 5d6811e037..f9b5440559 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3527", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-7.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-7.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-7.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-7.ts index 28a6af68a1..4e76b561c9 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-7.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-7.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3528", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-8.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-8.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-8.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-8.ts index a4feb42452..23a777af8a 100644 --- a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-8.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-8.ts @@ -8,7 +8,7 @@ import { RawXcmMessage, injectHrmpMessageAndSeal, descendOriginFromAddress20, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; describeSuite({ id: "D3529", diff --git a/test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-9.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-9.ts similarity index 100% rename from test/suites/dev/test-xcm-v3/test-mock-hrmp-transact-ethereum-9.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-9.ts diff --git a/test/suites/dev/test-xcm-v3/test-xcm-erc20-data-field-size.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-data-field-size.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-xcm-erc20-data-field-size.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-data-field-size.ts index f4e308673e..df5b7003c3 100644 --- a/test/suites/dev/test-xcm-v3/test-xcm-erc20-data-field-size.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-data-field-size.ts @@ -5,7 +5,7 @@ import { ApiPromise } from "@polkadot/api"; import { sovereignAccountOfSibling, injectEncodedHrmpMessageAndSeal, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; import { parseEther } from "ethers"; export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-xcm-erc20-excess-gas.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-excess-gas.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-xcm-erc20-excess-gas.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-excess-gas.ts index f22f956942..042c3f5b15 100644 --- a/test/suites/dev/test-xcm-v3/test-xcm-erc20-excess-gas.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-excess-gas.ts @@ -3,13 +3,13 @@ import { beforeEach, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, BALTATHAR_ADDRESS, CHARLETH_ADDRESS, alith } from "@moonwall/util"; import { ApiPromise } from "@polkadot/api"; import { parseEther } from "ethers"; -import { expectEVMResult, getTransactionFees } from "../../../helpers"; +import { expectEVMResult, getTransactionFees } from "../../../../helpers"; import { XcmFragment, XcmFragmentConfig, injectHrmpMessageAndSeal, sovereignAccountOfSibling, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-xcm-erc20-fees-and-trap.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-fees-and-trap.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-xcm-erc20-fees-and-trap.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-fees-and-trap.ts index c32cf7275e..2698dac395 100644 --- a/test/suites/dev/test-xcm-v3/test-xcm-erc20-fees-and-trap.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-fees-and-trap.ts @@ -2,7 +2,7 @@ import { beforeEach, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, CHARLETH_ADDRESS, alith } from "@moonwall/util"; import { ApiPromise } from "@polkadot/api"; import { parseEther } from "ethers"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; import { XcmFragment, XcmFragmentConfig, @@ -10,7 +10,7 @@ import { injectHrmpMessageAndSeal, sovereignAccountOfSibling, weightMessage, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-xcm-erc20-v3-filter.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3-filter.ts similarity index 98% rename from test/suites/dev/test-xcm-v3/test-xcm-erc20-v3-filter.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3-filter.ts index 8dae16d3ef..9ed77dcf0a 100644 --- a/test/suites/dev/test-xcm-v3/test-xcm-erc20-v3-filter.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3-filter.ts @@ -2,13 +2,13 @@ import { beforeEach, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, CHARLETH_ADDRESS, alith } from "@moonwall/util"; import { ApiPromise } from "@polkadot/api"; import { parseEther } from "ethers"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; import { XcmFragment, XcmFragmentConfig, injectHrmpMessageAndSeal, sovereignAccountOfSibling, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-xcm-erc20-v3.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3.ts similarity index 97% rename from test/suites/dev/test-xcm-v3/test-xcm-erc20-v3.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3.ts index dffeb6552f..810c391817 100644 --- a/test/suites/dev/test-xcm-v3/test-xcm-erc20-v3.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3.ts @@ -2,13 +2,13 @@ import { beforeEach, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, CHARLETH_ADDRESS, alith } from "@moonwall/util"; import { ApiPromise } from "@polkadot/api"; import { parseEther } from "ethers"; -import { expectEVMResult } from "../../../helpers"; +import { expectEVMResult } from "../../../../helpers"; import { XcmFragment, XcmFragmentConfig, injectHrmpMessageAndSeal, sovereignAccountOfSibling, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; diff --git a/test/suites/dev/test-xcm-v3/test-xcm-transactor-1.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-1.ts similarity index 100% rename from test/suites/dev/test-xcm-v3/test-xcm-transactor-1.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-1.ts diff --git a/test/suites/dev/test-xcm-v3/test-xcm-transactor-2.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-2.ts similarity index 100% rename from test/suites/dev/test-xcm-v3/test-xcm-transactor-2.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-2.ts diff --git a/test/suites/dev/test-xcm-v3/test-xcmv3-max-weight-instructions.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-max-weight-instructions.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-xcmv3-max-weight-instructions.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-max-weight-instructions.ts index 2df59f1d57..4600bfbf27 100644 --- a/test/suites/dev/test-xcm-v3/test-xcmv3-max-weight-instructions.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-max-weight-instructions.ts @@ -8,7 +8,7 @@ import { injectHrmpMessage, sovereignAccountOfSibling, XcmFragmentConfig, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; import { parseEther } from "ethers"; describeSuite({ diff --git a/test/suites/dev/test-xcm-v3/test-xcmv3-new-instructions.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-new-instructions.ts similarity index 99% rename from test/suites/dev/test-xcm-v3/test-xcmv3-new-instructions.ts rename to test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-new-instructions.ts index fb689878e5..c718b1f18f 100644 --- a/test/suites/dev/test-xcm-v3/test-xcmv3-new-instructions.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-new-instructions.ts @@ -8,7 +8,7 @@ import { injectHrmpMessage, sovereignAccountOfSibling, XcmFragmentConfig, -} from "../../../helpers/xcm.js"; +} from "../../../../helpers/xcm.js"; import { parseEther } from "ethers"; // Here we are testing each allowed instruction to be executed. Even if some of them throw an error, diff --git a/test/suites/dev/moonbeam/test-precompile/test-precompile-assets-erc20-local-assets-removal.ts b/test/suites/dev/moonbeam/test-precompile/test-precompile-assets-erc20-local-assets-removal.ts new file mode 100644 index 0000000000..27b0703177 --- /dev/null +++ b/test/suites/dev/moonbeam/test-precompile/test-precompile-assets-erc20-local-assets-removal.ts @@ -0,0 +1,101 @@ +import { beforeAll, deployCreateCompiledContract, describeSuite, expect } from "@moonwall/cli"; +import { ALITH_ADDRESS } from "@moonwall/util"; +import { Abi } from "viem"; + +describeSuite({ + id: "E0101", + title: "Precompiles - Assets-ERC20 (LocalAssets Removal)", + foundationMethods: "dev", + testCases: ({ context, it, log }) => { + const precompileRegistryAddress = "0x0000000000000000000000000000000000000815"; + const localAssets = [ + "0xffFfFffeFd9d0bf45a2947A519a741c4b9E99EB6", + "0xFfFFfffeD1b57d12738e41EAe0124E285e5e86a3", + "0xFFfFfFfeAbB8953aC77edEcE4A6e251A849C7CdF", + "0xFFfffFFecB45aFD30a637967995394Cc88C0c194", + ]; + const notLocalAssets = [ + "0xffFfFffeFd9d0bf45a2947A519a741c4b9E99EB7", + "0xFFfffFFecB45aFD30a637967995394Cc88C0c195", + ]; + let erc20Abi: Abi; + let precompileRegistryAbi: Abi; + + beforeAll(async () => { + const { abi } = await deployCreateCompiledContract(context, "ERC20Instance"); + erc20Abi = abi; + const { abi: _precompileRegistryAbi } = await deployCreateCompiledContract( + context, + "PrecompileRegistry" + ); + precompileRegistryAbi = _precompileRegistryAbi; + }); + + it({ + id: "T01", + title: "ensure evm calls on local xc-20 addresses get reverted", + test: async function () { + const addresses = [ + ...localAssets.map((address) => ({ address, local: true })), + ...notLocalAssets.map((address) => ({ address, local: false })), + ]; + + // Call every address and ensure it only local asset addresses get reverted + for (const { address, local } of addresses) { + let revertReason = ""; + try { + await context.viem().readContract({ + address: address as `0x${string}`, + abi: erc20Abi, + functionName: "balanceOf", + args: [ALITH_ADDRESS], + }); + } catch (e) { + revertReason = e.cause.reason; + } + + if (local) { + expect(revertReason).toBe("Removed precompile"); + } else { + expect(revertReason).to.be.undefined; + } + } + }, + }); + + it({ + id: "T02", + title: "Local assets should be inactive in the precompile registry", + test: async function () { + const addresses = [ + ...localAssets.map((address) => ({ address, local: true })), + ...notLocalAssets.map((address) => ({ address, local: false })), + ]; + + for (const { address, local } of addresses) { + const isPrecompileResult = await context.viem().readContract({ + address: precompileRegistryAddress, + abi: precompileRegistryAbi, + functionName: "isPrecompile", + args: [address], + }); + const isActivePrecompileResult = await context.viem().readContract({ + address: precompileRegistryAddress, + abi: precompileRegistryAbi, + functionName: "isActivePrecompile", + args: [address], + }); + + if (local) { + // All local asset addresses are still considereded precompiles + expect(isPrecompileResult).to.be.true; + // All local asset precompiles should be inactive + expect(isActivePrecompileResult).to.be.false; + } else { + expect(isPrecompileResult).to.be.false; + } + } + }, + }); + }, +}); diff --git a/test/suites/dev/test-assets/test-register-local-asset.ts b/test/suites/dev/test-assets/test-register-local-asset.ts deleted file mode 100644 index b2bbac176e..0000000000 --- a/test/suites/dev/test-assets/test-register-local-asset.ts +++ /dev/null @@ -1,35 +0,0 @@ -import "@moonbeam-network/api-augment"; -import { describeSuite, expect } from "@moonwall/cli"; -import { ALITH_ADDRESS } from "@moonwall/util"; -import { BN } from "@polkadot/util"; -import { DispatchError } from "@polkadot/types/interfaces"; - -describeSuite({ - id: "D0110", - title: "XCM - asset manager - register local asset", - foundationMethods: "dev", - testCases: ({ context, it, log }) => { - it({ - id: "T01", - title: "should fail to register a local asset", - test: async function () { - const parachainOne = context.polkadotJs(); - // registerForeignAsset - const { result } = await context.createBlock( - parachainOne.tx.sudo.sudo( - parachainOne.tx.assetManager.registerLocalAsset( - ALITH_ADDRESS, - ALITH_ADDRESS, - true, - new BN(1) - ) - ) - ); - const err = result?.events.find(({ event: { section } }) => section.toString() === "sudo") - ?.event.data[0] as DispatchError; - - expect(err.type).eq("Err"); - }, - }); - }, -}); diff --git a/test/suites/smoke/test-balances-consistency.ts b/test/suites/smoke/test-balances-consistency.ts index e5591128d5..c28b5824f6 100644 --- a/test/suites/smoke/test-balances-consistency.ts +++ b/test/suites/smoke/test-balances-consistency.ts @@ -30,9 +30,6 @@ enum ReserveType { ReferendumInfo = "11", Asset = "12", AssetMetadata = "13", - LocalAsset = "14", - LocalAssetMetadata = "15", - LocalAssetDeposit = "16", Named = "17", SubIdentity = "18", PreimageStatus = "19", @@ -586,69 +583,6 @@ describeSuite({ }); }); - await new Promise((resolve, reject) => { - apiAt.query.localAssets.asset - .entries() - .then(async (localAssets) => { - localAssets.forEach((localAsset) => { - updateReserveMap(localAsset[1].unwrap().owner.toHex().slice(-40), { - [ReserveType.LocalAsset]: localAsset[1].unwrap().deposit.toBigInt(), - }); - }); - - await new Promise((resolve, reject) => { - apiAt.query.localAssets.metadata - .entries() - .then((localAssetMetadata) => { - localAssetMetadata.forEach((localAssetMetadata) => { - updateReserveMap( - localAssets - .find( - (localAsset) => - localAsset[0].toHex().slice(-64) == - localAssetMetadata[0].toHex().slice(-64) - )![1] - .unwrap() - .owner.toHex() - .slice(-40), - { - [ReserveType.LocalAssetMetadata]: localAssetMetadata[1].deposit.toBigInt(), - } - ); - }); - resolve("localAssetsMetadata scraped"); - }) - .catch((error) => { - console.error("Error fetching localAssetsMetadata:", error); - reject(error); - }); - }); - - resolve("localAssets scraped"); - }) - .catch((error) => { - console.error("Error fetching localAssets :", error); - reject(error); - }); - }); - - await new Promise((resolve, reject) => { - apiAt.query.assetManager.localAssetDeposit - .entries() - .then((localAssetDeposits) => { - localAssetDeposits.forEach((assetDeposit) => { - updateReserveMap(assetDeposit[1].unwrap().creator.toHex(), { - [ReserveType.LocalAssetDeposit]: assetDeposit[1].unwrap().deposit.toBigInt(), - }); - }); - resolve("localAssetDeposits scraped"); - }) - .catch((error) => { - console.error("Error fetching localAssetDeposits:", error); - reject(error); - }); - }); - await new Promise((resolve, reject) => { apiAt.query.balances.reserves .entries() diff --git a/test/suites/smoke/test-local-asset-consistency.ts b/test/suites/smoke/test-local-asset-consistency.ts deleted file mode 100644 index 3c95a4a594..0000000000 --- a/test/suites/smoke/test-local-asset-consistency.ts +++ /dev/null @@ -1,94 +0,0 @@ -import "@moonbeam-network/api-augment"; -import { ApiDecoration } from "@polkadot/api/types"; -import { u128 } from "@polkadot/types-codec"; -import { describeSuite, expect, beforeAll } from "@moonwall/cli"; -import { StorageKey } from "@polkadot/types"; - -describeSuite({ - id: "S1300", - title: "Verify local asset count, assetIds and deposits", - foundationMethods: "read_only", - testCases: ({ context, it, log }) => { - let atBlockNumber: number = 0; - let apiAt: ApiDecoration<"promise">; - let localAssetDeposits: StorageKey<[u128]>[]; - let localAssetInfo: StorageKey<[u128]>[]; - let localAssetCounter: number = 0; - - beforeAll(async function () { - // Configure the api at a specific block - // (to avoid inconsistency querying over multiple block when the test takes a long time to - // query data and blocks are being produced) - atBlockNumber = process.env.BLOCK_NUMBER - ? parseInt(process.env.BLOCK_NUMBER) - : (await context.polkadotJs("para").rpc.chain.getHeader()).number.toNumber(); - apiAt = await context - .polkadotJs("para") - .at(await context.polkadotJs("para").rpc.chain.getBlockHash(atBlockNumber)); - localAssetDeposits = await apiAt.query.assetManager.localAssetDeposit.keys(); - localAssetCounter = await (await apiAt.query.assetManager.localAssetCounter()).toNumber(); - localAssetInfo = await apiAt.query.assetManager.localAssetDeposit.keys(); - }); - - it({ - id: "C100", - title: "should match asset deposit entries with number of assets", - test: async function () { - expect( - localAssetDeposits.length, - `Number of local asset deposits does not much number of local assets` - ).to.be.eq(localAssetInfo.length); - - log( - `Verified number of deposits and local asset number matches: ${localAssetDeposits.length}` - ); - }, - }); - - it({ - id: "C200", - title: "should ensure localAssetCounter is higher than number of local assets", - test: async function () { - expect( - localAssetCounter, - `Local asset counter lower than total local assets` - ).to.be.greaterThanOrEqual(localAssetInfo.length); - - log( - `Verified local asset counter (${localAssetCounter}) - >= total local assets: (${localAssetInfo.length})` - ); - }, - }); - - it({ - id: "C300", - title: `assetIds stored by assetManager are also created in LocalAssets`, - test: async function () { - const failedLocalAssets: { assetId: string }[] = []; - const registeredLocalAssetDeposits = localAssetDeposits.map((set) => - set.toHex().slice(-32) - ); - const registeredLocalAssetInfos = localAssetInfo.map((set) => set.toHex().slice(-32)); - - for (const assetId of registeredLocalAssetDeposits) { - if (!registeredLocalAssetInfos.includes(assetId)) { - failedLocalAssets.push({ assetId: assetId }); - } - } - - expect( - failedLocalAssets.length, - `Failed deposits with non-existent local assets: ${failedLocalAssets - .map(({ assetId }) => `expected: ${assetId} to be present in localAssets `) - .join(`, `)}` - ).to.equal(0); - log( - `Verified ${ - Object.keys(localAssetInfo).length - } total local assetIds (at #${atBlockNumber})` - ); - }, - }); - }, -});