diff --git a/integration_tests/utils.py b/integration_tests/utils.py index 8317c8944c..869af6d9b0 100644 --- a/integration_tests/utils.py +++ b/integration_tests/utils.py @@ -139,21 +139,22 @@ def wait_for_block_time(cli, t): time.sleep(0.5) -def approve_proposal(n, rsp, event_query_tx=False): +def approve_proposal(n, rsp): cli = n.cosmos_cli() - def cb(attrs): - return "proposal_id" in attrs - - ev = find_log_event_attrs(rsp["events"], "submit_proposal", cb) # get proposal_id + ev = find_log_event_attrs( + rsp["events"], "submit_proposal", lambda attrs: "proposal_id" in attrs + ) proposal_id = ev["proposal_id"] for i in range(len(n.config["validators"])): - rsp = n.cosmos_cli(i).gov_vote("validator", proposal_id, "yes", event_query_tx) + rsp = n.cosmos_cli(i).gov_vote("validator", proposal_id, "yes", gas=100000) assert rsp["code"] == 0, rsp["raw_log"] wait_for_new_blocks(cli, 1) + res = cli.query_tally(proposal_id) + res = res.get("tally") or res assert ( - int(cli.query_tally(proposal_id)["yes_count"]) == cli.staking_pool() + int(res["yes_count"]) == cli.staking_pool() ), "all validators should have voted yes" print("wait for proposal to be activated") proposal = cli.query_proposal(proposal_id)