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

R4R: Expose LCD router, allowing devs to register custom routes from their modules #2836

Merged
merged 5 commits into from
Nov 16, 2018

Conversation

jackzampolin
Copy link
Member

Fixes #1081

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes req'd, generally looks fine.

@@ -13,9 +14,10 @@ import (

"github.com/cosmos/cosmos-sdk/client"

"net/http"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should go above the SDK import two lines above (minor).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackzampolin just run goimports 🙏

rs.log.Error("error closing listener", "err", err)
})

var cleanupFunc func()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we define this here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️ Thats the way it looked when I found it. I'll remove it!

return err
}

cleanupFunc = func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... seems like we could just define it here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol. yes 👍

cmd/gaia/cmd/gaiacli/main.go Outdated Show resolved Hide resolved
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jackzampolin! Glad you got this working. Left a few remarks in addition to the points @cwgoes made ⚡️

@@ -13,9 +14,10 @@ import (

"github.com/cosmos/cosmos-sdk/client"

"net/http"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackzampolin just run goimports 🙏


cliCtx := context.NewCLIContext().WithCodec(cdc)
// Start starts the rest server
func (rs RestServer) Start(listenAddr string, sslHosts string, certFile string, keyFile string, maxOpen int, insecure bool) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long function signature. Let's break it up on multi-line.

return err
}

cleanupFunc = func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol. yes 👍

// (aka Light Client Daemon) that exposes functionality similar
// to the cli, but over rest
func (rs RestServer) ServeCommand() *cobra.Command {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the extra line (I've noticed people doing this and I'm not sure why (it makes sense for multi-line function signatures though)?

@cwgoes
Copy link
Contributor

cwgoes commented Nov 16, 2018

@jackzampolin Looks like the build fails now.

@cwgoes
Copy link
Contributor

cwgoes commented Nov 16, 2018

Changes LGTM

@cwgoes
Copy link
Contributor

cwgoes commented Nov 16, 2018

test_cover is still failing though, restarted CI.

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates/fixes look good, but it's failing test_cover?

@jackzampolin
Copy link
Member Author

Issue was that the right keybase wasn't getting picked up in the LCD tests. I've fixed the tests so that the right keybase is getting passed in at the right time. Tests are passing!

@jackzampolin
Copy link
Member Author

Going to merge this once it's passing tests.

@jackzampolin jackzampolin dismissed alexanderbez’s stale review November 16, 2018 22:21

Addressed concerns and tests are passing. The last comment is an ACK

@jackzampolin jackzampolin merged commit 9676ce7 into develop Nov 16, 2018
@jackzampolin jackzampolin deleted the jack/expose-lcd branch November 16, 2018 22:21
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.

3 participants