-
Notifications
You must be signed in to change notification settings - Fork 516
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
Optional net_peerCount
response format
#377
Optional net_peerCount
response format
#377
Conversation
@sorpaas Since we've gone back and forth on the return type for this, what do you think about this solution? We're hoping to put out a new moonbeam release soon and would love to be as close to |
The PR looks fine, but honestly I think if Ethereum dapps expect different types themselves, then that's not really much we can do. We just have to make sure by default we follow Geth's type definition. |
Yeah, I will re-open tomorrow, we realized was missing |
* Optional `net_peerCount` response format * Prettify Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com> * More fixes * Set hex format as default * Serialize untagged * Add test for NetApi Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
There are inconsistencies on the response format expected when calling
net_peerCount
. Some tools/dapps expect decimal format, others hex.This PR adds a bool
peer_count_as_hex
parameter toNetApi
, so projects instantiating the handler at service level can decide which format to use. Defaulted tofalse
in the template.