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: split POST delegations endpoint #2997

Merged
merged 17 commits into from
Dec 11, 2018

Conversation

fedekunze
Copy link
Collaborator

@fedekunze fedekunze commented Dec 4, 2018

Closes #2191


  • Targeted PR against correct branch (see CONTRIBUTING.md)

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.

  • Wrote tests

  • Updated relevant documentation (docs/)

  • Added entries in PENDING.md with issue #

  • rereviewed Files changed in the github PR explorer


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented Dec 4, 2018

Codecov Report

Merging #2997 into develop will decrease coverage by 0.03%.
The diff coverage is 66.66%.

@@             Coverage Diff             @@
##           develop    #2997      +/-   ##
===========================================
- Coverage    52.17%   52.14%   -0.04%     
===========================================
  Files          136      136              
  Lines         9619     9612       -7     
===========================================
- Hits          5019     5012       -7     
- Misses        4263     4264       +1     
+ Partials       337      336       -1

@fedekunze fedekunze added ready-for-review T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). and removed wip labels Dec 5, 2018
@fedekunze fedekunze changed the title WIP: split POST delegations endpoint R4R: split POST delegations endpoint Dec 5, 2018
Copy link
Member

@jackzampolin jackzampolin left a comment

Choose a reason for hiding this comment

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

A couple of comments, and a request for more test coverage.

client/lcd/lcd_test.go Show resolved Hide resolved
PENDING.md Show resolved Hide resolved
client/lcd/swagger-ui/swagger.yaml Show resolved Hide resolved

i++
}
func postRedelegationsHandlerFn(cdc *codec.Codec, kb keys.Keybase, cliCtx context.CLIContext) http.HandlerFunc {

This comment was marked as resolved.


txBldr = newBldr
}
func postUnbondingDelegationsHandlerFn(cdc *codec.Codec, kb keys.Keybase, cliCtx context.CLIContext) http.HandlerFunc {

This comment was marked as resolved.

Copy link
Member

@jackzampolin jackzampolin left a comment

Choose a reason for hiding this comment

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

Thanks of fixing that! Looks good otherwise!

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.

I don't understand the PUT / POST distinction (but probably that's just me).

Otherwise tested ACK.

PENDING.md 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.

Did a partial review and left some comments. I just want to make sure we support simulation and generation only.

x/stake/client/rest/tx.go Outdated Show resolved Hide resolved
x/stake/client/rest/tx.go Outdated Show resolved Hide resolved
x/stake/client/rest/tx.go Show resolved Hide resolved
@fedekunze fedekunze dismissed alexanderbez’s stale review December 7, 2018 11:23

Addressed. See comment for support simulation and generation only txs above

@alexanderbez
Copy link
Contributor

Willing to give this an approval pending once generate_only and sim is confirmed working 👍

@jackzampolin
Copy link
Member

Maybe we add tests for those cases @alexanderbez mentioned

@fedekunze
Copy link
Collaborator Author

@alexanderbez updated the PR to test the generate_only

return nil
genOnlyStr := r.FormValue("generate_only")
if len(genOnlyStr) > 0 {
cliCtx.GenerateOnly, err = strconv.ParseBool(genOnlyStr)
Copy link
Collaborator Author

@fedekunze fedekunze Dec 10, 2018

Choose a reason for hiding this comment

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

previously we only checked if the generate_only had a value, not that it was actually true or false.
I think this is also the case for simulate. @alessio can you address that on #3056 as well ?


simulateGas, gas, err := client.ReadGasFlag(baseReq.Gas)
cliCtx, err := utils.ReadRESTReq(w, r, cdc, cliCtx, &req)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ughhh, CLIContext has really evolved. I think we should consider renaming it. Maybe ClientContext?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh I always thought it was Command Line Interface Context lol

Copy link
Contributor

Choose a reason for hiding this comment

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

It is! I just think it's more appropriate to call it a ClientContext at this point (e.g. look how it's being used here).

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.

Changes LGTM -- thanks @fedekunze!

@fedekunze
Copy link
Collaborator Author

fedekunze commented Dec 10, 2018

this is going to have conflicting changes with #3060. cc: @alessio

Copy link
Member

@jackzampolin jackzampolin left a comment

Choose a reason for hiding this comment

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

Going to get this in once the 0.28 release PRs are merged

@jackzampolin
Copy link
Member

@fedekunze can you resolve the merge conflicts here?

@fedekunze
Copy link
Collaborator Author

updated, please review again

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.

Tested ACK

@cwgoes cwgoes merged commit 4ecbf0d into develop Dec 11, 2018
@cwgoes cwgoes deleted the fedekunze/2191-split-post-delegations branch December 11, 2018 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants