Skip to content

Commit

Permalink
Remove useless CheckWeight. (#1760)
Browse files Browse the repository at this point in the history
Remove unused imports
  • Loading branch information
Neopallium authored Nov 27, 2024
1 parent b6c926c commit 3bbc3eb
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 238 deletions.
21 changes: 0 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ polymesh-common-utilities = { path = "pallets/common", default-features = false
polymesh-runtime-common = { path = "pallets/runtime/common", default-features = false }
polymesh-primitives = { path = "primitives", default-features = false }
polymesh-weights = { path = "pallets/weights/", default-features = false }
polymesh-extensions = { path = "pallets/runtime/extensions", default-features = false }

# RPC
node-rpc = { path = "rpc" }
Expand Down Expand Up @@ -281,7 +280,6 @@ polymesh-contracts = { workspace = true, default-features = false }
polymesh-common-utilities = { workspace = true, default-features = false }
polymesh-primitives = { workspace = true, default-features = false }
polymesh-runtime-common = { workspace = true, default-features = false }
polymesh-extensions = { workspace = true, default-features = false }

# RPC
node-rpc = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion pallets/common/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mod test {
use polymesh_primitives::{AccountId, IdentityId};

use sp_keyring::AccountKeyring;
use std::{collections::BTreeMap, convert::From, sync::RwLock, thread};
use std::{collections::BTreeMap, convert::From};

struct IdentityTest {}

Expand Down
4 changes: 2 additions & 2 deletions pallets/runtime/common/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ macro_rules! misc_pallet_impls {
frame_system::CheckGenesis::new(),
frame_system::CheckEra::from(generic::Era::mortal(period, current_block)),
frame_system::CheckNonce::from(nonce),
polymesh_extensions::CheckWeight::new(),
frame_system::CheckWeight::new(),
pallet_transaction_payment::ChargeTransactionPayment::from(tip),
pallet_permissions::StoreCallMetadata::new(),
);
Expand Down Expand Up @@ -749,7 +749,7 @@ macro_rules! runtime_apis {
frame_system::CheckGenesis<Runtime>,
frame_system::CheckEra<Runtime>,
frame_system::CheckNonce<Runtime>,
polymesh_extensions::CheckWeight<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
pallet_permissions::StoreCallMetadata<Runtime>,
);
Expand Down
2 changes: 0 additions & 2 deletions pallets/runtime/develop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ polymesh-common-utilities = { path = "../../common", default-features = false }
polymesh-runtime-common = { path = "../common", default-features = false }
polymesh-primitives = { path = "../../../primitives", default-features = false }
polymesh-weights = { path = "../../weights", default-features = false }
polymesh-extensions = { path = "../extensions", default-features = false }

# Our pallets
pallet-asset = { path = "../../asset", default-features = false }
Expand Down Expand Up @@ -199,7 +198,6 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"polymesh-contracts/std",
"polymesh-extensions/std",
]
runtime-benchmarks = [
"getrandom/js",
Expand Down
35 changes: 0 additions & 35 deletions pallets/runtime/extensions/Cargo.toml

This file was deleted.

164 changes: 0 additions & 164 deletions pallets/runtime/extensions/src/check_weight.rs

This file was deleted.

4 changes: 0 additions & 4 deletions pallets/runtime/extensions/src/lib.rs

This file was deleted.

1 change: 0 additions & 1 deletion pallets/runtime/mainnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ build = "build.rs"
[dependencies]
# Common
polymesh-common-utilities = { path = "../../common", default-features = false }
polymesh-extensions = { path = "../extensions", default-features = false }
polymesh-primitives = { path = "../../../primitives", default-features = false }
polymesh-runtime-common = { path = "../common", default-features = false}
polymesh-weights = { path = "../../weights", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion pallets/runtime/testnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ polymesh-common-utilities = { path = "../../common", default-features = false }
polymesh-runtime-common = { path = "../common", default-features = false}
polymesh-primitives = { path = "../../../primitives", default-features = false }
polymesh-weights = { path = "../../weights", default-features = false }
polymesh-extensions = { path = "../extensions", default-features = false }

# Our pallets
pallet-asset = { path = "../../asset", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion pallets/runtime/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pallet-treasury = { path = "../../treasury", default-features = false }
pallet-utility = { path = "../../utility", default-features = false }
polymesh-common-utilities = { path = "../../common", default-features = false }
polymesh-contracts = { path = "../../contracts", default-features = false }
polymesh-extensions = { path = "../extensions", default-features = false }
polymesh-primitives = { path = "../../../primitives", default-features = false }
polymesh-runtime-common = { path = "../common", default-features = false, features = ["testing"] }
polymesh-runtime-develop = { path = "../develop" }
Expand Down
6 changes: 4 additions & 2 deletions pallets/runtime/tests/src/signed_extra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use polymesh_runtime_develop::{
};

use frame_support::dispatch::{DispatchClass, DispatchInfo, Weight};
use frame_system::{CheckEra, CheckGenesis, CheckNonce, CheckSpecVersion, CheckTxVersion};
use frame_system::{
CheckEra, CheckGenesis, CheckNonce, CheckSpecVersion, CheckTxVersion, CheckWeight,
};
use sp_io::TestExternalities;
use sp_runtime::{generic, traits::SignedExtension};
use sp_std::convert::From;
Expand All @@ -33,7 +35,7 @@ fn make_signed_extra(current_block: u64, period: u64, nonce: Index, tip: u128) -
CheckGenesis::<Runtime>::new(),
CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
CheckNonce::<Runtime>::from(nonce),
polymesh_extensions::CheckWeight::<Runtime>::new(),
CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
pallet_permissions::StoreCallMetadata::<Runtime>::new(),
)
Expand Down
2 changes: 1 addition & 1 deletion pallets/runtime/tests/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ fn signed_extra(nonce: Index) -> SignedExtra {
frame_system::CheckGenesis::new(),
frame_system::CheckEra::from(Era::mortal(256, 0)),
frame_system::CheckNonce::from(nonce),
polymesh_extensions::CheckWeight::new(),
frame_system::CheckWeight::new(),
pallet_transaction_payment::ChargeTransactionPayment::from(0),
pallet_permissions::StoreCallMetadata::new(),
)
Expand Down
2 changes: 1 addition & 1 deletion src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub fn create_benchmark_extrinsic<R, D: NativeExecutionDispatch + 'static>(
best_block.saturated_into(),
)),
frame_system::CheckNonce::<runtime::Runtime>::from(nonce),
polymesh_extensions::CheckWeight::new(),
frame_system::CheckWeight::new(),
pallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
pallet_permissions::StoreCallMetadata::new(),
);
Expand Down

0 comments on commit 3bbc3eb

Please sign in to comment.