aptos-labs / aptos-indexer-processors

Set of core processors that index data on the Aptos blockchain
https://aptos.dev/indexer/indexer-landing
60 stars 72 forks source link

Fix current_aptos_names view #503

Closed rtso closed 2 months ago

rtso commented 2 months ago

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