message: [sync]add get_hash_by_number fun.
diff: use crate::{do_duration, DELAY_TIME};
  -use anyhow::Result;
  +use anyhow::{format_err, Result};
  use network::NetworkAsyncService;
  -use network_p2p_api::sync_messages::{SyncRpcRequest, SyncRpcResponse};
  +use network_p2p_api::sync_messages::{
  + BatchHashByNumberMsg, GetHashByNumberMsg, ProcessMessage, SyncRpcRequest, SyncRpcResponse,
  +};
  use starcoin_canonical_serialization::SCSCodec;
  use types::peer_info::PeerId;
  @@ -16,3 +18,19 @@ pub async fn send_sync_request(
  .await?;
  SyncRpcResponse::decode(&response)
  }
  +
  +pub async fn get_hash_by_number(
  + network: &NetworkAsyncService,
  + peer_id: PeerId,
  + req: GetHashByNumberMsg,
  +) -> Result<BatchHashByNumberMsg> {
  + let request = SyncRpcRequest::GetHashByNumberMsg(ProcessMessage::GetHashByNumberMsg(req));
  +
  + if let SyncRpcResponse::BatchHashByNumberMsg(batch_hash_by_number_msg) =
  + send_sync_request(&network, peer_id, request).await?
  + {
  + Ok(batch_hash_by_number_msg)
  + } else {
  + Err(format_err!("{:?}", "error SyncRpcResponse type"))
  + }
  +}
  