From 7e38684d2a40846516e4701b35178d3530d2d1e1 Mon Sep 17 00:00:00 2001 From: pasqu4le Date: Wed, 3 Jul 2019 17:46:29 +0200 Subject: [PATCH] Add eth_get_balance.json to AddressView render Problem: the eth_get_balance endpoint fails returning a 500 error when the URL is correct. Solution: turns out a clause for render eth_get_balance.json went missing (probably during a rebase) and so it was enough to rewrite it. --- CHANGELOG.md | 1 + .../lib/block_scout_web/views/api/rpc/address_view.ex | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59f05eab72..ec2b1c0fdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - [#2266](https://github.com/poanetwork/blockscout/pull/2266) - allow excluding uncles from average block time calculation ### Fixes +- [#2290](https://github.com/poanetwork/blockscout/pull/2290) - Add eth_get_balance.json to AddressView's render - [#2284](https://github.com/poanetwork/blockscout/pull/2284) - add 404 status for not existing pages - [#2244](https://github.com/poanetwork/blockscout/pull/2244) - fix internal transactions failing to be indexed because of constraint - [#2281](https://github.com/poanetwork/blockscout/pull/2281) - typo issues, dropdown issues diff --git a/apps/block_scout_web/lib/block_scout_web/views/api/rpc/address_view.ex b/apps/block_scout_web/lib/block_scout_web/views/api/rpc/address_view.ex index 248dc942c7..01f54dd46d 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/api/rpc/address_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/api/rpc/address_view.ex @@ -51,6 +51,10 @@ defmodule BlockScoutWeb.API.RPC.AddressView do RPCView.render("show.json", data: data) end + def render("eth_get_balance.json", %{balance: balance}) do + EthRPCView.render("show.json", %{result: balance, id: 0}) + end + def render("eth_get_balance_error.json", %{error: message}) do EthRPCView.render("error.json", %{error: message, id: 0}) end