2
2
import json
3
3
import re
4
4
import subprocess
5
- import time
6
5
from pathlib import Path
7
6
8
7
import pytest
9
- from dateutil .parser import isoparse
10
8
from pystarport import ports
11
9
from pystarport .cluster import SUPERVISOR_CONFIG_FILE
12
10
13
11
from .network import Ethermint , setup_custom_ethermint
14
12
from .utils import (
15
13
ADDRS ,
16
14
CONTRACTS ,
15
+ approve_proposal ,
17
16
deploy_contract ,
18
- parse_events ,
19
17
send_transaction ,
20
18
wait_for_block ,
21
- wait_for_block_time ,
22
19
wait_for_port ,
23
20
)
24
21
@@ -94,7 +91,6 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint):
94
91
- it should work transparently
95
92
- check that queries on legacy blocks still works after upgrade.
96
93
"""
97
- time .sleep (6 )
98
94
cli = custom_ethermint .cosmos_cli ()
99
95
w3 = custom_ethermint .w3
100
96
contract , _ = deploy_contract (w3 , CONTRACTS ["TestERC20A" ])
@@ -108,7 +104,7 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint):
108
104
print ("upgrade height" , target_height )
109
105
110
106
plan_name = "integration-test-upgrade"
111
- rsp = cli .gov_propose (
107
+ rsp = cli .gov_propose_legacy (
112
108
"community" ,
113
109
"software-upgrade" ,
114
110
{
@@ -120,20 +116,7 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint):
120
116
},
121
117
)
122
118
assert rsp ["code" ] == 0 , rsp ["raw_log" ]
123
-
124
- # get proposal_id
125
- ev = parse_events (rsp ["logs" ])["submit_proposal" ]
126
- proposal_id = ev ["proposal_id" ]
127
-
128
- rsp = cli .gov_vote ("validator" , proposal_id , "yes" )
129
- assert rsp ["code" ] == 0 , rsp ["raw_log" ]
130
- # rsp = custom_ethermint.cosmos_cli(1).gov_vote("validator", proposal_id, "yes")
131
- # assert rsp["code"] == 0, rsp["raw_log"]
132
-
133
- proposal = cli .query_proposal (proposal_id )
134
- wait_for_block_time (cli , isoparse (proposal ["voting_end_time" ]))
135
- proposal = cli .query_proposal (proposal_id )
136
- assert proposal ["status" ] == "PROPOSAL_STATUS_PASSED" , proposal
119
+ approve_proposal (custom_ethermint , rsp )
137
120
138
121
# update cli chain binary
139
122
custom_ethermint .chain_binary = (
0 commit comments