From ca61e47b53cd7e3d31367f87799aa96c1a90e1c5 Mon Sep 17 00:00:00 2001 From: Theo Butler Date: Tue, 5 Nov 2024 09:22:03 -0500 Subject: [PATCH] fix: check for legacy_scalar field --- src/bin/main.rs | 3 +++ src/messages.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bin/main.rs b/src/bin/main.rs index 72e88bd..5e28899 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -183,6 +183,9 @@ async fn handle_source_msg( } => { if aggregation_timestamp >= start_timestamp { for indexer_query in &data.indexer_queries { + if indexer_query.legacy_scalar.unwrap_or(false) { + continue; + } let key = IndexerFeesKey { signer: Address::from_slice(&data.receipt_signer)?, receiver: Address::from_slice(&indexer_query.indexer)?, diff --git a/src/messages.rs b/src/messages.rs index 474e57f..9ddac15 100644 --- a/src/messages.rs +++ b/src/messages.rs @@ -49,8 +49,8 @@ pub struct IndexerQueryProtobuf { pub indexer_errors: String, #[prost(uint64, tag = "11")] pub blocks_behind: u64, - #[prost(bool, tag = "12")] - pub legacy_scalar: bool, + #[prost(bool, optional, tag = "12")] + pub legacy_scalar: Option, } #[derive(prost::Message)]