Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(experimental): log invalid dapp addresses
Browse files Browse the repository at this point in the history
marcelstanley committed Aug 23, 2024

Verified

This commit was signed with the committer’s verified signature.
marcelstanley Marcel Moura
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
@@ -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,
),
}
}

0 comments on commit 931e258

Please sign in to comment.