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

async fetching of address counters #2787

Merged
merged 17 commits into from
Nov 1, 2019
Merged

Conversation

ayrat555
Copy link
Contributor

Changelog

  • async fetching of address counters

@coveralls
Copy link

coveralls commented Oct 18, 2019

Pull Request Test Coverage Report for Build 420b0519-6ff0-4067-bd77-e560989dd3d9

  • 17 of 19 (89.47%) changed or added relevant lines in 6 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.06%) to 76.479%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/block_scout_web/lib/block_scout_web/controllers/address_controller.ex 12 14 85.71%
Files with Coverage Reduction New Missed Lines %
apps/block_scout_web/lib/block_scout_web/controllers/address_validation_controller.ex 1 0.0%
Totals Coverage Status
Change from base Build 8c383070-0743-43e0-ad27-f67dc31e16af: 0.06%
Covered Lines: 5300
Relevant Lines: 6930

💛 - Coveralls

@ayrat555 ayrat555 marked this pull request as ready for review October 21, 2019 07:30
render(
conn,
"index.html",
address: address,
coin_balance_status: CoinBalanceOnDemand.trigger_fetch(address),
exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(),
transaction_count: transaction_count,
validation_count: validation_count
counters_path: address_path(conn, :address_counters, %{"id" => to_string(address_hash)})
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't to_string(address_hash) the same as the input address_hash_string?

If I counted correctly the same is valid in 9 other places

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you're right. I changed it

Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

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

@ayrat555 after a long wait on the page of one of the validators.

/address/0x829bd824b016326a401d083b33d092293333a830/transactions

Screenshot 2019-10-23 at 18 43 51

Actually, it has a lot of blocks validations and transactions

@ayrat555
Copy link
Contributor Author

@vbaranov this thing happens because the async request for counters took too long. The values will be correct when the request finishes

@ayrat555
Copy link
Contributor Author

@vbaranov I added the required flag e45d1f8

@vbaranov
Copy link
Member

@ayrat555 please resolve merging conflicts

@ayrat555
Copy link
Contributor Author

@vbaranov done

@vbaranov vbaranov self-requested a review October 30, 2019 09:30
Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

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

@ayrat555 approved

I slightly modified PR by removing unnecessary padding when tx count is not retrieved yet

Before:
Screenshot 2019-10-30 at 12 25 40

After:
Screenshot 2019-10-30 at 12 24 54

Please do not remove this branch if you will merge this PR.

@vbaranov vbaranov merged commit 6592416 into master Nov 1, 2019
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