Skip to content

Commit

Permalink
replace .unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
grooviegermanikus committed Mar 25, 2024
1 parent 34a01ba commit ae56e0f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion examples/stream_blocks_mainnet_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use log::{info, warn};
use solana_sdk::clock::Slot;
use solana_sdk::commitment_config::CommitmentConfig;
use std::env;
use std::pin::pin;

use base64::Engine;
use itertools::Itertools;
Expand Down
12 changes: 1 addition & 11 deletions src/yellowstone_grpc_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ pub async fn connect_with_timeout_with_buffers<E, T>(
.buffer_size(buffer_config.buffer_size)
.initial_connection_window_size(buffer_config.conn_window)
.initial_stream_window_size(buffer_config.stream_window);
// .buffer_size(Some(65536)) // 64kb (default: 1024)
// .initial_stream_window_size(4194304);// 4mb (default: 2mb)
// // .tls_config(tls_config.unwrap()).unwrap(); // FIXME

if let Some(tls_config) = tls_config {
endpoint = endpoint.tls_config(tls_config)?;
Expand All @@ -101,20 +98,13 @@ pub async fn connect_with_timeout_with_buffers<E, T>(
}

let x_token: Option<AsciiMetadataValue> = match x_token {
Some(x_token) => Some(x_token.try_into().unwrap()), // FIXME replace unwrap
Some(x_token) => Some(x_token.try_into()?),
None => None,
};
// match x_token {
// Some(token) if token.is_empty() => {
// panic!("empty token");
// }
// _ => {}
// }
let interceptor = InterceptorXToken { x_token };

let channel = endpoint.connect_lazy();
let mut client = GeyserGrpcClient::new(
// TODO move tonic-health
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 ae56e0f

Please sign in to comment.