cargo fmt and clippy

This commit is contained in:
godmodegalactus 2024-04-22 21:36:44 +02:00
parent 2002c43589
commit 80288a4ade
No known key found for this signature in database
GPG Key ID: 22DA4A30887FDA3C
5 changed files with 26 additions and 11 deletions

View File

@ -95,8 +95,9 @@ impl AccountDataByCommitment {
// processed not present for the slot // processed not present for the slot
// grpc can send multiple inter transaction changed account states for same slot // grpc can send multiple inter transaction changed account states for same slot
// we have to update till we get the last // we have to update till we get the last
if commitment == Commitment::Processed || !self.processed_accounts.contains_key(&data.updated_slot){ if commitment == Commitment::Processed
|| !self.processed_accounts.contains_key(&data.updated_slot)
{
self.processed_accounts self.processed_accounts
.insert(data.updated_slot, data.clone()); .insert(data.updated_slot, data.clone());
updated = true; updated = true;
@ -413,7 +414,11 @@ impl AccountStorageInterface for InmemoryAccountStore {
} }
None => { None => {
if commitment == Commitment::Confirmed { if commitment == Commitment::Confirmed {
log::warn!("slot status not found for {} and commitment {}, confirmed lagging", slot, commitment.into_commitment_level()); log::warn!(
"slot status not found for {} and commitment {}, confirmed lagging",
slot,
commitment.into_commitment_level()
);
} else if commitment == Commitment::Finalized { } else if commitment == Commitment::Finalized {
log::error!("slot status not found for {} and commitment {}, should be normal during startup", slot, commitment.into_commitment_level()); log::error!("slot status not found for {} and commitment {}, should be normal during startup", slot, commitment.into_commitment_level());
} }

View File

@ -1,12 +1,18 @@
use std::time::Duration; use std::time::Duration;
use bytes::Bytes; use bytes::Bytes;
use geyser_grpc_connector::{yellowstone_grpc_util::GeyserGrpcClientBufferConfig, GeyserGrpcClient, GeyserGrpcClientResult}; use geyser_grpc_connector::{
use tonic::{codec::CompressionEncoding, metadata::{errors::InvalidMetadataValue, AsciiMetadataValue}, service::Interceptor, transport::ClientTlsConfig}; yellowstone_grpc_util::GeyserGrpcClientBufferConfig, GeyserGrpcClient, GeyserGrpcClientResult,
};
use tonic::{
codec::CompressionEncoding,
metadata::{errors::InvalidMetadataValue, AsciiMetadataValue},
service::Interceptor,
transport::ClientTlsConfig,
};
use tonic_health::pb::health_client::HealthClient; use tonic_health::pb::health_client::HealthClient;
use yellowstone_grpc_proto::geyser::geyser_client::GeyserClient;
use yellowstone_grpc_client::InterceptorXToken; use yellowstone_grpc_client::InterceptorXToken;
use yellowstone_grpc_proto::geyser::geyser_client::GeyserClient;
pub async fn connect_with_timeout_with_buffers_and_compression<E, T>( pub async fn connect_with_timeout_with_buffers_and_compression<E, T>(
endpoint: E, endpoint: E,

View File

@ -5,7 +5,9 @@ use crate::grpc_multiplex::{
}; };
use anyhow::Context; use anyhow::Context;
use futures::StreamExt; use futures::StreamExt;
use geyser_grpc_connector::yellowstone_grpc_util::{connect_with_timeout_with_buffers, GeyserGrpcClientBufferConfig}; use geyser_grpc_connector::yellowstone_grpc_util::{
connect_with_timeout_with_buffers, GeyserGrpcClientBufferConfig,
};
use geyser_grpc_connector::GrpcSourceConfig; use geyser_grpc_connector::GrpcSourceConfig;
use itertools::Itertools; use itertools::Itertools;
use log::trace; use log::trace;

View File

@ -209,8 +209,10 @@ pub async fn start_lite_rpc(args: Config, rpc_client: Arc<RpcClient>) -> anyhow:
let account_service = AccountService::new(account_storage, account_notification_sender); let account_service = AccountService::new(account_storage, account_notification_sender);
account_service account_service.process_account_stream(
.process_account_stream(account_stream.resubscribe(), blockinfo_notifier.resubscribe()); account_stream.resubscribe(),
blockinfo_notifier.resubscribe(),
);
account_service account_service
.populate_from_rpc( .populate_from_rpc(