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

return not found for not verified contract for token read_contract #2800

Merged
merged 5 commits into from
Oct 29, 2019

Conversation

ayrat555
Copy link
Contributor

Motivation

fixes

Request: GET /smart_contracts?hash=0x77fe30b2cf39245267c0a5084b66a560f1cf9e1f
** (exit) an exception was raised:
    ** (BadMapError) expected a map, got: nil
        (elixir) lib/map.ex:451: Map.get(nil, :abi, nil)
        (explorer) lib/explorer/smart_contract/reader.ex:170: Explorer.SmartContract.Reader.read_only_functions/1
        (block_scout_web) lib/block_scout_web/controllers/smart_contract_controller.ex:11: BlockScoutWeb.SmartContractController.index/2
        (block_scout_web) lib/block_scout_web/controllers/smart_contract_controller.ex:1: BlockScoutWeb.SmartContractController.action/2
        (block_scout_web) lib/block_scout_web/controllers/smart_contract_controller.ex:1: BlockScoutWeb.SmartContractController.phoenix_controller_pipeline/2
        (block_scout_web) lib/block_scout_web/endpoint.ex:1: BlockScoutWeb.Endpoint.instrument/4
        (phoenix) lib/phoenix/router.ex:275: Phoenix.Router.__call__/1
        (phoenix) lib/phoenix/router/route.ex:39: Phoenix.Router.Route.call/2

Changelog

  • return not found for not verified contract for token read_contract

@coveralls
Copy link

coveralls commented Oct 24, 2019

Pull Request Test Coverage Report for Build bf1d4c9c-ef52-4db1-b802-f4ea65e932b2

  • 4 of 4 (100.0%) changed or added relevant lines in 2 files are covered.
  • 13 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.2%) to 76.451%

Files with Coverage Reduction New Missed Lines %
apps/indexer/lib/indexer/fetcher/token.ex 1 80.0%
apps/indexer/lib/indexer/fetcher/token_balance.ex 2 87.88%
apps/indexer/lib/indexer/block/catchup/bound_interval_supervisor.ex 3 85.19%
apps/indexer/lib/indexer/fetcher/token_instance.ex 3 0.0%
apps/indexer/lib/indexer/block/fetcher.ex 4 86.75%
Totals Coverage Status
Change from base Build 7eac4942-59b6-478f-ba79-37b9eb8c6f07: -0.2%
Covered Lines: 5295
Relevant Lines: 6926

💛 - Coveralls

validation_count: validation_count
)
else
not_found(conn)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can be moved into the else of the with with the other not_found(conn) by moving the if into the with, maybe like so:

  false <- is_nil(address.smart_contract)

or something like that.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vbaranov vbaranov merged commit a50a61d into master Oct 29, 2019
@vbaranov vbaranov deleted the ab-read-contract-not-found branch October 29, 2019 12:47
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

4 participants