From d9f013e75d5efe66821b6bfab9a79c2bc7ea4c41 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Fri, 7 Feb 2025 21:54:32 +0300 Subject: [PATCH 1/2] Bump the rust toolchain to nightly-2025-02-07 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index f859ac145..9d0f1a5fc 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2024-05-10" +channel = "nightly-2025-02-07" components = ["rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"] profile = "minimal" From 4fc9ba0ecb2b3685ca6710d31e6971cf17633f46 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Fri, 7 Feb 2025 22:07:34 +0300 Subject: [PATCH 2/2] Fix clippy --- crates/eip191-token-claim/src/lib.rs | 2 +- crates/humanode-peer/src/time_warp.rs | 4 ++-- crates/humanode-runtime/src/constants.rs | 1 + crates/humanode-runtime/src/lib.rs | 1 + crates/precompile-utils/macro/tests/tests.rs | 3 +++ crates/primitives-liveness-data/src/lib.rs | 2 +- 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/eip191-token-claim/src/lib.rs b/crates/eip191-token-claim/src/lib.rs index ada9715b1..45550b52e 100644 --- a/crates/eip191-token-claim/src/lib.rs +++ b/crates/eip191-token-claim/src/lib.rs @@ -12,7 +12,7 @@ pub struct Message<'a> { pub genesis_hash: &'a [u8; 32], } -impl<'a> Message<'a> { +impl Message<'_> { /// Prepare EIP-191 token claim message. pub fn prepare_message(&self) -> Vec { let mut buf = vec![]; diff --git a/crates/humanode-peer/src/time_warp.rs b/crates/humanode-peer/src/time_warp.rs index a62841f37..8c535d215 100644 --- a/crates/humanode-peer/src/time_warp.rs +++ b/crates/humanode-peer/src/time_warp.rs @@ -13,12 +13,12 @@ //! 2. Revert the peer's data blocks to the latest finalized block by running `./humanode-peer revert`. //! //! 3. Define the time in the future when the warp is going to be started. -//! In other words, it's `REVIVE_TIMESTAMP` (by default, timestamp of exact the peer binary run). +//! In other words, it's `REVIVE_TIMESTAMP` (by default, timestamp of exact the peer binary run). //! //! 4. Define `WARP_FACTOR` that is going to be adopted to do time warp. //! //! 5. Run the peer in time warp mode by passing `--time-warp-fork-timestamp`, `--time-warp-revive-timestamp`, -//! `--time-warp-factor`. +//! `--time-warp-factor`. //! //! 6. When the correct timestamp has been reached switch the peer to usual running mode. diff --git a/crates/humanode-runtime/src/constants.rs b/crates/humanode-runtime/src/constants.rs index 7258e7073..d6545e3bb 100644 --- a/crates/humanode-runtime/src/constants.rs +++ b/crates/humanode-runtime/src/constants.rs @@ -111,6 +111,7 @@ pub mod evm_fees { /// - a simple transfer costs 21000 gas /// - we want the cost of this transfer to be around ~0.2 HMND /// - so we must charge about 0.2 * 10^18 / 21000 fee per a unit of gas + /// /// The value below is a nice round number that fits the requirements outlined above. pub const FEE_PER_GAS: u128 = 10_000_000_000_000; diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index 10eb56475..ff3be9ea1 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -147,6 +147,7 @@ pub type Signature = MultiSignature; /// salt/nonce; note that there are currently multiple simultaneously supported algorithms for /// how the contract addresses can be constructed by the EVM, and new might be introduced in /// the future. +/// /// Both of the 20-byte EVM address types are stored with a certain format in a wider 32-byte /// [`AccountId32`] type, that enables us to distinguish them from other address types; there's /// a certain chance that a non-EVM address would just so happen to be matching the EVM address diff --git a/crates/precompile-utils/macro/tests/tests.rs b/crates/precompile-utils/macro/tests/tests.rs index 4fd2f4d1b..b77a1e77c 100644 --- a/crates/precompile-utils/macro/tests/tests.rs +++ b/crates/precompile-utils/macro/tests/tests.rs @@ -1,3 +1,6 @@ +// Ignore incompatible lints from original project. +#![allow(missing_docs)] + use sha3::{Digest, Keccak256}; #[precompile_utils_macro::generate_function_selector] diff --git a/crates/primitives-liveness-data/src/lib.rs b/crates/primitives-liveness-data/src/lib.rs index fd5af4f05..65a38e81e 100644 --- a/crates/primitives-liveness-data/src/lib.rs +++ b/crates/primitives-liveness-data/src/lib.rs @@ -64,7 +64,7 @@ impl<'a> From<&'a [u8]> for OpaqueLivenessDataRef<'a> { } } -impl<'a> AsRef<[u8]> for OpaqueLivenessDataRef<'a> { +impl AsRef<[u8]> for OpaqueLivenessDataRef<'_> { fn as_ref(&self) -> &[u8] { self.0 }