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

Run clippy on CI #78

Merged
merged 12 commits into from
Sep 2, 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
18 changes: 18 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ on:
branches: [main]

jobs:
lint:
name: Run Lints
runs-on: ubuntu-latest
steps:
- name: Install Rust
uses: dtolnay/[email protected]
with:
components: rustfmt, clippy

- name: Checkout repository
uses: actions/checkout@v4

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Run clippy
run: cargo clippy --workspace --all-features --benches --examples --tests -- -D warnings

test:
name: Run Integration Tests
runs-on: ubuntu-latest
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ pr: reset-anvil ##
$(MAKE) start-anvil-chain-with-contracts-deployed > /dev/null &
sleep 4 # needed to wait for anvil setup to finish
cargo test --workspace
cargo clippy --workspace --lib --examples --tests --benches --all-features
cargo +nightly fmt -- --check
docker stop anvil

fireblocks-tests:
$(MAKE) start-anvil-chain-with-contracts-deployed > /dev/null &
cargo test --workspace --features fireblock-tests

lint:
cargo fmt --all -- --check \
&& cargo clippy --workspace --all-features --benches --examples --tests -- -D warnings

start-anvil: reset-anvil ##
$(MAKE) start-anvil-chain-with-contracts-deployed
docker start anvil
docker start anvil
2 changes: 1 addition & 1 deletion crates/chainio/clients/elcontracts/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ mod tests {
let service_manager_address = anvil_constants::get_service_manager_address().await;
let service_manager_contract = mockAvsServiceManager::new(
service_manager_address,
get_provider(&"http://localhost:8545"),
get_provider("http://localhost:8545"),
);
let avs_directory_address_return = service_manager_contract
.avsDirectory()
Expand Down
2 changes: 1 addition & 1 deletion crates/eigen-cli/src/eigen_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl ContractAddresses {
/// # Returns
///
/// * `(Address, Address)` - The registry coordinator and service manager contract addresses,
/// used to call `get_avs_contract_addresses` and `get_eigenlayer_contract_addresses` functions.
/// used to call `get_avs_contract_addresses` and `get_eigenlayer_contract_addresses` functions.
async fn get_registry_coord_and_service_manager_addr<T, P, N>(
registry_coordinator: Option<Address>,
service_manager: Option<Address>,
Expand Down
2 changes: 1 addition & 1 deletion crates/eigen-cli/src/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl KeyGenerator {
};
let dir_path = Path::new(&dir_name);
let key_path = dir_path.join(DEFAULT_KEY_FOLDER);
fs::create_dir_all(&key_path).map_err(EigenKeyCliError::FileError)?;
fs::create_dir_all(key_path).map_err(EigenKeyCliError::FileError)?;

self.generate_keys(num_keys, dir_path)
}
Expand Down
5 changes: 1 addition & 4 deletions crates/eigen-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,7 @@ mod test {

let keystore_instance = Keystore::from_file(output_path.to_str().unwrap()).unwrap();
let decrypted_key = keystore_instance.decrypt("testpassword").unwrap();
let fr_key: String = decrypted_key
.iter()
.map(|&value| value as u8 as char)
.collect();
let fr_key: String = decrypted_key.iter().map(|&value| value as char).collect();
assert_eq!(fr_key, key);
}

Expand Down
Loading