remove unused variable

This commit is contained in:
GroovieGermanikus 2023-12-19 08:16:50 +01:00
parent cfef19a3a6
commit db2288c312
No known key found for this signature in database
GPG Key ID: 5B6EB831A5CD2015
2 changed files with 3 additions and 12 deletions

View File

@ -104,14 +104,13 @@ pub async fn main() {
if subscribe_blocks {
info!("Write Block stream..");
let green_stream =
create_geyser_reconnecting_stream(green_config.clone(), GeyserFilter::blocks(), CommitmentConfig::confirmed());
create_geyser_reconnecting_stream(green_config.clone(), GeyserFilter::blocks_and_txs(), CommitmentConfig::confirmed());
let blue_stream =
create_geyser_reconnecting_stream(blue_config.clone(), GeyserFilter::blocks(), CommitmentConfig::confirmed());
create_geyser_reconnecting_stream(blue_config.clone(), GeyserFilter::blocks_and_txs(), CommitmentConfig::confirmed());
let toxiproxy_stream =
create_geyser_reconnecting_stream(toxiproxy_config.clone(), GeyserFilter::blocks(), CommitmentConfig::confirmed());
create_geyser_reconnecting_stream(toxiproxy_config.clone(), GeyserFilter::blocks_and_txs(), CommitmentConfig::confirmed());
let multiplex_stream = create_multiplex(
vec![green_stream, blue_stream, toxiproxy_stream],
CommitmentConfig::confirmed(),
BlockExtractor(CommitmentConfig::confirmed()),
);
start_example_block_consumer(multiplex_stream);
@ -127,7 +126,6 @@ pub async fn main() {
create_geyser_reconnecting_stream(toxiproxy_config.clone(), GeyserFilter::blocks_meta(), CommitmentConfig::confirmed());
let multiplex_stream = create_multiplex(
vec![green_stream, blue_stream, toxiproxy_stream],
CommitmentConfig::confirmed(),
BlockMetaExtractor(CommitmentConfig::confirmed()),
);
start_example_blockmeta_consumer(multiplex_stream);

View File

@ -24,18 +24,11 @@ struct TaggedMessage {
/// note: this is agnostic to the type of the stream
pub fn create_multiplex<M>(
grpc_source_streams: Vec<impl Stream<Item = Message>>,
commitment_config: CommitmentConfig,
mapper: M,
) -> impl Stream<Item = M::Target>
where
M: FromYellowstoneMapper,
{
assert!(
commitment_config == CommitmentConfig::confirmed()
|| commitment_config == CommitmentConfig::finalized(),
"Only CONFIRMED and FINALIZED is supported"
);
// note: PROCESSED blocks are not sequential in presense of forks; this will break the logic
if grpc_source_streams.is_empty() {
panic!("Must have at least one source");