chore: remove unused async (#9299)

This commit is contained in:
joshieDo
2024-07-04 13:10:27 +02:00
committed by GitHub
parent afe86895ff
commit af280b98f7
14 changed files with 45 additions and 53 deletions

View File

@ -39,7 +39,7 @@ impl InnerTransport {
jwt: JwtSecret,
) -> Result<(Self, Claims), AuthenticatedTransportError> {
match url.scheme() {
"http" | "https" => Self::connect_http(url, jwt).await,
"http" | "https" => Self::connect_http(url, jwt),
"ws" | "wss" => Self::connect_ws(url, jwt).await,
"file" => Ok((Self::connect_ipc(url).await?, Claims::default())),
_ => Err(AuthenticatedTransportError::BadScheme(url.scheme().to_string())),
@ -48,7 +48,7 @@ impl InnerTransport {
/// Connects to an HTTP [`alloy_transport_http::Http`] transport. Returns an [`InnerTransport`]
/// and the [Claims] generated from the jwt.
async fn connect_http(
fn connect_http(
url: Url,
jwt: JwtSecret,
) -> Result<(Self, Claims), AuthenticatedTransportError> {

View File

@ -96,8 +96,7 @@ impl ImportCommand {
Arc::new(file_client),
StaticFileProducer::new(provider_factory.clone(), PruneModes::default()),
self.no_state,
)
.await?;
)?;
// override the tip
pipeline.set_tip(tip);
@ -153,7 +152,7 @@ impl ImportCommand {
///
/// If configured to execute, all stages will run. Otherwise, only stages that don't require state
/// will run.
pub async fn build_import_pipeline<DB, C>(
pub fn build_import_pipeline<DB, C>(
config: &Config,
provider_factory: ProviderFactory<DB>,
consensus: &Arc<C>,

View File

@ -21,7 +21,7 @@ pub(crate) async fn dump_execution_stage<DB: Database>(
import_tables_with_range(&output_db, db_tool, from, to)?;
unwind_and_copy(db_tool, from, tip_block_number, &output_db).await?;
unwind_and_copy(db_tool, from, tip_block_number, &output_db)?;
if should_run {
dry_run(
@ -32,8 +32,7 @@ pub(crate) async fn dump_execution_stage<DB: Database>(
),
to,
from,
)
.await?;
)?;
}
Ok(())
@ -120,7 +119,7 @@ fn import_tables_with_range<DB: Database>(
/// Dry-run an unwind to FROM block, so we can get the `PlainStorageState` and
/// `PlainAccountState` safely. There might be some state dependency from an address
/// which hasn't been changed in the given range.
async fn unwind_and_copy<DB: Database>(
fn unwind_and_copy<DB: Database>(
db_tool: &DbTool<DB>,
from: u64,
tip_block_number: u64,
@ -151,7 +150,7 @@ async fn unwind_and_copy<DB: Database>(
}
/// Try to re-execute the stage without committing
async fn dry_run<DB: Database>(
fn dry_run<DB: Database>(
output_provider_factory: ProviderFactory<DB>,
to: u64,
from: u64,

View File

@ -38,8 +38,7 @@ pub(crate) async fn dump_hashing_account_stage<DB: Database>(
),
to,
from,
)
.await?;
)?;
}
Ok(())
@ -71,7 +70,7 @@ fn unwind_and_copy<DB: Database>(
}
/// Try to re-execute the stage straight away
async fn dry_run<DB: Database>(
fn dry_run<DB: Database>(
output_provider_factory: ProviderFactory<DB>,
to: u64,
from: u64,

View File

@ -28,8 +28,7 @@ pub(crate) async fn dump_hashing_storage_stage<DB: Database>(
),
to,
from,
)
.await?;
)?;
}
Ok(())
@ -66,7 +65,7 @@ fn unwind_and_copy<DB: Database>(
}
/// Try to re-execute the stage straight away
async fn dry_run<DB: Database>(
fn dry_run<DB: Database>(
output_provider_factory: ProviderFactory<DB>,
to: u64,
from: u64,

View File

@ -44,7 +44,7 @@ pub(crate) async fn dump_merkle_stage<DB: Database>(
)
})??;
unwind_and_copy(db_tool, (from, to), tip_block_number, &output_db).await?;
unwind_and_copy(db_tool, (from, to), tip_block_number, &output_db)?;
if should_run {
dry_run(
@ -55,15 +55,14 @@ pub(crate) async fn dump_merkle_stage<DB: Database>(
),
to,
from,
)
.await?;
)?;
}
Ok(())
}
/// Dry-run an unwind to FROM block and copy the necessary table data to the new database.
async fn unwind_and_copy<DB: Database>(
fn unwind_and_copy<DB: Database>(
db_tool: &DbTool<DB>,
range: (u64, u64),
tip_block_number: u64,
@ -143,7 +142,7 @@ async fn unwind_and_copy<DB: Database>(
}
/// Try to re-execute the stage straight away
async fn dry_run<DB: Database>(
fn dry_run<DB: Database>(
output_provider_factory: ProviderFactory<DB>,
to: u64,
from: u64,

View File

@ -78,7 +78,7 @@ impl Command {
}
// This will build an offline-only pipeline if the `offline` flag is enabled
let mut pipeline = self.build_pipeline(config, provider_factory.clone()).await?;
let mut pipeline = self.build_pipeline(config, provider_factory)?;
// Move all applicable data from database to static files.
pipeline.move_to_static_files()?;
@ -108,7 +108,7 @@ impl Command {
Ok(())
}
async fn build_pipeline<DB: Database + 'static>(
fn build_pipeline<DB: Database + 'static>(
self,
config: Config,
provider_factory: ProviderFactory<Arc<DB>>,