Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzhhuang committed Jan 7, 2025
1 parent a75c045 commit 5753b5b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use starcoin_sync::announcement::AnnouncementService;
use starcoin_sync::block_connector::{BlockConnectorService, ResetRequest};
use starcoin_sync::sync::SyncService;
use starcoin_sync::txn_sync::TxnSyncService;
use starcoin_sync_api::SyncSpecificTagretRequest;
use starcoin_sync_api::SyncSpecificTargretRequest;
use starcoin_txpool::{TxPoolActorService, TxPoolService};
use starcoin_types::blockhash::KType;
use starcoin_types::system_events::{SystemShutdown, SystemStarted};
Expand Down Expand Up @@ -144,7 +144,7 @@ impl ServiceHandler<Self, NodeRequest> for NodeService {
let sync_service = ctx.service_ref::<SyncService>()?.clone();
let fut = async move {
info!("Prepare to re execute block {}", block_hash);
sync_service.notify(SyncSpecificTagretRequest {
sync_service.notify(SyncSpecificTargretRequest {
block: None,
block_id: block_hash,
peer_id: None,
Expand Down
4 changes: 2 additions & 2 deletions sync/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ impl ServiceRequest for SyncStatusRequest {
}

#[derive(Debug, Clone)]
pub struct SyncSpecificTagretRequest {
pub struct SyncSpecificTargretRequest {
pub block: Option<Block>,
pub block_id: HashValue,
pub peer_id: Option<PeerId>,
}

impl ServiceRequest for SyncSpecificTagretRequest {
impl ServiceRequest for SyncSpecificTargretRequest {
type Response = Result<()>;
}

Expand Down
4 changes: 2 additions & 2 deletions sync/src/block_connector/block_connector_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use starcoin_service_registry::{
};
use starcoin_storage::{BlockStore, Storage};
use starcoin_sync_api::PeerNewBlock;
use starcoin_sync_api::SyncSpecificTagretRequest;
use starcoin_sync_api::SyncSpecificTargretRequest;
use starcoin_txpool::TxPoolService;
use starcoin_txpool_api::TxPoolSyncService;
#[cfg(test)]
Expand Down Expand Up @@ -331,7 +331,7 @@ where
if !self.is_near_block(block.as_ref().header()) {
let _ = sync_service.notify(CheckSyncEvent::default());
} else {
let _ = sync_service.notify(SyncSpecificTagretRequest {
let _ = sync_service.notify(SyncSpecificTargretRequest {
block: Some(block.as_ref().clone()),
block_id: block.id(),
peer_id: Some(peer_id),
Expand Down
8 changes: 4 additions & 4 deletions sync/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use starcoin_storage::block_info::BlockInfoStore;
use starcoin_storage::{BlockStore, Storage};
use starcoin_sync_api::{
PeerScoreRequest, PeerScoreResponse, SyncBlockSort, SyncCancelRequest, SyncProgressReport,
SyncProgressRequest, SyncServiceHandler, SyncSpecificTagretRequest, SyncStartRequest,
SyncProgressRequest, SyncServiceHandler, SyncSpecificTargretRequest, SyncStartRequest,
SyncStatusRequest, SyncTarget,
};
use starcoin_txpool::TxPoolService;
Expand Down Expand Up @@ -212,7 +212,7 @@ impl SyncService {

fn check_and_start_light_sync(
&mut self,
msg: SyncSpecificTagretRequest,
msg: SyncSpecificTargretRequest,
ctx: &mut ServiceContext<Self>,
) -> Result<()> {
let network = ctx.get_shared::<NetworkServiceRef>()?;
Expand Down Expand Up @@ -843,8 +843,8 @@ impl EventHandler<Self, NewHeadBlock> for SyncService {
}
}

impl EventHandler<Self, SyncSpecificTagretRequest> for SyncService {
fn handle_event(&mut self, msg: SyncSpecificTagretRequest, ctx: &mut ServiceContext<Self>) {
impl EventHandler<Self, SyncSpecificTargretRequest> for SyncService {
fn handle_event(&mut self, msg: SyncSpecificTargretRequest, ctx: &mut ServiceContext<Self>) {
match self.check_and_start_light_sync(msg, ctx) {
Ok(()) => (),
Err(e) => warn!("[sync] Check and start light sync failed: {:?}", e),
Expand Down

0 comments on commit 5753b5b

Please sign in to comment.