From f5546ca00e33b37104743623189542180a8685e2 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Mon, 12 May 2025 12:49:57 +0200 Subject: [PATCH 1/7] - Import fix for 2412 --- template/node/src/service.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/template/node/src/service.rs b/template/node/src/service.rs index b73c126..e3167a3 100644 --- a/template/node/src/service.rs +++ b/template/node/src/service.rs @@ -18,7 +18,6 @@ use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImpo use cumulus_client_consensus_proposer::Proposer; use cumulus_client_network::RequireSecondedInBlockAnnounce; use cumulus_client_parachain_inherent::{MockValidationDataInherentDataProvider, MockXcmConfig}; -use cumulus_primitives_core::CollectCollationInfo; #[allow(deprecated)] use cumulus_client_service::{ prepare_node_config, start_relay_chain_tasks, DARecoveryProfile, StartRelayChainTasksParams, @@ -29,7 +28,6 @@ use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain; use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface, RelayChainResult}; use cumulus_relay_chain_minimal_node::build_minimal_relay_chain_node_with_rpc; -use polkadot_primitives::UpgradeGoAhead; use polkadot_service::CollatorPair; use polkadot_primitives::UpgradeGoAhead; @@ -164,6 +162,7 @@ pub fn new_partial( &task_manager.spawn_essential_handle(), config.prometheus_registry().clone(), false, + true, )?; Ok(PartialComponents { From 462386635e65cb7c18590eaa7b4da0063f618aab Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Mon, 12 May 2025 12:51:43 +0200 Subject: [PATCH 2/7] - fmt --- .../src/collators/lookahead.rs | 2 +- template/node/src/service.rs | 68 +++++++++---------- template/runtime/src/lib.rs | 4 +- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/client/consensus/nimbus-consensus/src/collators/lookahead.rs b/client/consensus/nimbus-consensus/src/collators/lookahead.rs index 45a2919..f4939ea 100644 --- a/client/consensus/nimbus-consensus/src/collators/lookahead.rs +++ b/client/consensus/nimbus-consensus/src/collators/lookahead.rs @@ -23,7 +23,7 @@ use cumulus_client_consensus_common::{ }; use cumulus_client_consensus_proposer::ProposerInterface; use cumulus_primitives_core::{ - relay_chain::{AsyncBackingParams, CoreIndex, vstaging::CoreState, Hash as PHash}, + relay_chain::{vstaging::CoreState, AsyncBackingParams, CoreIndex, Hash as PHash}, CollectCollationInfo, ParaId, }; use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; diff --git a/template/node/src/service.rs b/template/node/src/service.rs index e3167a3..6702c3a 100644 --- a/template/node/src/service.rs +++ b/template/node/src/service.rs @@ -28,8 +28,8 @@ use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain; use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface, RelayChainResult}; use cumulus_relay_chain_minimal_node::build_minimal_relay_chain_node_with_rpc; -use polkadot_service::CollatorPair; use polkadot_primitives::UpgradeGoAhead; +use polkadot_service::CollatorPair; // Substrate Imports use futures::FutureExt; @@ -140,14 +140,14 @@ pub fn new_partial( // And sovereign nodes, so we create it anyway. let select_chain = sc_consensus::LongestChain::new(backend.clone()); - let transaction_pool = sc_transaction_pool::Builder::new( - task_manager.spawn_essential_handle(), - client.clone(), - config.role.is_authority().into(), - ) - .with_options(config.transaction_pool.clone()) - .with_prometheus(config.prometheus_registry()) - .build(); + let transaction_pool = sc_transaction_pool::Builder::new( + task_manager.spawn_essential_handle(), + client.clone(), + config.role.is_authority().into(), + ) + .with_options(config.transaction_pool.clone()) + .with_prometheus(config.prometheus_registry()) + .build(); let block_import = ParachainBlockImport::new(client.clone(), backend.clone()); @@ -190,9 +190,11 @@ async fn build_relay_chain_interface( if let cumulus_client_cli::RelayChainMode::ExternalRpc(rpc_target_urls) = collator_options.relay_chain_mode { - build_minimal_relay_chain_node_with_rpc(polkadot_config, - parachain_config.prometheus_registry(), - task_manager, rpc_target_urls, + build_minimal_relay_chain_node_with_rpc( + polkadot_config, + parachain_config.prometheus_registry(), + task_manager, + rpc_target_urls, ) .await } else { @@ -560,21 +562,20 @@ where let hrmp_xcm_receiver = hrmp_xcm_receiver.clone(); let client_for_xcm = client_set_aside_for_cidp.clone(); - let current_para_head = client_set_aside_for_cidp - .header(block) - .expect("Header lookup should succeed") - .expect("Header passed in as parent should be present in backend."); - let should_send_go_ahead = match client_set_aside_for_cidp - .runtime_api() - .collect_collation_info(block, ¤t_para_head) - { - Ok(info) => info.new_validation_code.is_some(), - Err(e) => { - log::error!("Failed to collect collation info: {:?}", e); - false - }, - }; - + let current_para_head = client_set_aside_for_cidp + .header(block) + .expect("Header lookup should succeed") + .expect("Header passed in as parent should be present in backend."); + let should_send_go_ahead = match client_set_aside_for_cidp + .runtime_api() + .collect_collation_info(block, ¤t_para_head) + { + Ok(info) => info.new_validation_code.is_some(), + Err(e) => { + log::error!("Failed to collect collation info: {:?}", e); + false + } + }; async move { let time = sp_timestamp::InherentDataProvider::from_system_time(); @@ -594,13 +595,12 @@ where raw_downward_messages: downward_xcm_receiver.drain().collect(), raw_horizontal_messages: hrmp_xcm_receiver.drain().collect(), para_id: para_id.into(), - upgrade_go_ahead: should_send_go_ahead.then(|| { - log::info!( - "Detected pending validation code, sending go-ahead signal." - ); - UpgradeGoAhead::GoAhead - }), - + upgrade_go_ahead: should_send_go_ahead.then(|| { + log::info!( + "Detected pending validation code, sending go-ahead signal." + ); + UpgradeGoAhead::GoAhead + }), }; Ok((time, mocked_parachain)) diff --git a/template/runtime/src/lib.rs b/template/runtime/src/lib.rs index b9ecaec..65de19d 100644 --- a/template/runtime/src/lib.rs +++ b/template/runtime/src/lib.rs @@ -347,7 +347,7 @@ impl frame_system::Config for Runtime { type PreInherents = (); type PostInherents = (); type PostTransactions = (); - type ExtensionsWeightInfo = (); + type ExtensionsWeightInfo = (); } parameter_types! { @@ -384,7 +384,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = (); type FreezeIdentifier = (); type MaxFreezes = ConstU32<0>; - type DoneSlashHandler = (); + type DoneSlashHandler = (); } parameter_types! { From 44f3db0795378832b28a0b6344105b8c88965a6a Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Mon, 12 May 2025 12:52:32 +0200 Subject: [PATCH 3/7] - fixed CI --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91bb9e8..cd6a754 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -202,12 +202,12 @@ jobs: - name: Cargo build uses: ./.github/workflow-templates/cargo-build - name: Upload runtimes - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v4 with: name: runtimes path: runtimes - name: Upload binary - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v4 with: name: moonkit-template path: build/moonkit-template @@ -228,7 +228,7 @@ jobs: with: features: "try-runtime,runtime-benchmarks" - name: Upload binary - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v4 with: name: moonkit-template-features path: build/moonkit-template From dff503d13a039782cc386baa134b0b2ba21ab5d2 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Mon, 12 May 2025 13:56:21 +0200 Subject: [PATCH 4/7] - fixed tests --- precompiles/assets-erc20/src/mock.rs | 3 +++ precompiles/balances-erc20/src/mock.rs | 3 +++ precompiles/batch/src/mock.rs | 4 ++++ precompiles/batch/src/tests.rs | 3 ++- precompiles/call-permit/src/mock.rs | 4 ++++ precompiles/pallet-xcm/src/mock.rs | 3 +++ precompiles/proxy/src/mock.rs | 3 +++ precompiles/proxy/src/tests.rs | 6 +++--- precompiles/xcm-utils/src/mock.rs | 3 +++ precompiles/xcm-utils/src/tests.rs | 2 +- 10 files changed, 29 insertions(+), 5 deletions(-) diff --git a/precompiles/assets-erc20/src/mock.rs b/precompiles/assets-erc20/src/mock.rs index 0435517..31c3bd2 100644 --- a/precompiles/assets-erc20/src/mock.rs +++ b/precompiles/assets-erc20/src/mock.rs @@ -194,6 +194,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } type ForeignAssetInstance = pallet_assets::Instance1; diff --git a/precompiles/balances-erc20/src/mock.rs b/precompiles/balances-erc20/src/mock.rs index 341103b..ccd0700 100644 --- a/precompiles/balances-erc20/src/mock.rs +++ b/precompiles/balances-erc20/src/mock.rs @@ -143,6 +143,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } // Configure a mock runtime to test the pallet. diff --git a/precompiles/batch/src/mock.rs b/precompiles/batch/src/mock.rs index eb02e28..ba72ab4 100644 --- a/precompiles/batch/src/mock.rs +++ b/precompiles/batch/src/mock.rs @@ -158,6 +158,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } parameter_types! { @@ -204,6 +207,7 @@ impl ExtBuilder { pallet_evm::Pallet::::create_account( Revert.into(), hex_literal::hex!("1460006000fd").to_vec(), + None ); }); ext diff --git a/precompiles/batch/src/tests.rs b/precompiles/batch/src/tests.rs index a0e484c..026f6a4 100644 --- a/precompiles/batch/src/tests.rs +++ b/precompiles/batch/src/tests.rs @@ -1008,7 +1008,7 @@ fn batch_not_callable_by_smart_contract() { .execute_with(|| { // "deploy" SC to alice address let alice_h160: H160 = Alice.into(); - pallet_evm::Pallet::::create_account(alice_h160, vec![10u8]); + pallet_evm::Pallet::::create_account(alice_h160, vec![10u8], None); // succeeds if not called by SC, see `evm_batch_recursion_under_limit` let input = PCall::batch_all { @@ -1052,6 +1052,7 @@ fn batch_is_not_callable_by_dummy_code() { pallet_evm::Pallet::::create_account( alice_h160, [0x60, 0x00, 0x60, 0x00, 0xfd].to_vec(), + None ); // succeeds if called by dummy code, see `evm_batch_recursion_under_limit` diff --git a/precompiles/call-permit/src/mock.rs b/precompiles/call-permit/src/mock.rs index 4737bbb..cdf1f54 100644 --- a/precompiles/call-permit/src/mock.rs +++ b/precompiles/call-permit/src/mock.rs @@ -144,6 +144,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } parameter_types! { @@ -190,6 +193,7 @@ impl ExtBuilder { pallet_evm::Pallet::::create_account( Revert.into(), hex_literal::hex!("1460006000fd").to_vec(), + None ); }); ext diff --git a/precompiles/pallet-xcm/src/mock.rs b/precompiles/pallet-xcm/src/mock.rs index 67d8993..611797f 100644 --- a/precompiles/pallet-xcm/src/mock.rs +++ b/precompiles/pallet-xcm/src/mock.rs @@ -276,6 +276,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } parameter_types! { diff --git a/precompiles/proxy/src/mock.rs b/precompiles/proxy/src/mock.rs index e7d9d1b..381dd46 100644 --- a/precompiles/proxy/src/mock.rs +++ b/precompiles/proxy/src/mock.rs @@ -181,6 +181,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } parameter_types! { diff --git a/precompiles/proxy/src/tests.rs b/precompiles/proxy/src/tests.rs index b055d53..4646f60 100644 --- a/precompiles/proxy/src/tests.rs +++ b/precompiles/proxy/src/tests.rs @@ -578,7 +578,7 @@ fn fails_if_called_by_smart_contract() { .build() .execute_with(|| { // Set code to Alice address as it if was a smart contract. - pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8]); + pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); PrecompilesValue::get() .prepare_test( @@ -776,8 +776,8 @@ fn proxy_proxy_should_fail_if_called_by_smart_contract_for_a_non_eoa_account() { .build() .execute_with(|| { // Set code to Alice & Bob addresses as if they are smart contracts. - pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8]); - pallet_evm::Pallet::::create_account(H160::from(Bob), vec![10u8]); + pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); + pallet_evm::Pallet::::create_account(H160::from(Bob), vec![10u8], None); // Bob allows Alice to make calls on his behalf assert_ok!(RuntimeCall::Proxy(ProxyCall::add_proxy { diff --git a/precompiles/xcm-utils/src/mock.rs b/precompiles/xcm-utils/src/mock.rs index 95cf42a..aa2d8eb 100644 --- a/precompiles/xcm-utils/src/mock.rs +++ b/precompiles/xcm-utils/src/mock.rs @@ -278,6 +278,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } parameter_types! { diff --git a/precompiles/xcm-utils/src/tests.rs b/precompiles/xcm-utils/src/tests.rs index 6fccf41..80c9e2d 100644 --- a/precompiles/xcm-utils/src/tests.rs +++ b/precompiles/xcm-utils/src/tests.rs @@ -242,7 +242,7 @@ fn execute_fails_if_called_by_smart_contract() { .build() .execute_with(|| { // Set code to Alice address as it if was a smart contract. - pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8]); + pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); let xcm_to_execute = VersionedXcm::<()>::from(Xcm(vec![ClearOrigin])).encode(); From c8387755838b9e2ae4fba764bd0b0b83efb57f2c Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Mon, 12 May 2025 13:57:52 +0200 Subject: [PATCH 5/7] - formatting --- precompiles/batch/src/mock.rs | 2 +- precompiles/batch/src/tests.rs | 2 +- precompiles/call-permit/src/mock.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/precompiles/batch/src/mock.rs b/precompiles/batch/src/mock.rs index ba72ab4..87cdda8 100644 --- a/precompiles/batch/src/mock.rs +++ b/precompiles/batch/src/mock.rs @@ -207,7 +207,7 @@ impl ExtBuilder { pallet_evm::Pallet::::create_account( Revert.into(), hex_literal::hex!("1460006000fd").to_vec(), - None + None, ); }); ext diff --git a/precompiles/batch/src/tests.rs b/precompiles/batch/src/tests.rs index 026f6a4..79e82d9 100644 --- a/precompiles/batch/src/tests.rs +++ b/precompiles/batch/src/tests.rs @@ -1052,7 +1052,7 @@ fn batch_is_not_callable_by_dummy_code() { pallet_evm::Pallet::::create_account( alice_h160, [0x60, 0x00, 0x60, 0x00, 0xfd].to_vec(), - None + None, ); // succeeds if called by dummy code, see `evm_batch_recursion_under_limit` diff --git a/precompiles/call-permit/src/mock.rs b/precompiles/call-permit/src/mock.rs index cdf1f54..9f5bb5b 100644 --- a/precompiles/call-permit/src/mock.rs +++ b/precompiles/call-permit/src/mock.rs @@ -193,7 +193,7 @@ impl ExtBuilder { pallet_evm::Pallet::::create_account( Revert.into(), hex_literal::hex!("1460006000fd").to_vec(), - None + None, ); }); ext From 946d3a244477ae89ff73b182ad7f43f38e7600a0 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Mon, 12 May 2025 15:53:14 +0200 Subject: [PATCH 6/7] - Fixed tests --- precompiles/batch/src/mock.rs | 2 +- precompiles/batch/src/tests.rs | 4 ++-- precompiles/call-permit/src/mock.rs | 2 +- precompiles/proxy/src/tests.rs | 6 +++--- precompiles/xcm-utils/src/tests.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/precompiles/batch/src/mock.rs b/precompiles/batch/src/mock.rs index 87cdda8..a6618af 100644 --- a/precompiles/batch/src/mock.rs +++ b/precompiles/batch/src/mock.rs @@ -204,7 +204,7 @@ impl ExtBuilder { let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| { System::set_block_number(1); - pallet_evm::Pallet::::create_account( + let _ = pallet_evm::Pallet::::create_account( Revert.into(), hex_literal::hex!("1460006000fd").to_vec(), None, diff --git a/precompiles/batch/src/tests.rs b/precompiles/batch/src/tests.rs index 79e82d9..d150efa 100644 --- a/precompiles/batch/src/tests.rs +++ b/precompiles/batch/src/tests.rs @@ -1008,7 +1008,7 @@ fn batch_not_callable_by_smart_contract() { .execute_with(|| { // "deploy" SC to alice address let alice_h160: H160 = Alice.into(); - pallet_evm::Pallet::::create_account(alice_h160, vec![10u8], None); + let _ = pallet_evm::Pallet::::create_account(alice_h160, vec![10u8], None); // succeeds if not called by SC, see `evm_batch_recursion_under_limit` let input = PCall::batch_all { @@ -1049,7 +1049,7 @@ fn batch_is_not_callable_by_dummy_code() { .execute_with(|| { // "deploy" dummy code to alice address let alice_h160: H160 = Alice.into(); - pallet_evm::Pallet::::create_account( + let _ = pallet_evm::Pallet::::create_account( alice_h160, [0x60, 0x00, 0x60, 0x00, 0xfd].to_vec(), None, diff --git a/precompiles/call-permit/src/mock.rs b/precompiles/call-permit/src/mock.rs index 9f5bb5b..568d1f0 100644 --- a/precompiles/call-permit/src/mock.rs +++ b/precompiles/call-permit/src/mock.rs @@ -190,7 +190,7 @@ impl ExtBuilder { let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| { System::set_block_number(1); - pallet_evm::Pallet::::create_account( + let _ = pallet_evm::Pallet::::create_account( Revert.into(), hex_literal::hex!("1460006000fd").to_vec(), None, diff --git a/precompiles/proxy/src/tests.rs b/precompiles/proxy/src/tests.rs index 4646f60..8e8e99c 100644 --- a/precompiles/proxy/src/tests.rs +++ b/precompiles/proxy/src/tests.rs @@ -578,7 +578,7 @@ fn fails_if_called_by_smart_contract() { .build() .execute_with(|| { // Set code to Alice address as it if was a smart contract. - pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); + let _ = pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); PrecompilesValue::get() .prepare_test( @@ -776,8 +776,8 @@ fn proxy_proxy_should_fail_if_called_by_smart_contract_for_a_non_eoa_account() { .build() .execute_with(|| { // Set code to Alice & Bob addresses as if they are smart contracts. - pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); - pallet_evm::Pallet::::create_account(H160::from(Bob), vec![10u8], None); + let _ = pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); + let _ = pallet_evm::Pallet::::create_account(H160::from(Bob), vec![10u8], None); // Bob allows Alice to make calls on his behalf assert_ok!(RuntimeCall::Proxy(ProxyCall::add_proxy { diff --git a/precompiles/xcm-utils/src/tests.rs b/precompiles/xcm-utils/src/tests.rs index 80c9e2d..6c21991 100644 --- a/precompiles/xcm-utils/src/tests.rs +++ b/precompiles/xcm-utils/src/tests.rs @@ -242,7 +242,7 @@ fn execute_fails_if_called_by_smart_contract() { .build() .execute_with(|| { // Set code to Alice address as it if was a smart contract. - pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); + let _ = pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); let xcm_to_execute = VersionedXcm::<()>::from(Xcm(vec![ClearOrigin])).encode(); From 21932ab2d5be146e134256b88ca72c58ca2f7530 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Mon, 12 May 2025 16:25:01 +0200 Subject: [PATCH 7/7] - fmt --- precompiles/proxy/src/tests.rs | 9 ++++++--- precompiles/xcm-utils/src/tests.rs | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/precompiles/proxy/src/tests.rs b/precompiles/proxy/src/tests.rs index 8e8e99c..a2cc843 100644 --- a/precompiles/proxy/src/tests.rs +++ b/precompiles/proxy/src/tests.rs @@ -578,7 +578,8 @@ fn fails_if_called_by_smart_contract() { .build() .execute_with(|| { // Set code to Alice address as it if was a smart contract. - let _ = pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); + let _ = + pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); PrecompilesValue::get() .prepare_test( @@ -776,8 +777,10 @@ fn proxy_proxy_should_fail_if_called_by_smart_contract_for_a_non_eoa_account() { .build() .execute_with(|| { // Set code to Alice & Bob addresses as if they are smart contracts. - let _ = pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); - let _ = pallet_evm::Pallet::::create_account(H160::from(Bob), vec![10u8], None); + let _ = + pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); + let _ = + pallet_evm::Pallet::::create_account(H160::from(Bob), vec![10u8], None); // Bob allows Alice to make calls on his behalf assert_ok!(RuntimeCall::Proxy(ProxyCall::add_proxy { diff --git a/precompiles/xcm-utils/src/tests.rs b/precompiles/xcm-utils/src/tests.rs index 6c21991..7401562 100644 --- a/precompiles/xcm-utils/src/tests.rs +++ b/precompiles/xcm-utils/src/tests.rs @@ -242,7 +242,8 @@ fn execute_fails_if_called_by_smart_contract() { .build() .execute_with(|| { // Set code to Alice address as it if was a smart contract. - let _ = pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); + let _ = + pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); let xcm_to_execute = VersionedXcm::<()>::from(Xcm(vec![ClearOrigin])).encode();