Skip to content

Commit

Permalink
fix(experimental): log invalid dapp addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelstanley committed Aug 23, 2024
1 parent 545e56e commit 931e258
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions offchain/rollups-events/src/broker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,24 @@ impl Broker {
let mut dapp_addresses: Vec<Address> = 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,
),
}
}

Expand Down

0 comments on commit 931e258

Please sign in to comment.