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

Read contract: fix internal server error for method with empty output array #3514

Merged
merged 1 commit into from
Dec 7, 2020

Conversation

vbaranov
Copy link
Member

@vbaranov vbaranov commented Dec 7, 2020

Motivation

 Request: GET /smart-contracts?hash=0x47ed323d03cd3fff423f1200af2e2e3d823e8d0a&type=regular&action=read
blockscout     | ** (exit) an exception was raised:
blockscout     |     ** (Protocol.UndefinedError) protocol Enumerable not implemented for "" of type BitString. This protocol is implemented for the following type(s): Indexer.BoundQueue, Ecto.Adapters.SQL.Stream, Postgrex.Stream, DBConnection.PrepareStream, DBConnection.Stream, Timex.Interval, Flow, Map, MapSet, Function, HashDict, IO.Stream, File.Stream, List, Stream, Range, HashSet, Date.Range, GenEvent.Stream
blockscout     |         (elixir 1.10.4) lib/enum.ex:1: Enumerable.impl_for!/1
blockscout     |         (elixir 1.10.4) lib/enum.ex:141: Enumerable.reduce/3
blockscout     |         (elixir 1.10.4) lib/enum.ex:3383: Enum.map/2
blockscout     |         (explorer 0.0.1) lib/explorer/smart_contract/reader.ex:449: Explorer.SmartContract.Reader.new_value/3
blockscout     |         (explorer 0.0.1) lib/explorer/smart_contract/reader.ex:424: anonymous fn/3 in Explorer.SmartContract.Reader.link_outputs_and_values/3
blockscout     |         (elixir 1.10.4) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
blockscout     |         (explorer 0.0.1) lib/explorer/smart_contract/reader.ex:423: Explorer.SmartContract.Reader.link_outputs_and_values/3
blockscout     |         (explorer 0.0.1) lib/explorer/smart_contract/reader.ex:313: Explorer.SmartContract.Reader.fetch_current_value_from_blockchain/3

Checklist for your Pull Request (PR)

@vbaranov vbaranov changed the title Fix empty array Read contract: fix internal server error for method with empty output array Dec 7, 2020
@coveralls
Copy link

coveralls commented Dec 7, 2020

Pull Request Test Coverage Report for Build cf659a196aaa82cc198080744b845989fe11beca-PR-3514

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 67.023%

Files with Coverage Reduction New Missed Lines %
lib/block_scout_web/controllers/chain/market_history_chart_controller.ex 1 78.57%
Totals Coverage Status
Change from base Build 19c744f1023b2c23cc8df0fb7216dcbd4e93bbb8: -0.3%
Covered Lines: 2071
Relevant Lines: 3090

💛 - Coveralls

@vbaranov vbaranov merged commit e4f79c0 into master Dec 7, 2020
@vbaranov vbaranov deleted the vb-fix-empty-array branch December 7, 2020 20:24
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