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

Fix broken call of fallback function and call of Gnosis contract methods with parameters #3477

Merged
merged 1 commit into from
Nov 23, 2020

Conversation

vbaranov
Copy link
Member

@vbaranov vbaranov commented Nov 23, 2020

Motivation

  1. Call of a contract's fallback function returns an alert

image

  1. Calls of GnosisProxy contract functions with parameters return the error:
2020-11-17T16:50:13.031 [error] #PID<0.6835.0> running BlockScoutWeb.Endpoint (connection #PID<0.6713.0>, stream id 9) terminated
Request: GET /smart-contracts/0x52a0110990C2047B1354b53Ef576f93f471D124F?function_name=isOwner&method_id=2f54bf6e&args%5B%5D=0xBDFdb9F56e7E11D51DB3c80604D09970C97445Fa
** (exit) an exception was raised:
    ** (MatchError) no match of right hand side value: nil
        (explorer 0.0.1) lib/explorer/smart_contract/reader.ex:353: Explorer.SmartContract.Reader.query_function/3
        (block_scout_web 0.0.1) lib/block_scout_web/controllers/smart_contract_controller.ex:95: BlockScoutWeb.SmartContractController.show/2
        (block_scout_web 0.0.1) lib/block_scout_web/controllers/smart_contract_controller.ex:1: BlockScoutWeb.SmartContractController.action/2
        (block_scout_web 0.0.1) lib/block_scout_web/controllers/smart_contract_controller.ex:1: BlockScoutWeb.SmartContractController.phoenix_controller_pipeline/2
        (phoenix 1.5.4) lib/phoenix/router.ex:352: Phoenix.Router.__call__/2
        (phoenix 1.5.4) lib/phoenix/router/route.ex:41: Phoenix.Router.Route.call/2
        (phoenix 1.5.4) lib/phoenix/router.ex:352: Phoenix.Router.__call__/2
        (block_scout_web 0.0.1) lib/block_scout_web/endpoint.ex:1: BlockScoutWeb.Endpoint.plug_builder_call/2
        (block_scout_web 0.0.1) lib/plug/debugger.ex:132: BlockScoutWeb.Endpoint."call (overridable 3)"/2
        (block_scout_web 0.0.1) lib/block_scout_web/endpoint.ex:1: BlockScoutWeb.Endpoint."call (overridable 4)"/2
        (block_scout_web 0.0.1) lib/spandex_phoenix.ex:156: BlockScoutWeb.Endpoint.call/2
        (phoenix 1.5.4) lib/phoenix/endpoint/cowboy2_handler.ex:65: Phoenix.Endpoint.Cowboy2Handler.init/4
        (cowboy 2.8.0) /Users/viktor/Documents/POANetwork/blockscout/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
        (cowboy 2.8.0) /Users/viktor/Documents/POANetwork/blockscout/deps/cowboy/src/cowboy_stream_h.erl:300: :cowboy_stream_h.execute/3
        (cowboy 2.8.0) /Users/viktor/Documents/POANetwork/blockscout/deps/cowboy/src/cowboy_stream_h.erl:291: :cowboy_stream_h.request_process/3
        (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Checklist for your Pull Request (PR)

@coveralls
Copy link

coveralls commented Nov 23, 2020

Pull Request Test Coverage Report for Build 7a72b121c5f502d3049383789de9bda744324ac2-PR-3477

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-1.3%) to 67.22%

Files with Coverage Reduction New Missed Lines %
lib/block_scout_web/controllers/chain/market_history_chart_controller.ex 1 78.57%
test/block_scout_web/features/pages/chain_page.ex 1 90.0%
Totals Coverage Status
Change from base Build 3c80a04821f31140121742a42a43f7c846767b7d: -1.3%
Covered Lines: 2067
Relevant Lines: 3075

💛 - Coveralls

@vbaranov vbaranov merged commit 335c424 into master Nov 23, 2020
@vbaranov vbaranov deleted the vb-fix-contract-interaction branch November 23, 2020 16:54
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.

2 participants