Skip to content

Commit

Permalink
Fix some warnings emitted by new nightly rust (#2129)
Browse files Browse the repository at this point in the history
* Add test and frequency-lint-check features to Cargo files
* Add #[allow(dead_code)] to BlockWeight struct in
frame-weight-template.hbs

# Goal The goal of this PR is to fix some warnings generated by an updated
nightly rust version.

Closes #2009
  • Loading branch information
shannonwells committed Aug 19, 2024
1 parent 7b8c585 commit 9e88342
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions .maintain/frame-weight-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ mod tests {
use common_runtime::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
use common_runtime::weights::extrinsic_weights::ExtrinsicBaseWeight;

#[allow(dead_code)]
struct BlockWeights;
impl Get<frame_system::limits::BlockWeights> for BlockWeights {
fn get() -> frame_system::limits::BlockWeights {
Expand Down
1 change: 1 addition & 0 deletions common/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ std = [
'sp-externalities/std',
'sp-runtime-interface/std'
]
test = []
2 changes: 2 additions & 0 deletions pallets/capacity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ publish = false
repository = "https://github.com/frequency-chain/frequency/"
version = "0.0.0"


[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down Expand Up @@ -53,3 +54,4 @@ std = [
"sp-io/std",
]
try-runtime = ["frame-support/try-runtime"]
test = []
1 change: 1 addition & 0 deletions pallets/frequency-tx-payment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ std = [
"sp-io/std",
]
try-runtime = ["frame-support/try-runtime"]
test = []
1 change: 1 addition & 0 deletions pallets/handles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ std = [
'common-runtime/std',
]
try-runtime = ['frame-support/try-runtime']
test = []
1 change: 1 addition & 0 deletions pallets/messages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ std = [
'common-runtime/std',
]
try-runtime = ['frame-support/try-runtime']
test = []
1 change: 1 addition & 0 deletions pallets/msa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ std = [
"sp-io/std",
]
try-runtime = ["frame-support/try-runtime"]
test = []
1 change: 1 addition & 0 deletions pallets/msa/src/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ std = [
"frame-support/std",
'common-primitives/std',
]
test = []
1 change: 1 addition & 0 deletions pallets/passkey/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ runtime-benchmarks = [
"common-runtime/runtime-benchmarks",
]
try-runtime = ["frame-support/try-runtime", "frame-system/try-runtime"]
test = []
1 change: 1 addition & 0 deletions pallets/schemas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ std = [
'sp-io/std',
]
try-runtime = ["frame-support/try-runtime"]
test = []
1 change: 1 addition & 0 deletions pallets/stateful-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ std = [
"common-runtime/std",
]
try-runtime = ['frame-support/try-runtime']
test = []
1 change: 1 addition & 0 deletions pallets/time-release/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ runtime-benchmarks = [
"common-runtime/runtime-benchmarks",
]
try-runtime = ["frame-support/try-runtime", "frame-system/try-runtime"]
test = []
3 changes: 2 additions & 1 deletion runtime/common/src/weights/pallet_utility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ mod tests {
use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;

struct BlockWeights;
#[allow(dead_code)]
struct BlockWeights;
impl Get<frame_system::limits::BlockWeights> for BlockWeights {
fn get() -> frame_system::limits::BlockWeights {
frame_system::limits::BlockWeights::builder()
Expand Down
3 changes: 3 additions & 0 deletions runtime/frequency/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,6 @@ on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]
# `RUNTIME_METADATA_HASH` environment variable set for the `CheckMetadataHash`
# extension.
metadata-hash = ["substrate-wasm-builder/metadata-hash"]
frequency-lint-check = []
test = []
parameterized-consensus-hook = []
4 changes: 2 additions & 2 deletions runtime/frequency/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("frequency"),
impl_name: create_runtime_str!("frequency"),
authoring_version: 1,
spec_version: 106,
spec_version: 107,
impl_version: 0,
apis: apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand All @@ -374,7 +374,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("frequency-testnet"),
impl_name: create_runtime_str!("frequency"),
authoring_version: 1,
spec_version: 106,
spec_version: 107,
impl_version: 0,
apis: apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down

0 comments on commit 9e88342

Please sign in to comment.