Skip to content

Commit 6e22ccf

Browse files
committed
Add crypto primitives feature to clippy checks for concordium-std.
1 parent c918c30 commit 6e22ccf

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed

.github/workflows/linter.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,44 @@ jobs:
9696
command: clippy
9797
args: --manifest-path ${{ matrix.lib-crates }} --target=${{ matrix.target }} --features=${{ matrix.features }} -- -D warnings
9898

99+
clippy-crypto-primitives:
100+
name: Clippy concordium-std with crypto-primitives
101+
runs-on: ubuntu-latest
102+
needs: rustfmt
103+
strategy:
104+
matrix:
105+
target:
106+
- wasm32-unknown-unknown
107+
- x86_64-unknown-linux-gnu
108+
109+
lib-crates:
110+
- concordium-std/Cargo.toml
111+
112+
features:
113+
- crypto-primitives
114+
115+
steps:
116+
- name: Checkout sources
117+
uses: actions/checkout@v2
118+
with:
119+
submodules: true
120+
121+
- name: Install toolchain with clippy available
122+
uses: actions-rs/toolchain@v1
123+
with:
124+
profile: minimal
125+
toolchain: 1.53
126+
target: ${{ matrix.target }}
127+
override: true
128+
components: clippy
129+
130+
- name: Run cargo clippy
131+
uses: actions-rs/cargo@v1
132+
with:
133+
command: clippy
134+
args: --manifest-path ${{ matrix.lib-crates }} --target=${{ matrix.target }} --features=${{ matrix.features }} -- -D warnings
135+
136+
99137
clippy-wasm32-only:
100138
name: Clippy Wasm32
101139
runs-on: ubuntu-latest

concordium-std/src/test_infrastructure.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,9 @@ impl HasCryptoPrimitives for TestCryptoPrimitives {
841841
let public_key = ed25519_zebra::VerificationKey::try_from(&public_key.0[..]);
842842
match (signature, public_key) {
843843
(Ok(ref signature), Ok(public_key)) => {
844-
return public_key.verify(signature, message).is_ok()
844+
public_key.verify(signature, message).is_ok()
845845
}
846-
_ => return false,
846+
_ => false,
847847
}
848848
}
849849
#[cfg(not(feature = "crypto-primitives"))]
@@ -870,9 +870,9 @@ impl HasCryptoPrimitives for TestCryptoPrimitives {
870870
match (signature, public_key, message_hash) {
871871
(Ok(ref signature), Ok(public_key), Ok(message_hash)) => {
872872
let verifier = secp256k1::Secp256k1::verification_only();
873-
return verifier.verify_ecdsa(&message_hash, &signature, &public_key).is_ok();
873+
verifier.verify_ecdsa(&message_hash, &signature, &public_key).is_ok()
874874
}
875-
_ => return false,
875+
_ => false,
876876
}
877877
}
878878
#[cfg(not(feature = "crypto-primitives"))]

0 commit comments

Comments
 (0)