-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
rpc: several fixes and support for optional arguments #2359
Conversation
Current coverage is
|
{`[null,"2"]`, []reflect.Type{reflect.TypeOf(new(int)), reflect.TypeOf(""), reflect.TypeOf(new(int))}, | ||
[]reflect.Value{reflect.ValueOf(new(int)), reflect.ValueOf("2"), reflect.ValueOf(new(int))}}, | ||
{`[null,"2",null]`, []reflect.Type{reflect.TypeOf(new(int)), reflect.TypeOf(""), reflect.TypeOf(new(int))}, | ||
[]reflect.Value{reflect.ValueOf(new(int)), reflect.ValueOf("2"), reflect.ValueOf(new(int))}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests would be more readable if you defined the types upfront, e.g.
var (
stringT = reflect.TypeOf("")
intT = reflect.TypeOf(0)
intPtrT = reflect.TypeOf(new(int))
)
....
[]reflect.Type{stringT, intT, intPtrT}
e9b5788
to
453c828
Compare
@fjl, added the extra types in the tests to improve readability. |
97c5c50
to
7f4414a
Compare
A general observation on this PR is that it contains almost no inline comments. Please specify some more comments on the code and what it does, this makes in easier to review and makes it easier for outsiders to understand the code. This is especially true for this part of the code since it's the most "visible" part of the client. Making it easier to understand for outsiders will only further encourage them to fix something if it's broken and send RPs. In general I believe we should strive for better inline documentation and descriptive code as this project gets more visibility. |
a80cb06
to
cddf6d0
Compare
cddf6d0
to
70f864f
Compare
rebased |
788800d
to
f95c6cb
Compare
passwd, _ = passwdExport.(string) | ||
|
||
// verify that if a second non null argument was given it was a string | ||
if call.Argument(1).IsDefined() && !call.Argument(1).IsNull() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could simply be else
. I think it's more readable than having to understand the conditions again. Also probably more future proof rather than having to maintain te exact negation of the previous if condition.
f95c6cb
to
91ce2b5
Compare
LGTM 👍 |
Contains a windows build failure:
|
rpc: be less restrictive on the request id rpc: improved documentation console: upgrade web3.js to version 0.16.0 rpc: cache http connections rpc: rename wsDomains parameter to wsOrigins
91ce2b5
to
aa9fff3
Compare
This seem to be a bug in goimports. Goimports removes |
This PR includes:
eth_call
accept null values for some of the arguments geth 1.4-unstable RPC returns error when receiving null properties #2319