Skip to content

Commit

Permalink
fix(bens): no addr2name table (#1130)
Browse files Browse the repository at this point in the history
* possible fix
* better testing experience
  • Loading branch information
bragov4ik authored Nov 26, 2024
1 parent 480d1e8 commit ccdc66d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions blockscout-ens/bens-logic/src/subgraph/offchain/resolve.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::ResolveResult;
use crate::{
protocols::{DomainNameOnProtocol, ProtocolSpecific},
protocols::{AddressResolveTechnique, DomainNameOnProtocol, ProtocolSpecific},
subgraph::{
offchain::{d3, ens},
sql,
Expand Down Expand Up @@ -28,8 +28,10 @@ pub async fn offchain_resolve(
"found domain with offchain resolution, save it"
);
sql::create_or_update_domain(db, result.domain, protocol).await?;
if let Some(reverse_record) = result.maybe_reverse_record {
sql::create_or_update_reverse_record(db, reverse_record, protocol).await?;
if protocol.info.address_resolve_technique == AddressResolveTechnique::Addr2Name {
if let Some(reverse_record) = result.maybe_reverse_record {
sql::create_or_update_reverse_record(db, reverse_record, protocol).await?;
}
}
}
cached::Return {
Expand Down
3 changes: 2 additions & 1 deletion blockscout-ens/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ stop-test-postgres:
just docker-name="{{docker-name}}-test" stop-postgres

test *args:
SQLX_OFFLINE=true RUST_LOG=info cargo test {{args}}
SQLX_OFFLINE=true RUST_LOG=info cargo test {{args}} -- --nocapture

test-with-db *args:
-just stop-test-postgres 2> /dev/null
-just db-port="{{test-db-port}}" db-name="" docker-name="{{docker-name}}-test" start-postgres
just db-port="{{test-db-port}}" db-name="" test {{args}}

Expand Down

0 comments on commit ccdc66d

Please sign in to comment.