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

Get token type for token balance update if it is empty #4806

Merged

Conversation

vbaranov
Copy link
Member

@vbaranov vbaranov commented Oct 24, 2021

Motivation

An error of such kind appears when indexing token balances:
application=indexer count=200 error_count=200 [debug] failed to import token balances: [#Ecto.Changeset<action: nil, changes: %{address_hash: %Explorer.Chain.Hash{byte_count: 20, bytes: <<91, 180, 86, 205, 9, 216, 81, 86, 225, 130, 210, 199, 121, 126, 180, 154, 67, 132, 1, 135>>}, block_number: 10963708, token_contract_address_hash: %Explorer.Chain.Hash{byte_count: 20, bytes: <<192, 42, 170, 57, 178, 35, 254, 141, 10, 14, 92, 79, 39, 234, 217, 8, 60, 117, 108, 194>>}, value: #Decimal<1>, value_fetched_at: ~U[2021-10-24 20:29:17.692398Z]}, errors: [token_type: {"can't be blank", [validation: :required]}]

Changelog

Check if all items in token balances changeset contain token type and if some of the items don't have a token type, fetch it from tokens table

Checklist for your Pull Request (PR)

@vbaranov vbaranov force-pushed the vb-get-token-type-for-token-balance-update-if-it-s-empty branch 3 times, most recently from dca0eec to c983070 Compare October 24, 2021 21:41
@vbaranov vbaranov force-pushed the vb-get-token-type-for-token-balance-update-if-it-s-empty branch from c983070 to e8ee992 Compare October 29, 2021 12:24
@vbaranov vbaranov merged commit d603e64 into master Oct 29, 2021
@vbaranov vbaranov deleted the vb-get-token-type-for-token-balance-update-if-it-s-empty branch October 29, 2021 13:03
sidhujag pushed a commit to syscoin/blockscout that referenced this pull request Oct 29, 2021
…for-token-balance-update-if-it-s-empty

Get token type for token balance update if it is empty
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

1 participant