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

add token instance metadata check #2864

Merged
merged 3 commits into from
Nov 20, 2019
Merged

Conversation

ayrat555
Copy link
Contributor

some token instances return integers as metadata

Motivation

fixes

2019-11-19T09:35:55.538 [error] Task #PID<0.20704.5> started from Indexer.Fetcher.TokenInstance terminating
** (MatchError) no match of right hand side value: {:error, #Ecto.Changeset<action: :insert, changes: %{token_contract_address_hash: %Explorer.Chain.Hash{byte_count: 20, bytes: <<104, 35, 202, 192, 134, 199, 8, 88, 185, 190, 194, 23, 112, 82, 10, 103, 36, 129, 169, 107>>}, token_id: #Decimal<3>}, errors: [metadata: {"is invalid", [type: :map, validation: :cast]}], data: #Explorer.Chain.Token.Instance<>, valid?: false>}
    (indexer) lib/indexer/fetcher/token_instance.ex:63: Indexer.Fetcher.TokenInstance.run/2
    (elixir) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (elixir) lib/task/supervised.ex:35: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: &Indexer.BufferedTask.log_run/1
    Args: [%{batch: [%{contract_address_hash: %Explorer.Chain.Hash{byte_count: 20, bytes: <<104, 35, 202, 192, 134, 199, 8, 88, 185, 190, 194, 23, 112, 82, 10, 103, 36, 129, 169, 107>>}, token_id: #Decimal<3>}], callback_module: Indexer.Fetcher.TokenInstance, callback_module_state: [transport: EthereumJSONRPC.HTTP, transport_options: [http: EthereumJSONRPC.HTTP.HTTPoison, url: "http://10.1.0.74:8545", method_to_url: [eth_getBalance: "http://10.1.0.74:8545", trace_block: "http://10.1.0.74:8545", trace_replayTransaction: "http://10.1.0.74:8545"], http_options: [recv_timeout: 600000, timeout: 600000, hackney: [pool: :ethereum_jsonrpc]]], variant: EthereumJSONRPC.Parity], metadata: []}]

Changelog

  • add token instance metadata check

@coveralls
Copy link

coveralls commented Nov 19, 2019

Pull Request Test Coverage Report for Build fe81e1fd-d7ae-465b-99d4-801fe509e7db

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.004%) to 75.322%

Totals Coverage Status
Change from base Build 324d81e6-beb6-4fa3-a8d4-c5f2723c2611: 0.004%
Covered Lines: 5259
Relevant Lines: 6982

💛 - Coveralls

@vbaranov vbaranov self-requested a review November 19, 2019 14:53
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.

@ayrat555 no CHANGELOG entry

@vbaranov vbaranov merged commit 896dc1e into master Nov 20, 2019
@vbaranov vbaranov deleted the ab-add-instance-metadata-check branch November 20, 2019 08:57
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

3 participants