Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

return empty list of uncles instead of nil when send eth.getBlock #335

Closed
ayeteng opened this issue Jun 18, 2020 · 0 comments · Fixed by #337
Closed

return empty list of uncles instead of nil when send eth.getBlock #335

ayeteng opened this issue Jun 18, 2020 · 0 comments · Fixed by #337
Assignees

Comments

@ayeteng
Copy link

ayeteng commented Jun 18, 2020

System info: [Include Ethermint commit, operating system name, and other relevant details]
#306 #333
Steps to reproduce:
My web3.py still get error when send the getBlock command because of nil returned in uncles.

raise type(exc)("Could not format value %r as field %r" % (item, key)) from exc

TypeError: Could not format value None as field 'uncles'

Expected behavior: [What you expected to happen]
Return [] instead of nil

Actual behavior: [What actually happened]

Additional info: [Include gist of relevant config, logs, etc.]
I did the modification of eth_api.go line 548 to
"uncles": [0]string{},
and it works. Not sure how to submit a PR. Can you help please?

My test code below:
https://gist.github.com/ayeteng/ca3df35d550c2a054ebc95f2ff013df0
https://gist.github.com/ayeteng/48bc63d5b7500f94901389b888912a7b

@noot noot self-assigned this Jun 18, 2020
@noot noot mentioned this issue Jun 18, 2020
11 tasks
@noot noot closed this as completed in #337 Jun 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants