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

Problem: update voting_period is not tested #1017

Merged
merged 6 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,4 @@
return self.cosmos_cli(i).query_host_params()

def query_params(self, mod, i=0):
return self.cosmos_cli(i).query_params(mod)
return self.cosmos_cli(i).query_params(mod)

Check failure on line 373 in integration_tests/cosmoscli.py

View workflow job for this annotation

GitHub Actions / lint

./integration_tests/cosmoscli.py:373:52: W292 no newline at end of file
yihuang marked this conversation as resolved.
Show resolved Hide resolved
34 changes: 33 additions & 1 deletion integration_tests/test_gov.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@

def test_host_enabled(cluster, tmp_path):
cli = cluster.cosmos_cli()
p = cluster.cosmos_cli().query_host_params()
p = cli.query_host_params()
assert p["host_enabled"]
p["host_enabled"] = False
proposal = tmp_path / "proposal.json"
Expand All @@ -247,3 +247,35 @@
approve_proposal(cluster, rsp, msg=msg)
p = cli.query_host_params()
assert not p["host_enabled"]


def test_gov_voting(cluster):
"""
- change voting_period from default 10s to 216s
"""
cli = cluster.cosmos_cli()

def assert_voting_period(voting_period_in_ns):
p = cli.query_gov_params()
yihuang marked this conversation as resolved.
Show resolved Hide resolved
assert p["voting_params"]["voting_period"] == voting_period_in_ns

assert_voting_period("10000000000")

Check failure on line 262 in integration_tests/test_gov.py

View workflow job for this annotation

GitHub Actions / test-gov

test_gov_voting AttributeError: 'CosmosCLI' object has no attribute 'query_gov_params'
voting_period_in_ns = "216000000000"
rsp = cluster.gov_propose_legacy(
"community",
"param-change",
{
"title": "Update gov voting",
"description": "ditto",
"changes": [
{
"subspace": "gov",
"key": "votingparams",
"value": {"voting_period": voting_period_in_ns},
}
],
},
)
assert rsp["code"] == 0, rsp["raw_log"]
approve_proposal(cluster, rsp)
assert_voting_period(voting_period_in_ns)
Loading