From b7657659bf4f805b0753ea0b86a7b9ee094e0428 Mon Sep 17 00:00:00 2001 From: aeddi Date: Tue, 3 Nov 2026 20:05:55 +0100 Subject: [PATCH 1/5] test: name the socket variants like their connection siblings --- tests/integration.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index 30bf6ca7..52680d08 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -33,10 +33,10 @@ const SIGNING_SECP256K1_KEY_PATH: &str = "tests/support/signing_secp256k1.key"; enum KmsSocket { /// TCP socket type - TCP(TcpStream), + Tcp(TcpStream), /// UNIX socket type - UNIX(UnixStream), + Unix(UnixStream), } enum KmsConnection { @@ -97,7 +97,7 @@ impl KmsProcess { let (socket, _) = listener.accept().unwrap(); Self { process, - socket: KmsSocket::TCP(socket), + socket: KmsSocket::Tcp(socket), _state_dir: state_dir, } } @@ -122,7 +122,7 @@ impl KmsProcess { let (socket, _) = listener.accept().unwrap(); Self { process, - socket: KmsSocket::UNIX(socket), + socket: KmsSocket::Unix(socket), _state_dir: state_dir, } } @@ -198,7 +198,7 @@ impl KmsProcess { /// Get a connection from the socket pub fn create_connection(&self) -> KmsConnection { match self.socket { - KmsSocket::TCP(ref sock) => { + KmsSocket::Tcp(ref sock) => { // we use the same key for both sides: let identity_key = IdentitySecret::from(test_ed25519_identity_keypair()); @@ -208,7 +208,7 @@ impl KmsProcess { KmsConnection::Tcp(SecretConnection::new(socket_cp, &identity_key).unwrap()) } - KmsSocket::UNIX(ref sock) => { + KmsSocket::Unix(ref sock) => { let socket_cp = sock.try_clone().unwrap(); KmsConnection::Unix(UnixConnection::new(socket_cp)) From cb1eef3e4077e0ea7939adeae978f892243f3856 Mon Sep 17 00:00:00 2001 From: aeddi Date: Tue, 3 Nov 2026 20:06:06 +0100 Subject: [PATCH 2/5] test: box the secret connection variant to even out the enum --- tests/integration.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index 52680d08..fe04ac95 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -40,8 +40,8 @@ enum KmsSocket { } enum KmsConnection { - /// Secret connection type - Tcp(SecretConnection), + /// Secret connection type, boxed: it is far larger than the UNIX variant + Tcp(Box>), /// UNIX connection type Unix(UnixConnection), @@ -205,7 +205,9 @@ impl KmsProcess { // Here we reply to the kms with a "remote" ephemeral key, auth signature etc: let socket_cp = sock.try_clone().unwrap(); - KmsConnection::Tcp(SecretConnection::new(socket_cp, &identity_key).unwrap()) + KmsConnection::Tcp(Box::new( + SecretConnection::new(socket_cp, &identity_key).unwrap(), + )) } KmsSocket::Unix(ref sock) => { From c43583dd33565cf1149705f51b9c60d544557660 Mon Sep 17 00:00:00 2001 From: aeddi Date: Tue, 3 Nov 2026 20:06:07 +0100 Subject: [PATCH 3/5] test: pass the message through instead of borrowing it again --- tests/integration.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index fe04ac95..2b098f6c 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -273,8 +273,8 @@ impl ReadMsg for ProtocolTester { impl WriteMsg for ProtocolTester { fn write_msg(&mut self, msg: &proto::privval::Message) -> p2p::Result<()> { - self.tcp_connection.write_msg(&msg)?; - self.unix_connection.write_msg(&msg)?; + self.tcp_connection.write_msg(msg)?; + self.unix_connection.write_msg(msg)?; Ok(()) } } From 74f3311ac1751caa1f6f77ca7eb27027ba39826b Mon Sep 17 00:00:00 2001 From: aeddi Date: Tue, 3 Nov 2026 20:06:47 +0100 Subject: [PATCH 4/5] ci: lint test targets as well as the library and binary --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e81e915a..a400cfd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,7 +105,7 @@ jobs: toolchain: 1.89 # pinned to prevent breakages when clippy updates - run: sudo apt-get update && sudo apt-get install libudev-dev - run: rustup component add clippy - - run: cargo clippy --all-features + - run: cargo clippy --all-features --all-targets # Licenses, banned crates and dependency sources. Advisories are covered by the # separate security_audit workflow. From 08c4ebf68f7b6cd96c3fd5175f481657a2ca4e37 Mon Sep 17 00:00:00 2001 From: aeddi Date: Tue, 3 Nov 2026 20:06:47 +0100 Subject: [PATCH 5/5] docs: give the lint command that CI runs --- FORK.md | 3 ++- README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/FORK.md b/FORK.md index a10cdd42..3823cf1c 100644 --- a/FORK.md +++ b/FORK.md @@ -178,7 +178,8 @@ Signing is unaffected either way. ## Verification -- `cargo fmt --all -- --check` and `cargo clippy --all-features` — clean. +- `cargo fmt --all -- --check` — clean. +- `cargo clippy --all-features --all-targets` — clean. - `cargo test --all-features -- --test-threads 1` — 64 unit + 23 integration tests pass (10 ignored, all hardware-dependent). - The published image is pulled and checked on every release: it reports its own diff --git a/README.md b/README.md index 9a3ab922..6fc56f07 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ cargo fmt Lint your code (i.e. check it for common issues) with: ``` -cargo clippy +cargo clippy --all-features --all-targets ``` ## License