diff --git a/evm-template/node/Cargo.toml b/evm-template/node/Cargo.toml index 009dda4..984216c 100644 --- a/evm-template/node/Cargo.toml +++ b/evm-template/node/Cargo.toml @@ -108,6 +108,7 @@ try-runtime = [ "polkadot-cli/try-runtime", "sp-runtime/try-runtime", ] +txpool = [] [lints] workspace = true diff --git a/evm-template/node/src/contracts/abi.rs b/evm-template/node/src/contracts/abi.rs index 31e3e53..1c16f34 100644 --- a/evm-template/node/src/contracts/abi.rs +++ b/evm-template/node/src/contracts/abi.rs @@ -5,11 +5,16 @@ use serde::Deserialize; #[serde(tag = "type")] #[serde(rename_all = "lowercase")] pub enum AbiItem { + #[allow(dead_code)] Error(Error), + #[allow(dead_code)] Function(Function), Constructor, + #[allow(dead_code)] Event(Event), + #[allow(dead_code)] Receive(Receive), + #[allow(dead_code)] Default(Function), } diff --git a/evm-template/node/src/contracts/forge.rs b/evm-template/node/src/contracts/forge.rs index f245340..d1fca95 100644 --- a/evm-template/node/src/contracts/forge.rs +++ b/evm-template/node/src/contracts/forge.rs @@ -4,6 +4,7 @@ use super::{abi::AbiItem, deserialize_bytecode}; #[derive(Deserialize)] pub struct ForgeContract { + #[allow(dead_code)] pub abi: Vec, pub bytecode: ForgeBytecode, } diff --git a/evm-template/node/src/contracts/hardhat.rs b/evm-template/node/src/contracts/hardhat.rs index 2b53051..295360a 100644 --- a/evm-template/node/src/contracts/hardhat.rs +++ b/evm-template/node/src/contracts/hardhat.rs @@ -4,6 +4,7 @@ use super::{abi::AbiItem, deserialize_bytecode}; #[derive(Deserialize)] pub struct HardhatContract { + #[allow(dead_code)] pub abi: Vec, #[serde(deserialize_with = "deserialize_bytecode")] pub bytecode: Vec, diff --git a/evm-template/node/src/contracts/mod.rs b/evm-template/node/src/contracts/mod.rs index 345e307..a686cc5 100644 --- a/evm-template/node/src/contracts/mod.rs +++ b/evm-template/node/src/contracts/mod.rs @@ -43,7 +43,9 @@ impl Contract { #[derive(Debug)] pub enum ContractParsingError { + #[allow(dead_code)] MetadataReadError(io::Error), + #[allow(dead_code)] MetadataParseError(serde_json::Error), } diff --git a/evm-template/runtime/src/configs/governance/mod.rs b/evm-template/runtime/src/configs/governance/mod.rs index d3fcaee..a81459a 100644 --- a/evm-template/runtime/src/configs/governance/mod.rs +++ b/evm-template/runtime/src/configs/governance/mod.rs @@ -36,7 +36,7 @@ impl pallet_conviction_voting::Config for Runtime { } parameter_types! { - pub const MaxBalance: Balance = Balance::max_value(); + pub const MaxBalance: Balance = Balance::MAX; } pub type TreasurySpender = EitherOf, Spender>; diff --git a/evm-template/runtime/src/configs/xcm_config.rs b/evm-template/runtime/src/configs/xcm_config.rs index 2879420..6d2b451 100644 --- a/evm-template/runtime/src/configs/xcm_config.rs +++ b/evm-template/runtime/src/configs/xcm_config.rs @@ -214,8 +214,7 @@ pub type XcmRouter = WithUniqueTopic<( )>; parameter_types! { - pub const MaxLockers: u32 = 8; - pub const MaxRemoteLockConsumers: u32 = 0; + pub const MaxLockers: u32 = 0; } impl pallet_xcm::Config for Runtime { diff --git a/evm-template/runtime/tests/constants_test.rs b/evm-template/runtime/tests/constants_test.rs index 1be7b47..ae969ba 100644 --- a/evm-template/runtime/tests/constants_test.rs +++ b/evm-template/runtime/tests/constants_test.rs @@ -234,8 +234,7 @@ mod xcm_tests { #[test] fn pallet_xcm_constants() { - assert_eq!(MaxLockers::get(), 8); - assert_eq!(MaxRemoteLockConsumers::get(), 0); + assert_eq!(MaxLockers::get(), 0); assert_eq!(::VERSION_DISCOVERY_QUEUE_SIZE, 100); } } diff --git a/evm-template/rust-toolchain.toml b/evm-template/rust-toolchain.toml index 9352f76..5b3c0a9 100644 --- a/evm-template/rust-toolchain.toml +++ b/evm-template/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-02-17" +channel = "nightly-2024-06-12" targets = ["wasm32-unknown-unknown"] components = ["rustfmt", "clippy", "rust-src"] diff --git a/evm-template/template-fuzzer/src/main.rs b/evm-template/template-fuzzer/src/main.rs index 1703b06..e48f716 100644 --- a/evm-template/template-fuzzer/src/main.rs +++ b/evm-template/template-fuzzer/src/main.rs @@ -96,7 +96,6 @@ fn main() { let mut elapsed: Duration = Duration::ZERO; let start_block = |block: u32, lapse: u32| { - #[cfg(not(fuzzing))] println!("\ninitializing block {}", block + lapse); let next_block = block + lapse; @@ -197,20 +196,17 @@ fn main() { current_weight = current_weight.saturating_add(call_weight); if current_weight.ref_time() >= max_weight.ref_time() { - #[cfg(not(fuzzing))] println!("Skipping because of max weight {max_weight}"); continue; } externalities.execute_with(|| { let origin_account = endowed_accounts[origin % endowed_accounts.len()]; - #[cfg(not(fuzzing))] { println!("\n origin: {origin_account:?}"); println!(" call: {extrinsic:?}"); } let _res = extrinsic.clone().dispatch(RuntimeOrigin::signed(origin_account)); - #[cfg(not(fuzzing))] println!(" result: {_res:?}"); // Uncomment to print events for debugging purposes @@ -228,7 +224,6 @@ fn main() { elapsed += now.elapsed(); } - #[cfg(not(fuzzing))] println!("\n time spent: {elapsed:?}"); assert!(elapsed.as_secs() <= MAX_TIME_FOR_BLOCK, "block execution took too much time"); @@ -237,7 +232,6 @@ fn main() { // Finilization Executive::finalize_block(); // Invariants - #[cfg(not(fuzzing))] println!("\ntesting invariants for block {current_block}"); >::try_state( current_block, @@ -287,7 +281,6 @@ fn main() { "Inconsistent total issuance: {total_issuance} but counted {counted_issuance}" ); - #[cfg(not(fuzzing))] println!("running integrity tests"); // We run all developer-defined integrity tests ::integrity_test(); diff --git a/generic-template/runtime/src/configs/governance/mod.rs b/generic-template/runtime/src/configs/governance/mod.rs index d3fcaee..a81459a 100644 --- a/generic-template/runtime/src/configs/governance/mod.rs +++ b/generic-template/runtime/src/configs/governance/mod.rs @@ -36,7 +36,7 @@ impl pallet_conviction_voting::Config for Runtime { } parameter_types! { - pub const MaxBalance: Balance = Balance::max_value(); + pub const MaxBalance: Balance = Balance::MAX; } pub type TreasurySpender = EitherOf, Spender>; diff --git a/generic-template/runtime/src/configs/xcm_config.rs b/generic-template/runtime/src/configs/xcm_config.rs index ea739f9..775904d 100644 --- a/generic-template/runtime/src/configs/xcm_config.rs +++ b/generic-template/runtime/src/configs/xcm_config.rs @@ -196,8 +196,7 @@ pub type XcmRouter = WithUniqueTopic<( )>; parameter_types! { - pub const MaxLockers: u32 = 8; - pub const MaxRemoteLockConsumers: u32 = 0; + pub const MaxLockers: u32 = 0; } impl pallet_xcm::Config for Runtime { diff --git a/generic-template/runtime/tests/constants_test.rs b/generic-template/runtime/tests/constants_test.rs index 64ffd87..8691444 100644 --- a/generic-template/runtime/tests/constants_test.rs +++ b/generic-template/runtime/tests/constants_test.rs @@ -233,8 +233,7 @@ mod xcm_tests { #[test] fn pallet_xcm_constants() { - assert_eq!(MaxLockers::get(), 8); - assert_eq!(MaxRemoteLockConsumers::get(), 0); + assert_eq!(MaxLockers::get(), 0); assert_eq!(::VERSION_DISCOVERY_QUEUE_SIZE, 100); } } diff --git a/generic-template/rust-toolchain.toml b/generic-template/rust-toolchain.toml index 9352f76..5b3c0a9 100644 --- a/generic-template/rust-toolchain.toml +++ b/generic-template/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-02-17" +channel = "nightly-2024-06-12" targets = ["wasm32-unknown-unknown"] components = ["rustfmt", "clippy", "rust-src"] diff --git a/generic-template/template-fuzzer/src/main.rs b/generic-template/template-fuzzer/src/main.rs index d734b9c..fed85d9 100644 --- a/generic-template/template-fuzzer/src/main.rs +++ b/generic-template/template-fuzzer/src/main.rs @@ -89,7 +89,6 @@ fn main() { let mut elapsed: Duration = Duration::ZERO; let start_block = |block: u32, lapse: u32| { - #[cfg(not(fuzzing))] println!("\ninitializing block {}", block + lapse); let next_block = block + lapse; @@ -190,20 +189,17 @@ fn main() { current_weight = current_weight.saturating_add(call_weight); if current_weight.ref_time() >= max_weight.ref_time() { - #[cfg(not(fuzzing))] println!("Skipping because of max weight {max_weight}"); continue; } externalities.execute_with(|| { let origin_account = endowed_accounts[origin % endowed_accounts.len()].clone(); - #[cfg(not(fuzzing))] { println!("\n origin: {origin_account:?}"); println!(" call: {extrinsic:?}"); } let _res = extrinsic.clone().dispatch(RuntimeOrigin::signed(origin_account)); - #[cfg(not(fuzzing))] println!(" result: {_res:?}"); // Uncomment to print events for debugging purposes @@ -221,7 +217,6 @@ fn main() { elapsed += now.elapsed(); } - #[cfg(not(fuzzing))] println!("\n time spent: {elapsed:?}"); assert!(elapsed.as_secs() <= MAX_TIME_FOR_BLOCK, "block execution took too much time"); @@ -230,7 +225,6 @@ fn main() { // Finilization Executive::finalize_block(); // Invariants - #[cfg(not(fuzzing))] println!("\ntesting invariants for block {current_block}"); >::try_state( current_block, @@ -280,7 +274,6 @@ fn main() { "Inconsistent total issuance: {total_issuance} but counted {counted_issuance}" ); - #[cfg(not(fuzzing))] println!("running integrity tests"); // We run all developer-defined integrity tests ::integrity_test();