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: x/gov Get Vote(s)/Deposit(s) Updates #3091

Merged
merged 26 commits into from
Dec 14, 2018

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Dec 12, 2018

  • Fix broken proposal ID tags. It was being amino encoded before which did not allow for querying.
  • Add Action tag to voting and deposit handlers
  • Exposed tx searching function (SearchTxs)

closes: #2879
closes: #2880

/cc @johnmcdowall


  • 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)

@alexanderbez alexanderbez reopened this Dec 12, 2018
@codecov
Copy link

codecov bot commented Dec 12, 2018

Codecov Report

Merging #3091 into develop will decrease coverage by <.01%.
The diff coverage is 43.75%.

@@             Coverage Diff             @@
##           develop    #3091      +/-   ##
===========================================
- Coverage    54.31%   54.31%   -0.01%     
===========================================
  Files          136      136              
  Lines        10210    10212       +2     
===========================================
+ Hits          5546     5547       +1     
- Misses        4326     4327       +1     
  Partials       338      338

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.

This looks GREAT and lots to like on the implementation here. The one thing I would request is to expand the governance LCD tests to test these cases (once a proposal passes, does the data come back properly for votes and deposits). Is that possible?

@alexanderbez
Copy link
Contributor Author

alexanderbez commented Dec 13, 2018

@jackzampolin unfortunately I do not have any direct or good way of testing this. Our LCD tests are pretty rigid in that they all use the same InitializeTestLCD. I've tried modifying params but to no avail.

Feel free to take a stab at it?

@jackzampolin
Copy link
Member

Ok added an issue to track that: #3094. This PR gets a 👍 from me now

Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

Awesome ! Some comments and then we should be ok for merging

PENDING.md Outdated Show resolved Hide resolved
PENDING.md Outdated Show resolved Hide resolved
x/gov/client/cli/query.go Show resolved Hide resolved
x/gov/client/cli/query.go Outdated Show resolved Hide resolved
x/gov/client/rest/rest.go Show resolved Hide resolved
x/gov/tags/tags.go Outdated Show resolved Hide resolved
@alexanderbez
Copy link
Contributor Author

@fedekunze addressed your comments.

cdc.UnmarshalJSON(res, &deposit)

if deposit.Empty() {
res, err = gcutils.QueryDepositByTxQuery(cdc, cliCtx, params)
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't we get the proposal and query the deposit tx if it's not on deposit or voting period ? I mean, shouldn't we have an if...else around res, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/deposit", queryRoute)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm I dont think so. I think its implicit. Deposit will be empty in the case where its not voting or deposit period, no?

@alexanderbez
Copy link
Contributor Author

Responded @fedekunze

Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

ACK. Thanks @alexanderbez !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants