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

politeiavoter: Migrate to new APIs. #1415

Merged
merged 8 commits into from
Jun 13, 2021
Merged

Conversation

amass01
Copy link
Member

@amass01 amass01 commented May 15, 2021

Closes #1394.

@amass01 amass01 marked this pull request as ready for review May 15, 2021 20:55
@amass01 amass01 changed the title [wip] politeiavoter: Migrate inventory to new APIs. politeiavoter: Migrate inventory to new APIs. May 15, 2021
politeiawww/cmd/politeiavoter/politeiavoter.go Outdated Show resolved Hide resolved
politeiawww/cmd/politeiavoter/politeiavoter.go Outdated Show resolved Hide resolved
politeiawww/cmd/politeiavoter/politeiavoter.go Outdated Show resolved Hide resolved
politeiawww/cmd/politeiavoter/politeiavoter.go Outdated Show resolved Hide resolved
politeiawww/cmd/politeiavoter/politeiavoter.go Outdated Show resolved Hide resolved
politeiawww/cmd/politeiavoter/politeiavoter.go Outdated Show resolved Hide resolved
Copy link
Member Author

@amass01 amass01 left a comment

Choose a reason for hiding this comment

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

_vote calls _summary which calls the old api to get proposal vote summary:

https://github.com/amassarwi/politeia/blob/pivoterinv/politeiawww/cmd/politeiavoter/politeiavoter.go#L972

I would like to change this one in this PR as well.

@amass01
Copy link
Member Author

amass01 commented May 17, 2021

Done, I've migrated the vote summaries call to call new API - see c104866, as result looks like all commands are now migrated and using the new APIs.

Edit: One last todo https://github.com/decred/politeia/pull/1415/files#diff-9378a7dcd7429979890a5291a4310bab03060eadaf93e97974450ec07b83bd75R1504 - verify commands calls the vote results route and now it needs to call version and get the server pub key before in order to verify the response.

@amass01 amass01 changed the title politeiavoter: Migrate inventory to new APIs. politeiavoter: Migrate to new APIs. May 17, 2021
politeiawww/client/ticketvote.go Outdated Show resolved Hide resolved
politeiawww/cmd/politeiavoter/politeiavoter.go Outdated Show resolved Hide resolved
politeiawww/cmd/politeiavoter/politeiavoter.go Outdated Show resolved Hide resolved
@amass01
Copy link
Member Author

amass01 commented May 17, 2021

@lukebp updated.

To test, I voted no on a proposal; I see the votes count when calling tally, but when calling verify I see 0 successful votes, shouldn't it be 4 in that case?

Update: Apparently for the verify to pick the success votes, man need to vote with the trickle mode on, in that case
the successful votes will be json logged to the vote data dir, only then the verify command would be able to pick the success votes json and verify then against the vote results.

@amass01
Copy link
Member Author

amass01 commented May 19, 2021

$ politeiavoter verify 96036609262e5051 --politeiawww "https://localhost:4443" --skipverify
== Checking vote 96036609262e5051
  Total votes       : 2
  Successful votes  : 2
  Unsuccessful votes: 0
== NO failed votes on proposal 96036609262e5051

Copy link
Member

@lukebp lukebp left a comment

Choose a reason for hiding this comment

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

Tested and everything is working as expected. Just need to fix a few nits.

politeiawww/client/ticketvote.go Outdated Show resolved Hide resolved
politeiawww/cmd/pictl/cmdvotetestsetup.go Outdated Show resolved Hide resolved
politeiawww/cmd/pictl/cmdvotetestsetup.go Outdated Show resolved Hide resolved
politeiawww/cmd/politeiavoter/politeiavoter.go Outdated Show resolved Hide resolved
@amass01
Copy link
Member Author

amass01 commented May 21, 2021

@lukebp Addressed.

politeiawww/client/ticketvote.go Outdated Show resolved Hide resolved
@amass01
Copy link
Member Author

amass01 commented May 22, 2021

@lukebp updated

Copy link
Member

@lukebp lukebp left a comment

Choose a reason for hiding this comment

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

tACK

@marcopeereboom will want to ok this.

@lukebp lukebp merged commit 0ecc9d7 into decred:master Jun 13, 2021
@amass01 amass01 deleted the pivoterinv branch June 14, 2021 23:28
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.

politeiavoter: Migrate to new APIs.
2 participants