From 0a9f9572cda3b2246a3a53a4ed9384444b89f50e Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 25 Jan 2024 16:22:22 +0200 Subject: [PATCH] more tests --- .../bridge-hub-rococo/tests/snowbridge.rs | 19 ++++++++++++------- .../parachains/runtimes/test-utils/src/lib.rs | 6 +++++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/snowbridge.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/snowbridge.rs index afc2990d4aa0..a432ad8c2d0e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/snowbridge.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/snowbridge.rs @@ -18,16 +18,17 @@ use bp_polkadot_core::Signature; use bridge_hub_rococo_runtime::{ - xcm_config::XcmConfig, Executive, MessageQueueServiceWeight, Runtime, RuntimeCall, RuntimeEvent, - SessionKeys, SignedExtra, UncheckedExtrinsic, BridgeRejectObsoleteHeadersAndMessages + bridge_to_bulletin_config::OnBridgeHubRococoRefundRococoBulletinMessages, + bridge_to_westend_config::OnBridgeHubRococoRefundBridgeHubWestendMessages, + xcm_config::XcmConfig, AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages, + Executive, MessageQueueServiceWeight, Runtime, RuntimeCall, RuntimeEvent, SessionKeys, + SignedExtra, UncheckedExtrinsic, }; -use bridge_hub_rococo_runtime::bridge_to_westend_config::OnBridgeHubRococoRefundBridgeHubWestendMessages; -use bridge_hub_rococo_runtime::bridge_to_bulletin_config::OnBridgeHubRococoRefundRococoBulletinMessages; -use codec::{Encode, Decode}; +use codec::{Decode, Encode}; use cumulus_primitives_core::XcmError::{FailedToTransactAsset, NotHoldingFees}; use frame_support::parameter_types; use parachains_common::{AccountId, AuraId, Balance}; -use snowbridge_pallet_ethereum_client::{ExecutionHeaderBuffer, WeightInfo}; +use snowbridge_pallet_ethereum_client::WeightInfo; use sp_core::H160; use sp_keyring::AccountKeyring::Alice; use sp_runtime::{ @@ -49,7 +50,11 @@ fn collator_session_keys() -> bridge_hub_test_utils::CollatorSessionKeys( + snowbridge_runtime_test_common::send_transfer_token_message_success::< + Runtime, + XcmConfig, + AllPalletsWithoutSystem, + >( collator_session_keys(), 1013, 1000, diff --git a/cumulus/parachains/runtimes/test-utils/src/lib.rs b/cumulus/parachains/runtimes/test-utils/src/lib.rs index eb75c2f7ee0a..b4eb57fcb66f 100644 --- a/cumulus/parachains/runtimes/test-utils/src/lib.rs +++ b/cumulus/parachains/runtimes/test-utils/src/lib.rs @@ -33,7 +33,7 @@ use polkadot_parachain_primitives::primitives::{ HeadData, HrmpChannelId, RelayChainBlockNumber, XcmpMessageFormat, }; use sp_consensus_aura::{SlotDuration, AURA_ENGINE_ID}; -use sp_core::Encode; +use sp_core::{Encode, U256}; use sp_runtime::{traits::Header, BuildStorage, Digest, DigestItem}; use xcm::{ latest::{Asset, Location, XcmContext, XcmHash}, @@ -300,6 +300,10 @@ where ::RuntimeOrigin::root() } + pub fn block_number() -> U256 { + frame_system::Pallet::::block_number().into() + } + pub fn origin_of( account_id: AccountIdOf, ) -> ::RuntimeOrigin {