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

Update token balances in token instance fetcher #6168

Merged
merged 4 commits into from Sep 29, 2022

Conversation

Qwerty5Uiop
Copy link
Collaborator

Motivation

As an improvement of current token balances relevance, token instance fetcher can check info about token instance owner and update corresponding current token balance.

Changelog

Token instance fetcher now checks the owner of instance and update its current token balance.

Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

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

Causing errors like this:

2022-09-29T15:48:29.844 [error] Task #PID<0.5732.0> started from Indexer.Fetcher.TokenInstance terminating
** (Postgrex.Error) ERROR 23503 (foreign_key_violation) insert or update on table "address_current_token_balances" violates foreign key constraint "address_current_token_balances_address_hash_fkey"

    table: address_current_token_balances
    constraint: address_current_token_balances_address_hash_fkey

Key (address_hash)=(\xacd934cc70048aa67656d445baadb7f5c0b8c582) is not present in table "addresses"

[ok_result] ++ acc

{:error, error_message} ->
Logger.error("Failed to get owner of token_id #{request.token_id}, reason: #{error_message}")
Copy link
Member

Choose a reason for hiding this comment

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

Could we also add token hash into the error for faster debugging?

@vbaranov vbaranov merged commit cabfdfa into master Sep 29, 2022
@vbaranov vbaranov deleted the improve-token-balances-updating branch September 29, 2022 15:42
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.

None yet

2 participants