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.
I moved all requests into this package
There was a problem hiding this comment.
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.
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. |
alexanderbez
left a comment
There was a problem hiding this comment.
Thanks @alessio. I left a few minor remarks. In addition, I don't think any of the coins stuff belongs here.
alexanderbez
left a comment
There was a problem hiding this comment.
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.mdwith issue #Files changedin the github PR explorerFor Admin Use: