Skip to content

Commit

Permalink
remove unused imports for tests; update deprecated methods for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Raid5594 committed Aug 30, 2023
1 parent 039c83f commit 329f55c
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pallets/chainbridge/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
use super::*;

use frame_support::{
assert_ok, ord_parameter_types, parameter_types, traits::Everything, weights::Weight, PalletId,
assert_ok, ord_parameter_types, parameter_types, traits::Everything, weights::Weight,
};
use frame_system::{self as system};
use sp_core::H256;
use sp_runtime::{
testing::Header,
traits::{AccountIdConversion, BlakeTwo256, Block as BlockT, IdentityLookup},
traits::{AccountIdConversion, BlakeTwo256, IdentityLookup},
Perbill,
};

Expand Down Expand Up @@ -146,7 +146,7 @@ pub fn new_test_ext_initialized(
// include the most recent event, but do not have to include every past event.
pub fn assert_events(mut expected: Vec<RuntimeEvent>) {
let mut actual: Vec<RuntimeEvent> =
system::Module::<Test>::events().iter().map(|e| e.event.clone()).collect();
system::Pallet::<Test>::events().iter().map(|e| e.event.clone()).collect();

expected.reverse();

Expand Down
1 change: 0 additions & 1 deletion pallets/chainbridge/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use super::{
};
use crate::mock::new_test_ext_initialized;
use frame_support::{assert_noop, assert_ok};
use frame_system::Origin;

#[test]
fn derive_ids() {
Expand Down
3 changes: 1 addition & 2 deletions pallets/ddc-metrics-offchain-worker/src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use frame_support::traits::{Currency, OffchainWorker};
use frame_system::Config as FSC;
use pallet_contracts::{self as contracts, Config as CC};
use sp_core::offchain::{
testing, OffchainDbExt, OffchainWorkerExt, Timestamp as OCWTimestamp, TransactionPoolExt,
};
Expand Down Expand Up @@ -285,7 +284,7 @@ fn should_run_contract() {
let contract_id = deploy_contract();
let call_data = DdcMetricsOffchainWorker::encode_get_current_period_ms();

pallet_contracts::Module::<T>::call(
pallet_contracts::Pallet::<T>::call(
RuntimeOrigin::signed(alice.clone()),
contract_id.clone(),
0,
Expand Down
3 changes: 0 additions & 3 deletions pallets/ddc-metrics-offchain-worker/src/tests/test_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use crate::{self as pallet_ddc_metrics_offchain_worker, *};

use codec::{Decode, Encode};
use frame_support::{
parameter_types,
traits::{ConstU32, Currency, Everything, Get, Nothing},
Expand All @@ -30,8 +29,6 @@ pub type Moment = u64;
// -- Implement a contracts runtime for testing --

// Macro hack: Give names to the pallets.
use frame_system as system;
use pallet_balances as balances;
use pallet_contracts as contracts;

type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
Expand Down
1 change: 0 additions & 1 deletion pallets/ddc/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate as pallet_cere_ddc;
use crate::Module;
use frame_support::{construct_runtime, parameter_types, traits::Everything};
use frame_system as system;
use sp_core::H256;
Expand Down
2 changes: 1 addition & 1 deletion pallets/erc721/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use frame_system::{self as system};
use sp_core::{hashing::blake2_128, H256};
use sp_runtime::{
testing::Header,
traits::{BlakeTwo256, Block as BlockT, IdentityLookup},
traits::{BlakeTwo256, IdentityLookup},
BuildStorage, Perbill,
};

Expand Down
5 changes: 4 additions & 1 deletion runtime/cere-dev/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ mod multiplier_tests {
System, TargetBlockFullness, TransactionPayment,
};
use cere_dev_runtime_constants::{currency::*, time::*};
use frame_support::weights::{DispatchClass, Weight, WeightToFee as WeightToFeeT};
use frame_support::{
dispatch::DispatchClass,
weights::{Weight, WeightToFee as WeightToFeeT},
};
use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment};
use sp_runtime::{
assert_eq_error_rate,
Expand Down
5 changes: 4 additions & 1 deletion runtime/cere/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ mod multiplier_tests {
System, TargetBlockFullness, TransactionPayment,
};
use cere_runtime_constants::{currency::*, time::*};
use frame_support::weights::{DispatchClass, Weight, WeightToFee as WeightToFeeT};
use frame_support::{
dispatch::DispatchClass,
weights::{Weight, WeightToFee as WeightToFeeT},
};
use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment};
use sp_runtime::{
assert_eq_error_rate,
Expand Down

0 comments on commit 329f55c

Please sign in to comment.