From 931e258cb6784c409f6248d34ff2621c429102f6 Mon Sep 17 00:00:00 2001 From: Marcel Moura <5615598+marcelstanley@users.noreply.github.com> Date: Fri, 23 Aug 2024 14:55:20 -0300 Subject: [PATCH] fix(experimental): log invalid dapp addresses --- offchain/rollups-events/src/broker/mod.rs | 24 +++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/offchain/rollups-events/src/broker/mod.rs b/offchain/rollups-events/src/broker/mod.rs index 529d1d1ee..56e18ab51 100644 --- a/offchain/rollups-events/src/broker/mod.rs +++ b/offchain/rollups-events/src/broker/mod.rs @@ -376,12 +376,24 @@ impl Broker { let mut dapp_addresses: Vec
= vec![]; for value in reply { let normalized = value.to_lowercase(); - let dapp_address = Address::from_str(&normalized).unwrap(); - if dapp_addresses.contains(&dapp_address) { - let _: () = - self.connection.clone().srem(DAPPS_KEY, value).await?; - } else { - dapp_addresses.push(dapp_address); + let dapp_address = Address::from_str(&normalized); + match dapp_address { + Ok(dapp_address) => { + if dapp_addresses.contains(&dapp_address) { + let _: () = self + .connection + .clone() + .srem(DAPPS_KEY, value) + .await?; + } else { + dapp_addresses.push(dapp_address); + } + } + Err(message) => tracing::info!( + "Error while parsing DApp address {:?}: {}", + normalized, + message, + ), } }