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

Display aggregate vote stats in listgovproposalvotes #1714

Merged
merged 15 commits into from
Feb 7, 2023
Prev Previous commit
Next Next commit
Refactor tests
  • Loading branch information
shohamc1 committed Feb 2, 2023
commit bc55adae6f8fcd7446901dcb99419ca371319ded
12 changes: 8 additions & 4 deletions test/functional/feature_on_chain_government.py
Original file line number Diff line number Diff line change
@@ -683,7 +683,14 @@ def run_test(self):
assert_equal(self.nodes[0].listgovproposals(
{"status": "voting", "pagination": {"start": tx1, "including_start": False, "limit": 1}}), nextProposal)

# test listgovproposalvotes aggregation
self.test_aggregation(propId)
self.test_default_cycles_fix()
self.aggregate_all_votes()

def test_aggregation(self, propId):
"""
Tests vote aggregation for a specific proposal. It should respect all provided filters.
"""
votes = self.nodes[0].listgovproposalvotes(propId, 'all', -1, {})
totalVotes = len(votes)
yesVotes = len([x for x in votes if x["vote"] == "YES"])
@@ -699,9 +706,6 @@ def run_test(self):
assert_equal(votes_aggregate["no"], noVotes)
assert_equal(votes_aggregate["unknown"], unknownVotes)

self.test_default_cycles_fix()
self.aggregate_all_votes()

def test_default_cycles_fix(self):
"""
Tests fix for an issue for when the cycles argument is not provided, the