Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clippy lints in Cargo.toml #159

Merged
merged 5 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ rust.rust_2018_idioms = { level = "deny", priority = -1 }
rustdoc.all = "warn"
clippy.unwrap_used = "warn"
clippy.expect_used = "warn"
clippy.panic = "warn"
clippy.todo = "warn"
clippy.indexing_slicing = "warn"
clippy.string_slice = "warn"
clippy.panic_in_result_fn = "warn"
clippy.panicking_overflow_checks = "warn"
clippy.question_mark = "warn"
clippy.implicit_return = "allow"

[workspace.dependencies]
ark-bn254 = "0.5.0"
Expand Down Expand Up @@ -111,14 +118,23 @@ tracing-subscriber = { version = "0.3", features = ["json"] }
url = "2.5"

#misc
rust-bls-bn254 = { version = "0.2.1" , features = ["std"] }
rust-bls-bn254 = { version = "0.2.1", features = ["std"] }
uuid = { version = "1.11", features = ["v4"] }


#misc
parking_lot = "0.12"


anvil-utils = { path = "examples/anvil-utils" }

#alloy
alloy = { version = "0.7.0", features = [
"sol-types",
"contract",
"full",
"signer-aws",
] }
alloy-json-rpc = { version = "0.7", default-features = false }
alloy-network = { version = "0.7", default-features = false }
alloy-node-bindings = { version = "0.7", default-features = false }
Expand All @@ -139,10 +155,11 @@ alloy-signer-aws = "0.7"
alloy-signer-local = { version = "0.7", default-features = false }
alloy-sol-types = "0.8"
alloy-transport = { version = "0.7" }
alloy-transport-http = { version = "0.7", features = ["reqwest-rustls-tls"], default-features = false }
alloy-transport-http = { version = "0.7", features = [
"reqwest-rustls-tls",
], default-features = false }
alloy-transport-ipc = { version = "0.7.0", default-features = false }
alloy-transport-ws = { version = "0.7.0", default-features = false }
alloy = { version = "0.7.0", features = ["sol-types", "contract","full","signer-aws"] }
anvil-utils = { path = "examples/anvil-utils" }

avsregistry-read = { path = "examples/avsregistry-read" }
avsregistry-write = { path = "examples/avsregistry-write" }
6 changes: 3 additions & 3 deletions crates/chainio/clients/avsregistry/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ impl AvsRegistryChainReader {
/// - a vector of the quorum numbers the operator was registered for at `block_number`.
/// - for each of the quorums mentioned above, a vector of the operators registered for
/// that quorum at `block_number`, containing each operator's `operatorId` and `stake`.

pub async fn get_operators_stake_in_quorums_of_operator_at_block(
&self,
operator_id: B256,
Expand Down Expand Up @@ -430,8 +429,9 @@ impl AvsRegistryChainReader {
let inner_value = quorum_bitmap._0.into_limbs()[0];
let mut quorums: [bool; 64] = [false; 64];
for i in 0..64_u64 {
let other = inner_value & (1 << i) != 0;
quorums[i as usize] = other;
if let Some(value) = quorums.get_mut(i as usize) {
*value = inner_value & (1 << i) != 0;
}
}
Ok(quorums)
}
Expand Down
10 changes: 8 additions & 2 deletions crates/chainio/clients/fireblocks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ impl FireblocksWallet {

match contains_account {
true => {
if self.whitelisted_accounts.get(&address).unwrap().id().eq("") {
if self
.whitelisted_accounts
.get(&address)
.unwrap()
.id()
.is_empty()
{
Err(FireBlockError::AccountNotFoundError(address.to_string()))
} else {
Ok(self.whitelisted_accounts.get(&address).unwrap().clone())
Expand Down Expand Up @@ -146,7 +152,7 @@ impl FireblocksWallet {
.get(&address)
.unwrap()
.id()
.eq("")
.is_empty()
{
Err(FireBlockError::ContractNotFound(address.to_string()))
} else {
Expand Down
2 changes: 0 additions & 2 deletions testing/testing-utils/src/anvil_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ pub const ANVIL_HTTP_URL: &str = "http://localhost:8545";
/// Local anvil rpc WS url
pub const ANVIL_WS_URL: &str = "ws://localhost:8545";

#[allow(clippy::type_complexity)]

/// Service Manager contract address
pub async fn get_service_manager_address(rpc_url: String) -> Address {
let provider = get_provider(&rpc_url);
Expand Down
2 changes: 1 addition & 1 deletion testing/testing-utils/src/m2_holesky_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub const BEIGEN: Address = address!("275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27")
/// https://holesky.etherscan.io/address/0x43252609bff8a13dFe5e057097f2f45A24387a84
pub const EIGEN_STRATEGY: Address = address!("43252609bff8a13dFe5e057097f2f45A24387a84");

/// Middlware contracts
// Middlware contracts

/// https://holesky.etherscan.io/address/0x53012C69A189cfA2D9d29eb6F19B32e0A2EA3490
pub const REGISTRY_COORDINATOR: Address = address!("53012C69A189cfA2D9d29eb6F19B32e0A2EA3490");
Expand Down
Loading