Skip to content

Commit

Permalink
fix(bens): config and updating bug (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenzing authored Jul 30, 2024
1 parent ee5a235 commit 71089b7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
34 changes: 20 additions & 14 deletions blockscout-ens/bens-logic/src/subgraph/ens/wildcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub async fn maybe_wildcard_resolution_with_cache(
Err(err) => {
tracing::error!(
name = from_user.inner.name,
error = %err,
error = ?err,
"error while trying wildcard resolution"
);
cached::Return::new(None)
Expand All @@ -57,19 +57,25 @@ async fn try_wildcard_resolution(
return Ok(None);
};

if let Some(domain) = &maybe_existing_domain {
let maybe_found_domain = maybe_existing_domain.and_then(|domain| {
if domain.id == from_user.inner.id {
if !domain.resolved_with_wildcard {
// we found domain that resolved by graph node already, skip it
return Ok(None);
} else {
// domain is resolved with wildcard, so we need to recheck it
tracing::info!(
domain_id = domain.id,
domain_name = domain.name,
"found domain with wildcard-resolution, rechecking it"
)
}
Some(domain)
} else {
None
}
});

if let Some(domain) = &maybe_found_domain {
if !domain.resolved_with_wildcard {
// we found domain that resolved by graph node already, skip it
return Ok(None);
} else {
// domain is resolved with wildcard, so we need to recheck it
tracing::info!(
domain_id = domain.id,
domain_name = domain.name,
"found domain with wildcard-resolution, rechecking it"
)
}
};

Expand All @@ -81,7 +87,7 @@ async fn try_wildcard_resolution(
Ok(Some(creation_domain_from_rpc_resolution(
from_user,
result,
maybe_existing_domain,
maybe_found_domain,
)))
} else {
Ok(None)
Expand Down
2 changes: 1 addition & 1 deletion blockscout-ens/bens-server/config/staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"networks": {
"11155111": {
"blockscout": {
"url": "https://eth-sepolia.k8s-dev.com"
"url": "https://eth-sepolia.k8s-dev.blockscout.com"
},
"use_protocols": [
"ens", "genome", "mode"
Expand Down

0 comments on commit 71089b7

Please sign in to comment.