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 (Token detection): Do after decoding ends #8340

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

OjusWiZard
Copy link
Contributor

Checklist

  • Detect received tokens right after finishing the decoding task

@OjusWiZard OjusWiZard added the ready for peer review Backend PR ready to be reviewed by colleagues label Jul 29, 2024
rotkehlchen/tasks/assets.py Outdated Show resolved Hide resolved
rotkehlchen/tasks/assets.py Outdated Show resolved Hide resolved
rotkehlchen/tasks/assets.py Outdated Show resolved Hide resolved
Comment on lines 614 to 616
self._post_process(refresh_balances=refresh_balances)
maybe_detect_new_tokens(self.database)
return events
Copy link
Member

Choose a reason for hiding this comment

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

this doesn't make any external request right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no it only process the data in the db

rotkehlchen/tasks/assets.py Outdated Show resolved Hide resolved
rotkehlchen/tasks/assets.py Show resolved Hide resolved
rotkehlchen/tests/unit/test_evm_tx_decoding.py Outdated Show resolved Hide resolved
@OjusWiZard OjusWiZard force-pushed the fix/decoder branch 2 times, most recently from a2d41f8 to a0275b5 Compare July 29, 2024 15:37
Comment on lines 426 to 429
event.location_label not in database.get_single_blockchain_addresses(
cursor=cursor,
blockchain=chain,
)
Copy link
Member

Choose a reason for hiding this comment

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

mmm this is one query per event... can't you just do

{address_tuple[0] for address_tuple in cursor.execute(
            'SELECT UNIQUE account FROM blockchain_accounts;',
        )}

at the start of the function?

@yabirgb
Copy link
Member

yabirgb commented Jul 29, 2024

Updated aave test due to

because in that test, first we decode some transactions, that detects a token for that address
then we query for aave balances below, which internally first query all the evm token balances of that address.
So, now there is one extra token detected whose price query had to be VCRed

@yabirgb yabirgb added ready for final review Backend PR ready to be reviewed by great Lefteris and removed ready for peer review Backend PR ready to be reviewed by colleagues labels Jul 29, 2024
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

Attention: Patch coverage is 91.89189% with 3 lines in your changes missing coverage. Please review.

Project coverage is 53.81%. Comparing base (ab9e478) to head (4354a9a).
Report is 12 commits behind head on bugfixes.

Files Patch % Lines
rotkehlchen/tasks/assets.py 93.10% 1 Missing and 1 partial ⚠️
rotkehlchen/tasks/manager.py 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           bugfixes    #8340    /-   ##
=========================================
  Coverage     53.80%   53.81%           
=========================================
  Files          1707     1708     1     
  Lines        168704   168773    69     
  Branches      13956    13969    13     
=========================================
  Hits          90774    90824    50     
- Misses        75505    75528    23     
  Partials       2425     2421    -4     
Flag Coverage Δ
backend 80.88% <91.89%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

rotkehlchen/tasks/assets.py Show resolved Hide resolved
rotkehlchen/tasks/assets.py Outdated Show resolved Hide resolved
rotkehlchen/tasks/assets.py Outdated Show resolved Hide resolved
Copy link
Member

@LefterisJP LefterisJP left a comment

Choose a reason for hiding this comment

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

LGTM

@LefterisJP LefterisJP merged commit d487397 into rotki:bugfixes Jul 29, 2024
14 checks passed
@rotkibot
Copy link

rotki/test-caching/tree/fix/decoder was successfully merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for final review Backend PR ready to be reviewed by great Lefteris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants