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 logs list API endpoint response #3323

Merged
merged 1 commit into from
Oct 1, 2020
Merged

Conversation

vbaranov
Copy link
Member

@vbaranov vbaranov commented Sep 30, 2020

Motivation

  • The response of logs list api endpoint doesn't contain 0x prefix
  • blockNumber returns transactionIndex and vise-versa

Example:
https://blockscout.com/poa/xdai/api?module=logs&action=getLogs&fromBlock=11262794&toBlock=latest&address=0x481c034c6d9441db23Ea48De68BCAe812C5d39bA&topic0=0x3c798bbcf33115b42c728b8504cff11dd58736e9fa789f1cda2738db7d696b2a&topic1=0x00000000000000000000000050d967fd81ad09befb6ff11e8ac6062a3ce11eb1&topic0_1_opr=and

{"address":"0x481c034c6d9441db23ea48de68bcae812c5d39ba","blockNumber":"1","data":"0x00000000000000000000000000000000000000000000001f2bba5d84f99c0000","gasPrice":"0","gasUsed":"27D04","logIndex":"1","timeStamp":"5BBBA539","topics":["0x3c798bbcf33115b42c728b8504cff11dd58736e9fa789f1cda2738db7d696b2a","0x00000000000000000000000050d967fd81ad09befb6ff11e8ac6062a3ce11eb1","0x0000000000000000000000007301cfa0e1756b71869e93d4e4dca5c7d0eb0aa6",null],"transactionHash":"0x6505311fdb0b65530b4c80a7eb224f9b267a4099c5924e5b51a85ca7e8f756ca","transactionIndex":"BB22C4"},

Checklist for your Pull Request (PR)

@vbaranov vbaranov changed the title Fix logs api response Fix logs list API endpoint response Sep 30, 2020
@coveralls
Copy link

coveralls commented Sep 30, 2020

Pull Request Test Coverage Report for Build 984f499910b57569e90e11809cc6dca29915cf57-PR-3323

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 9 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+3.2%) to 74.482%

Files with Coverage Reduction New Missed Lines %
lib/block_scout_web/controllers/chain/market_history_chart_controller.ex 2 71.43%
lib/block_scout_web/notifier.ex 7 86.9%
Totals Coverage Status
Change from base Build 06405b78a7020ef76a767876267abd378227ad2f: 3.2%
Covered Lines: 1979
Relevant Lines: 2657

💛 - Coveralls

@vbaranov vbaranov force-pushed the vb-fix-logs-api-response branch 3 times, most recently from d000a3b to 9572403 Compare October 1, 2020 07:46
@vbaranov vbaranov merged commit acf84e4 into master Oct 1, 2020
@vbaranov vbaranov deleted the vb-fix-logs-api-response branch October 1, 2020 13:57
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