Skip to content

Commit

Permalink
Problem: update voting_period is not tested
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Oct 26, 2023
1 parent ae50e34 commit d10bca4
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
17 changes: 17 additions & 0 deletions integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,20 @@ def query_host_params(self):
**kwargs,
)
)

Check failure on line 188 in integration_tests/cosmoscli.py

View workflow job for this annotation

GitHub Actions / lint

./integration_tests/cosmoscli.py:188:1: BLK100 Black would make changes.

Check failure on line 188 in integration_tests/cosmoscli.py

View workflow job for this annotation

GitHub Actions / lint

./integration_tests/cosmoscli.py:188:1: W293 blank line contains whitespace
def query_gov_params(self):
kwargs = {
"node": self.node_rpc,
"output": "json",
}
return json.loads(
self.raw(
"q",
"gov",
"params",
**kwargs,
)
)


class ClusterCLI(cluster.ClusterCLI):
Expand Down Expand Up @@ -213,3 +227,6 @@ def sign_batch_multisig_tx(self, *args, i=0, **kwargs):

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

Check failure on line 230 in integration_tests/cosmoscli.py

View workflow job for this annotation

GitHub Actions / lint

./integration_tests/cosmoscli.py:230:1: W293 blank line contains whitespace
def query_gov_params(self, i=0):
return self.cosmos_cli(i).query_gov_params()
29 changes: 28 additions & 1 deletion integration_tests/test_gov.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def test_inherit_vote(cluster):

def test_host_enabled(cluster):
cli = cluster.cosmos_cli()
p = cluster.cosmos_cli().query_host_params()
p = cli.query_host_params()
assert p["host_enabled"]
rsp = cluster.gov_propose_legacy(
"community",
Expand All @@ -331,3 +331,30 @@ def test_host_enabled(cluster):
approve_proposal(cluster, rsp)
p = cli.query_host_params()
assert not p["host_enabled"]


def test_gov_voting(cluster):
cli = cluster.cosmos_cli()
p = cli.query_gov_params()
assert p["voting_params"]["voting_period"] == "10000000000"
print("mm-query_gov_params", p)
voting_period = "21600"
rsp = cluster.gov_propose_legacy(
"community",
"param-change",
{
"title": "Update gov voting",
"description": "ditto",
"changes": [
{
"subspace": "gov",
"key": "votingparams",
"value": { "voting_period": voting_period },

Check failure on line 352 in integration_tests/test_gov.py

View workflow job for this annotation

GitHub Actions / lint

./integration_tests/test_gov.py:352:31: BLK100 Black would make changes.

Check failure on line 352 in integration_tests/test_gov.py

View workflow job for this annotation

GitHub Actions / lint

./integration_tests/test_gov.py:352:31: E201 whitespace after '{'

Check failure on line 352 in integration_tests/test_gov.py

View workflow job for this annotation

GitHub Actions / lint

./integration_tests/test_gov.py:352:62: E202 whitespace before '}'
}
],
},
)
assert rsp["code"] == 0, rsp["raw_log"]
approve_proposal(cluster, rsp)
p = cli.query_gov_params()
assert p["voting_params"]["voting_period"] == voting_period

0 comments on commit d10bca4

Please sign in to comment.