From b670ecc3365ac4c223aba3749530e23e7b425202 Mon Sep 17 00:00:00 2001 From: Vid Kersic Date: Mon, 16 Sep 2024 19:26:12 +0200 Subject: [PATCH] fix: lint --- crates/metrics/src/ethers.rs | 34 ++++++++++--------- .../primitives/src/user_operation/request.rs | 8 +---- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/crates/metrics/src/ethers.rs b/crates/metrics/src/ethers.rs index 962453ef..f2765a2c 100644 --- a/crates/metrics/src/ethers.rs +++ b/crates/metrics/src/ethers.rs @@ -78,11 +78,11 @@ where result_counter(self.inner().get_block_number().await, "silius_ethers_get_block_number") } - async fn send_transaction + Send + Sync>( - &self, + async fn send_transaction<'a, T: Into + Send + Sync>( + &'a self, tx: T, block: Option, - ) -> Result, Self::Error> { + ) -> Result, Self::Error> { counter!("silius_ethers_send_transaction").increment(1); result_counter( self.inner().send_transaction(tx, block).await, @@ -264,16 +264,18 @@ where result_counter(self.inner().watch(filter).await, "silius_ethers_watch") } - async fn watch_pending_transactions( - &self, - ) -> Result, Self::Error> { + async fn watch_pending_transactions<'a>( + &'a self, + ) -> Result, Self::Error> { counter!("silius_ethers_watch_pending_transactions").increment(1); result_counter( self.inner().watch_pending_transactions().await, "silius_ethers_watch_pending_transactions", ) } - async fn watch_blocks(&self) -> Result, Self::Error> { + async fn watch_blocks<'a>( + &'a self, + ) -> Result, Self::Error> { counter!("silius_ethers_watch_blocks").increment(1); result_counter(self.inner().watch_blocks().await, "silius_ethers_watch_blocks") } @@ -348,9 +350,9 @@ where ) } - async fn subscribe_blocks( - &self, - ) -> Result>, Self::Error> + async fn subscribe_blocks<'a>( + &'a self, + ) -> Result>, Self::Error> where ::Provider: PubsubClient, { @@ -358,9 +360,9 @@ where result_counter(self.inner().subscribe_blocks().await, "silius_ethers_subscribe_blocks") } - async fn subscribe_pending_txs( - &self, - ) -> Result, Self::Error> + async fn subscribe_pending_txs<'a>( + &'a self, + ) -> Result, Self::Error> where ::Provider: PubsubClient, { @@ -371,9 +373,9 @@ where ) } - async fn subscribe_full_pending_txs( - &self, - ) -> Result, Self::Error> + async fn subscribe_full_pending_txs<'a>( + &'a self, + ) -> Result, Self::Error> where ::Provider: PubsubClient, { diff --git a/crates/primitives/src/user_operation/request.rs b/crates/primitives/src/user_operation/request.rs index aaa4ed19..f4a86d12 100644 --- a/crates/primitives/src/user_operation/request.rs +++ b/crates/primitives/src/user_operation/request.rs @@ -76,13 +76,7 @@ impl From for UserOperationSigned { } }, paymaster_and_data: user_operation.paymaster_and_data, - signature: { - if let Some(signature) = user_operation.signature { - signature - } else { - Bytes::default() - } - }, + signature: { user_operation.signature.unwrap_or_default() }, } } }