Skip to content

Commit

Permalink
fmt+clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
grooviegermanikus committed Mar 25, 2024
1 parent 7f6ee49 commit 7c0ac01
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
5 changes: 2 additions & 3 deletions examples/stream_blocks_mainnet_task.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use futures::Stream;
use log::{info, warn};
use solana_sdk::clock::Slot;
use solana_sdk::commitment_config::CommitmentConfig;
Expand All @@ -22,10 +21,10 @@ use tokio::sync::mpsc::Receiver;
use yellowstone_grpc_proto::geyser::SubscribeUpdateBlock;

use geyser_grpc_connector::grpc_subscription_autoreconnect_tasks::{
create_geyser_autoconnection_task, create_geyser_autoconnection_task_with_mpsc,
create_geyser_autoconnection_task_with_mpsc,
};
use geyser_grpc_connector::grpcmultiplex_fastestwins::{
create_multiplexed_stream, FromYellowstoneExtractor,
FromYellowstoneExtractor,
};
use geyser_grpc_connector::{GeyserFilter, GrpcConnectionTimeouts, GrpcSourceConfig, Message};
use tokio::time::{sleep, Duration};
Expand Down
2 changes: 1 addition & 1 deletion src/grpc_subscription_autoreconnect_streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use log::{debug, info, log, trace, warn, Level};
use std::time::Duration;

Check warning on line 5 in src/grpc_subscription_autoreconnect_streams.rs

View workflow job for this annotation

GitHub Actions / test

Diff in /home/runner/work/geyser-grpc-connector/geyser-grpc-connector/src/grpc_subscription_autoreconnect_streams.rs

Check warning on line 5 in src/grpc_subscription_autoreconnect_streams.rs

View workflow job for this annotation

GitHub Actions / test

Diff in /home/runner/work/geyser-grpc-connector/geyser-grpc-connector/src/grpc_subscription_autoreconnect_streams.rs
use tokio::task::JoinHandle;
use tokio::time::{sleep, timeout};
use yellowstone_grpc_client::{GeyserGrpcClient, GeyserGrpcClientResult};
use yellowstone_grpc_client::{GeyserGrpcClientResult};
use yellowstone_grpc_proto::geyser::{SubscribeRequest, SubscribeUpdate};
use yellowstone_grpc_proto::tonic::Status;

Expand Down
19 changes: 1 addition & 18 deletions src/yellowstone_grpc_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,6 @@ use yellowstone_grpc_proto::tonic::service::Interceptor;
use yellowstone_grpc_proto::tonic::transport::ClientTlsConfig;


Check warning on line 13 in src/yellowstone_grpc_util.rs

View workflow job for this annotation

GitHub Actions / test

Diff in /home/runner/work/geyser-grpc-connector/geyser-grpc-connector/src/yellowstone_grpc_util.rs
pub async fn connect_with_timeout<E, T>(
endpoint: E,
x_token: Option<T>,
tls_config: Option<ClientTlsConfig>,
connect_timeout: Option<Duration>,
request_timeout: Option<Duration>,
connect_lazy: bool,
) -> GeyserGrpcClientResult<GeyserGrpcClient<impl Interceptor>>
where
E: Into<Bytes>,
T: TryInto<AsciiMetadataValue, Error = InvalidMetadataValue>,
{
GeyserGrpcClient::connect_with_timeout(
endpoint, x_token, tls_config, connect_timeout, request_timeout, connect_lazy).await
}


// see https://github.com/hyperium/tonic/blob/v0.10.2/tonic/src/transport/channel/mod.rs
const DEFAULT_BUFFER_SIZE: usize = 1024;
// see https://github.com/hyperium/hyper/blob/v0.14.28/src/proto/h2/client.rs#L45
Expand Down Expand Up @@ -104,7 +87,7 @@ pub async fn connect_with_timeout_with_buffers<E, T>(
let interceptor = InterceptorXToken { x_token };

let channel = endpoint.connect_lazy();
let mut client = GeyserGrpcClient::new(
let client = GeyserGrpcClient::new(
HealthClient::with_interceptor(channel.clone(), interceptor.clone()),
GeyserClient::with_interceptor(channel, interceptor)
.max_decoding_message_size(GeyserGrpcClient::max_decoding_message_size()),
Expand Down

0 comments on commit 7c0ac01

Please sign in to comment.