Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden authored and claravanstaden committed Jan 25, 2024
1 parent 2afac31 commit 0a9f957
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -49,7 +50,11 @@ fn collator_session_keys() -> bridge_hub_test_utils::CollatorSessionKeys<Runtime

#[test]
pub fn transfer_token_to_ethereum_works() {
snowbridge_runtime_test_common::send_transfer_token_message_success::<Runtime, XcmConfig>(
snowbridge_runtime_test_common::send_transfer_token_message_success::<
Runtime,
XcmConfig,
AllPalletsWithoutSystem,
>(
collator_session_keys(),
1013,
1000,
Expand Down
6 changes: 5 additions & 1 deletion cumulus/parachains/runtimes/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -300,6 +300,10 @@ where
<Runtime as frame_system::Config>::RuntimeOrigin::root()
}

pub fn block_number() -> U256 {
frame_system::Pallet::<Runtime>::block_number().into()
}

pub fn origin_of(
account_id: AccountIdOf<Runtime>,
) -> <Runtime as frame_system::Config>::RuntimeOrigin {
Expand Down

0 comments on commit 0a9f957

Please sign in to comment.