Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix current_aptos_names view #503

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Fix current_aptos_names view #503

merged 1 commit into from
Sep 13, 2024

Conversation

rtso
Copy link
Collaborator

@rtso rtso commented Sep 10, 2024

Description

There's a bug in the ANS contract where the primary name and the ANS don't point to the same registered address if a primary name token gets transfered. This caused the current_aptos_names view to show the wrong primary name because it joins only on token_name. We need to add a constraint to the left join on current_ans_lookup_v2.registered_address = current_ans_primary_name_v2.registered_address

Screenshot 2024-09-10 at 6 07 41 PM
Screenshot 2024-09-10 at 6 07 27 PM

Testing

Run the SQL and see that is_primary = false
Screenshot 2024-09-10 at 6 04 46 PM

@rtso rtso requested review from bowenyang007 and a team September 10, 2024 22:15
FROM current_ans_lookup_v2 cal
LEFT JOIN current_ans_primary_name_v2 capn ON cal.token_name = capn.token_name
AND cal.token_standard = capn.token_standard
AND capn.registered_address = cal.registered_address
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only line that changed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment in the file that this is the only line that changed?

@rtso rtso force-pushed the rtso/ans-registered-addr branch from 1f31695 to 8c72460 Compare September 13, 2024 17:42
@rtso rtso merged commit 35dcd59 into main Sep 13, 2024
7 checks passed
@rtso rtso deleted the rtso/ans-registered-addr branch September 13, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants