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 reward value of a block in the tile and overview section. #1249

Merged
merged 3 commits into from
Dec 19, 2018

Conversation

amandasposito
Copy link
Contributor

@amandasposito amandasposito commented Dec 18, 2018

Resolves #23

Motivation

Displays the reward value in the block tile at the home page, block details page and the address block validated page.

In the tile shows the combined reward value, and at the block details page shows the reward value detail.

screen shot 2018-12-19 at 12 13 47

screen shot 2018-12-19 at 12 12 41

screen shot 2018-12-19 at 12 12 33

Changelog

Bug Fixes

  • Add :dev dependency to plug_cowboy at the explorer, so iex can start.

@coveralls
Copy link

coveralls commented Dec 18, 2018

Pull Request Test Coverage Report for Build ec16521a-ce23-4f65-9787-cd1aaad13d29

  • 10 of 13 (76.92%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.008%) to 86.176%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/block_scout_web/lib/block_scout_web/views/block_view.ex 1 4 25.0%
Totals Coverage Status
Change from base Build 41756a85-718a-4976-82f6-71c475aab948: -0.008%
Covered Lines: 3734
Relevant Lines: 4333

💛 - Coveralls

<dl class="row">
<dt class="col-sm-5 text-muted"><%= gettext "Gas Fee" %></dt>
<dt class="col-sm-7">
<%= @gas_fee %>

This comment was marked as resolved.

This comment was marked as resolved.

def show_reward?(_), do: true

def formatted_reward(block_reward) do
{:ok, decimal} = Wei.dump(block_reward.reward)

This comment was marked as resolved.


<%= if show_reward?(@validator_reward) do %>
<dl class="row">
<dt class="col-sm-5 text-muted"><%= gettext "Validator Reward" %></dt>

This comment was marked as resolved.

@@ -612,4 +612,11 @@ defmodule Explorer.Chain.Transaction do
limit: 1
)
end

def block_hash_to_transactions(block_hash) do

This comment was marked as resolved.

This comment was marked as resolved.

<%= if show_reward?(@block.rewards) do %>
<dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Gas Used" %></dt>
<dt class="col-sm-9">

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

@amandasposito amandasposito force-pushed the ams-reward-value-in-tile branch 5 times, most recently from ec08364 to 77864d6 Compare December 18, 2018 19:09
@acravenho
Copy link
Contributor

The layout is looking good but I don't think we're including the gas fee in the calculation. Here is an example:

Chain: POA Core
Block number: 6314183
Number of transactions: 2
Miner Reward displayed: 1 POA (should be 1.000042 POA)
Gas Fee: 42,000
DB Record Shows: 1.000042e+18

screen shot 2018-12-18 at 3 39 19 pm

screen shot 2018-12-18 at 3 39 34 pm

@amandasposito amandasposito force-pushed the ams-reward-value-in-tile branch 2 times, most recently from 01f6dce to dbc14d5 Compare December 19, 2018 14:16
@amandasposito
Copy link
Contributor Author

@acravenho I pushed some new changes with this fixed.

@acravenho
Copy link
Contributor

Tested Ethereum Mainnet and POA Core. Looks great 👍

@amandasposito amandasposito merged commit f0bde6a into master Dec 19, 2018
@ghost ghost removed the in progress label Dec 19, 2018
@amandasposito amandasposito deleted the ams-reward-value-in-tile branch December 19, 2018 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review This PR is ready for reviews.
Projects
Developers Section
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

6 participants