Skip to content

Commit

Permalink
dev: update clippy CI (#656)
Browse files Browse the repository at this point in the history
* update CI clippy configuration

* clippy::nursery lint fixes
  • Loading branch information
bhavyagosai authored Dec 3, 2023
1 parent caa1536 commit 4266568
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/core/src/client/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct InvalidFieldElementError;
impl std::error::Error for InvalidFieldElementError {}

impl std::fmt::Display for InvalidFieldElementError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Invalid FieldElement")
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/core/src/models/felt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl TryFrom<Felt252Wrapper> for u128 {
}
}

#[allow(clippy::fallible_impl_from)]
impl From<Address> for Felt252Wrapper {
fn from(address: Address) -> Self {
let felt = FieldElement::from_byte_slice_be(&address.0).unwrap(); // safe unwrap since H160 is 20 bytes
Expand Down
4 changes: 2 additions & 2 deletions crates/test-utils/src/execution/eoa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<P: Provider + Send + Sync + 'static> EOA<P> for KakarotEOA<P> {
}

impl<P: Provider + Send + Sync + 'static> KakarotEOA<P> {
pub async fn deploy_evm_contract<T: Tokenize>(
pub async fn deploy_evm_contract<T: Tokenize + Send + Sync>(
&self,
contract_name: &str,
constructor_args: T,
Expand Down Expand Up @@ -120,7 +120,7 @@ impl<P: Provider + Send + Sync + 'static> KakarotEOA<P> {
Ok(KakarotEvmContract::new(bytecode, event.data[1], event.data[0]))
}

pub async fn call_evm_contract<T: Tokenize>(
pub async fn call_evm_contract<T: Tokenize + Send + Sync>(
&self,
contract: &KakarotEvmContract,
function: &str,
Expand Down
4 changes: 2 additions & 2 deletions crates/test-utils/src/sequencer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ impl Katana {
let sequencer = katana_sequencer().await;
let starknet_provider = Arc::new(JsonRpcClient::new(HttpTransport::new(sequencer.url())));

Self::initialize(sequencer, starknet_provider).await
Self::initialize(sequencer, starknet_provider)
}

/// Initializes the Katana test environment.
async fn initialize(sequencer: TestSequencer, starknet_provider: Arc<JsonRpcClient<HttpTransport>>) -> Self {
fn initialize(sequencer: TestSequencer, starknet_provider: Arc<JsonRpcClient<HttpTransport>>) -> Self {
// Load deployments
let deployments_path = root_project_path!("lib/kakarot/deployments/katana/deployments.json");
let deployments = std::fs::read_to_string(deployments_path).expect("Failed to read deployment file");
Expand Down

0 comments on commit 4266568

Please sign in to comment.