diff --git a/parachain/pallets/ethereum-client/src/tests.rs b/parachain/pallets/ethereum-client/src/tests.rs index d6996838fb..ca3435877c 100644 --- a/parachain/pallets/ethereum-client/src/tests.rs +++ b/parachain/pallets/ethereum-client/src/tests.rs @@ -629,22 +629,19 @@ fn submit_update_with_skipped_sync_committee_period() { #[test] fn submit_update_execution_headers_too_far_behind() { - let checkpoint = load_checkpoint_update_fixture(); - let finalized_header_update = load_finalized_header_update_fixture(); - let execution_header_update = load_execution_header_update_fixture(); - let next_update = load_next_sync_committee_update_fixture(); + let checkpoint = Box::new(load_checkpoint_update_fixture()); + let finalized_header_update = Box::new(load_finalized_header_update_fixture()); + let execution_header_update = Box::new(load_execution_header_update_fixture()); + let next_update = Box::new(load_next_sync_committee_update_fixture()); new_tester().execute_with(|| { let far_ahead_finalized_header_slot = finalized_header_update.finalized_header.slot + (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH * 2) as u64; assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(finalized_header_update) - )); + assert_ok!(EthereumBeaconClient::submit(RuntimeOrigin::signed(1), finalized_header_update)); assert_ok!(EthereumBeaconClient::submit_execution_header( RuntimeOrigin::signed(1), - Box::new(execution_header_update) + execution_header_update )); let header_root: H256 = TEST_HASH.into(); @@ -658,7 +655,7 @@ fn submit_update_execution_headers_too_far_behind() { LatestFinalizedBlockRoot::::set(header_root); assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(next_update)), + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), next_update), Error::::ExecutionHeaderTooFarBehind ); }); @@ -699,14 +696,14 @@ fn submit_update_with_missing_bootstrap() { #[test] fn submit_update_with_invalid_sync_committee_update() { - let checkpoint = load_checkpoint_update_fixture(); - let update = load_sync_committee_update_fixture(); - let mut next_update = load_next_sync_committee_update_fixture(); + let checkpoint = Box::new(load_checkpoint_update_fixture()); + let update = Box::new(load_sync_committee_update_fixture()); + let mut next_update = Box::new(load_next_sync_committee_update_fixture()); new_tester().execute_with(|| { assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update))); + assert_ok!(EthereumBeaconClient::submit(RuntimeOrigin::signed(1), update)); // makes update with invalid next_sync_committee >::mutate(>::get(), |x| { @@ -719,7 +716,7 @@ fn submit_update_with_invalid_sync_committee_update() { next_update.next_sync_committee_update = Some(next_sync_committee); assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(next_update)), + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), next_update), Error::::InvalidSyncCommitteeUpdate ); }); diff --git a/parachain/runtime/runtime-common/src/lib.rs b/parachain/runtime/runtime-common/src/lib.rs index 475aa8aee4..aae45520ff 100644 --- a/parachain/runtime/runtime-common/src/lib.rs +++ b/parachain/runtime/runtime-common/src/lib.rs @@ -52,7 +52,7 @@ impl where Balance: BaseArithmetic + Unsigned + Copy + From + Into + Debug, - AccountId: Clone + Into<[u8; 32]> + From<[u8; 32]> + FullCodec, + AccountId: Clone + FullCodec, FeeAssetLocation: Get, EthereumNetwork: Get, AssetTransactor: TransactAsset, diff --git a/parachain/runtime/runtime-common/src/tests.rs b/parachain/runtime/runtime-common/src/tests.rs index 3b01a6b043..50df6dc9aa 100644 --- a/parachain/runtime/runtime-common/src/tests.rs +++ b/parachain/runtime/runtime-common/src/tests.rs @@ -5,10 +5,10 @@ use xcm::prelude::{ Asset, Assets, Here, Kusama, Location, NetworkId, Parachain, XcmContext, XcmError, XcmHash, XcmResult, }; -use xcm_builder::HandleFee; use xcm_executor::{ - traits::{FeeReason, TransactAsset}, + traits::{FeeReason, TransactAsset}, AssetsInHolding, }; +use xcm_builder::HandleFee; parameter_types! { pub EthereumNetwork: NetworkId = NetworkId::Ethereum { chain_id: 11155111 }; @@ -74,8 +74,8 @@ impl TransactAsset for MockAssetTransactor { _what: &Asset, _who: &Location, _context: Option<&XcmContext>, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(Assets::default().into()) } fn internal_transfer_asset( @@ -83,8 +83,8 @@ impl TransactAsset for MockAssetTransactor { _from: &Location, _to: &Location, _context: &XcmContext, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(Assets::default().into()) } }