-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: various: code clean up, refactoring #3580
Conversation
This heavy-weight refactoring sprang from an attempt of removing a duplicate PostProcessResponse() function located in client/keys/utils.go that turned out to be undoable without introducing import cycles. Thus I moved all x/ modules-agnostic HTTP/REST basic request and response types and convenience functions into a new cosmos-sdk/types/rest standalone package. The cosmos-sdk/client/rest package retains the txs handling functions that depend on CLIContext and TxBuilder provided by client/context and x/auth/client/txbuilder respectively.
Disallow empty denoms.
edd81ba
to
0d176a6
Compare
types/rest/rest.go
Outdated
} | ||
|
||
// UnjailReq request unjailing | ||
type UnjailReq struct { |
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.
Why is this here?
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.
I moved all requests into this package
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.
imho I don't think we should be doing this -- but I need to think on this some more after some coffee.
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.
Agree with @alexanderbez here. I think each client/rest
package should also have a types
that exports the structs to call the endpoints.
Codecov Report
@@ Coverage Diff @@
## develop #3580 +/- ##
===========================================
- Coverage 60.92% 60.82% -0.11%
===========================================
Files 188 189 +1
Lines 14084 14170 +86
===========================================
+ Hits 8581 8619 +38
- Misses 4959 5007 +48
Partials 544 544 |
Fails the linter at present. |
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.
Thanks @alessio. I left a few minor remarks. In addition, I don't think any of the coins stuff belongs here.
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.
It looks like types were just moved out of client/rest/types.go
to types/rest/rest.go
.
…smos-sdk into alessio/rest-types-refactoring
client/rest: code cleanup and refactoring.
This heavy-weight refactoring sprang from an attempt of removing a duplicate PostProcessResponse() function located in client/keys/utils.go that turned out to be undoable without introducing import cycles. Thus I moved all x/modules-agnostic HTTP/REST basic request and response types and convenience functions into a new cosmos-sdk/types/rest standalone package.
The cosmos-sdk/client/rest package retains the txs handling functions that depend on CLIContext and TxBuilder provided by client/context and x/auth/client/txbuilder respectively.
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: