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

rpc: several fixes and support for optional arguments #2359

Merged
merged 1 commit into from
Apr 12, 2016

Conversation

bas-vk
Copy link
Member

@bas-vk bas-vk commented Mar 17, 2016

This PR includes:

@robotally
Copy link

Vote Count Reviewers
👍 1 @karalabe
👎 0
Reaction Users
:28: @obscuren
:34: @obscuren

Updated: Tue Apr 12 12:03:46 UTC 2016

@codecov-io
Copy link

Current coverage is 50.88%

Merging #2359 into develop will decrease coverage by -0.03% as of 0c5d283

Powered by Codecov. Updated on successful CI builds.

{`[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))}},
Copy link
Contributor

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}

@bas-vk
Copy link
Member Author

bas-vk commented Mar 18, 2016

@fjl, added the extra types in the tests to improve readability.

@obscuren
Copy link
Contributor

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.

@bas-vk
Copy link
Member Author

bas-vk commented Apr 4, 2016

rebased

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() {
Copy link
Member

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.

@karalabe
Copy link
Member

LGTM 👍

@obscuren
Copy link
Contributor

Contains a windows build failure:

..\go\src\github.com\ethereum\go-ethereum\rpc\ipc_windows.go:28: undefined: winio in winio.ListenPipe
..\go\src\github.com\ethereum\go-ethereum\rpc\ipc_windows.go:28: undefined: winio in winio.PipeConfig
..\go\src\github.com\ethereum\go-ethereum\rpc\ipc_windows.go:34: undefined: winio in winio.DialPipe

@karalabe
Copy link
Member

@obscuren @bas-vk Probably needs a rebase. @fjl added the winio thing which was merged last week. Probably it's some strange merge issue or whatnot. Lets rebase and see if it solves it.

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
@bas-vk
Copy link
Member Author

bas-vk commented Apr 12, 2016

This seem to be a bug in goimports. Goimports removes "github.com/microsoft/go-winio" from the import list which was run after the rebase (on linux). Solution is to import winio "github.com/microsoft/go-winio". Goimports is then able to figure out that this package is used and won't remove it from the import list.

@obscuren obscuren merged commit 8627680 into ethereum:develop Apr 12, 2016
@obscuren obscuren removed the review label Apr 12, 2016
@obscuren
Copy link
Contributor

@fjl please update your PR instead.

@bas-vk bas-vk deleted the rpc-optional-args branch April 14, 2016 15:29
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Apr 17, 2024
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

6 participants