Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden committed Sep 6, 2024
1 parent 3717f85 commit 97ff40a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 25 deletions.
6 changes: 3 additions & 3 deletions system-parachains/asset-hub-paseo/tests/snowbridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use asset_hub_polkadot_runtime::xcm_config::bridging::{
use asset_hub_paseo_runtime::xcm_config::bridging::{
to_ethereum::{BridgeHubEthereumBaseFee, BridgeTable, EthereumNetwork},
SiblingBridgeHub, XcmBridgeHubRouterFeeAssetId,
};
Expand Down Expand Up @@ -54,8 +54,8 @@ fn network_export_table_works() {
.into(),
None,
),
// From Ethereum with the Sepolia chain ID instead of Mainnet, not matched.
(NetworkId::Ethereum { chain_id: 11155111 }, Junctions::Here, None),
// From Ethereum with the Mainnet chain ID instead of Sepolia, not matched.
(NetworkId::Ethereum { chain_id: 1 }, Junctions::Here, None),
];

for (network, remote_location, expected_result) in test_data {
Expand Down
16 changes: 8 additions & 8 deletions system-parachains/asset-hub-paseo/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@
use asset_hub_paseo_runtime::{
xcm_config::{
bridging::{self, XcmBridgeHubRouterFeeAssetId},
bridging::self,
CheckingAccount, DotLocation, ForeignCreatorsSovereignAccountOf, LocationToAccountId,
RelayTreasuryLocation, RelayTreasuryPalletAccount, StakingPot,
RelayTreasuryLocation, RelayTreasuryPalletAccount,
TrustBackedAssetsPalletLocation, XcmConfig,
},
AllPalletsWithoutSystem, AssetConversion, AssetDeposit, Assets, Balances, ExistentialDeposit,
ForeignAssets, ForeignAssetsInstance, MetadataDepositBase, MetadataDepositPerByte,
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, SessionKeys,
ParachainSystem, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, SessionKeys,
TrustBackedAssetsInstance, XcmpQueue,
};
use asset_test_utils::{
test_cases_over_bridge::TestBridgingConfig, CollatorSessionKey, CollatorSessionKeys, ExtBuilder,
CollatorSessionKey, CollatorSessionKeys, ExtBuilder,
};
use codec::{Decode, Encode};
use frame_support::{assert_ok, traits::fungibles::InspectEnumerable};
use parachains_common::{
AccountId, AssetHubPaseoAuraId as AuraId, AssetIdForTrustBackedAssets, Balance,
AccountId, AuraId, AssetIdForTrustBackedAssets, Balance,
};
use parachains_runtimes_test_utils::SlotDurations;
use sp_consensus_aura::SlotDuration;
Expand All @@ -60,7 +60,7 @@ fn collator_session_key(account: [u8; 32]) -> CollatorSessionKey<Runtime> {
CollatorSessionKey::new(
AccountId::from(account),
AccountId::from(account),
SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(account)) },
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(account)) },
)
}

Expand Down Expand Up @@ -128,7 +128,7 @@ fn test_ed_is_one_hundredth_of_relay() {
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) },
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
Expand All @@ -147,7 +147,7 @@ fn test_assets_balances_api_works() {
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) },
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
Expand Down
23 changes: 12 additions & 11 deletions system-parachains/asset-hub-paseo/tests/weight_trader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

//! Tests for `WeighTrader` type of XCM Executor.
use asset_hub_polkadot_runtime::{
use asset_hub_paseo_runtime::{
xcm_config::{
AssetFeeAsExistentialDepositMultiplierFeeCharger, DotLocation, DotLocationV3, StakingPot,
TrustBackedAssetsPalletLocation, TrustBackedAssetsPalletLocationV3, XcmConfig,
Expand All @@ -34,9 +34,10 @@ use frame_support::{
},
weights::WeightToFee as WeightToFeeT,
};
use parachains_common::{AccountId, AssetHubPolkadotAuraId as AuraId};
use parachains_common::{AccountId, AuraId};
use paseo_runtime_constants::currency::UNITS;
use sp_runtime::traits::MaybeEquivalence;
use system_parachains_constants::polkadot::{currency::*, fee::WeightToFee};
use system_parachains_constants::paseo::fee::WeightToFee;
use xcm::latest::prelude::*;
use xcm_executor::traits::WeightTrader;

Expand All @@ -55,7 +56,7 @@ fn test_asset_xcm_trader() {
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) },
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
Expand Down Expand Up @@ -136,7 +137,7 @@ fn test_asset_xcm_trader_with_refund() {
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) },
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
Expand Down Expand Up @@ -220,7 +221,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() {
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) },
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
Expand Down Expand Up @@ -276,7 +277,7 @@ fn test_that_buying_ed_refund_does_not_refund() {
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) },
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
Expand Down Expand Up @@ -342,7 +343,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() {
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) },
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
Expand Down Expand Up @@ -405,7 +406,7 @@ fn test_buy_and_refund_weight_with_native() {
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) },
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
Expand Down Expand Up @@ -463,7 +464,7 @@ fn test_buy_and_refund_weight_with_swap_local_asset_xcm_trader() {
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) },
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
Expand Down Expand Up @@ -565,7 +566,7 @@ fn test_buy_and_refund_weight_with_swap_foreign_asset_xcm_trader() {
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) },
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
Expand Down
10 changes: 7 additions & 3 deletions system-parachains/bridge-hub-paseo/tests/snowbridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ fn test_xcm_fee_manager_from_components_bh_origin_in_waived_locations() {

/// Fee is waived when origin is in waived location with Export message, but not to Ethereum.
#[test]
fn test_xcm_fee_manager_from_components_bh_origin_in_waived_locations_with_export_to_paseo_reason(
) {
fn test_xcm_fee_manager_from_components_bh_origin_in_waived_locations_with_export_to_paseo_reason()
{
assert!(TestXcmFeeManager::is_waived(
Some(&Location::new(1, [Parachain(2)])),
FeeReason::Export { network: Polkadot, destination: Here }
Expand Down Expand Up @@ -398,7 +398,11 @@ where
let xcm = Xcm(vec![
WithdrawAsset(Assets::from(vec![fee.clone()])),
BuyExecution { fees: fee, weight_limit: Unlimited },
ExportMessage { network: Ethereum { chain_id: 11155111 }, destination: Here, xcm: inner_xcm },
ExportMessage {
network: Ethereum { chain_id: 11155111 },
destination: Here,
xcm: inner_xcm,
},
]);

// execute XCM
Expand Down

0 comments on commit 97ff40a

Please sign in to comment.