mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2025-11-05 17:07:29 +00:00
fix lint
This commit is contained in:
parent
75b05c38fd
commit
68f2168bbd
@ -15,7 +15,7 @@ mod zgs_grpc;
|
||||
|
||||
use crate::miner::RpcServer as MinerRpcServer;
|
||||
use crate::types::SegmentWithProof;
|
||||
use crate::zgs_grpc::zgs_grpc::ZgsGrpcServiceImpl;
|
||||
use crate::zgs_grpc::r#impl::ZgsGrpcServiceImpl;
|
||||
use crate::zgs_grpc_proto::zgs_grpc_service_server::ZgsGrpcServiceServer;
|
||||
use admin::RpcServer as AdminRpcServer;
|
||||
use chunk_pool::MemoryChunkPool;
|
||||
|
||||
@ -129,13 +129,13 @@ impl TryFrom<zgs_grpc_proto::SegmentWithProof> for SegmentWithProof {
|
||||
type Error = GrpcStatus;
|
||||
|
||||
fn try_from(grpc_segment: zgs_grpc_proto::SegmentWithProof) -> Result<Self, GrpcStatus> {
|
||||
let root = grpc_segment.root.unwrap().try_into().map_err(|e| e)?;
|
||||
let root = grpc_segment.root.unwrap().try_into()?;
|
||||
let data = grpc_segment.data;
|
||||
// index is u64 in proto, usize in app
|
||||
let index = grpc_segment.index.try_into().map_err(|_| {
|
||||
GrpcStatus::invalid_argument(format!("Invalid segment index: {}", grpc_segment.index))
|
||||
})?;
|
||||
let proof = grpc_segment.proof.unwrap().try_into().map_err(|e| e)?;
|
||||
let proof = grpc_segment.proof.unwrap().try_into()?;
|
||||
let file_size = grpc_segment.file_size.try_into().map_err(|_| {
|
||||
GrpcStatus::invalid_argument(format!("Invalid file size: {}", grpc_segment.file_size))
|
||||
})?;
|
||||
|
||||
@ -75,8 +75,7 @@ impl RpcServer for RpcServerImpl {
|
||||
|
||||
let maybe_tx = self.ctx.log_store.get_tx_by_seq_number(tx_seq).await?;
|
||||
for segment in segments.into_iter() {
|
||||
match rpc_helper::put_segment_with_maybe_tx(&self.ctx, segment, maybe_tx.clone())
|
||||
.await
|
||||
match rpc_helper::put_segment_with_maybe_tx(&self.ctx, segment, maybe_tx.clone()).await
|
||||
{
|
||||
Ok(()) => {} // success
|
||||
Err(e)
|
||||
|
||||
@ -1 +1 @@
|
||||
pub mod zgs_grpc;
|
||||
pub mod r#impl;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user