|
2 | 2 | let
|
3 | 3 | unionvisorBin = pkgs.lib.meta.getExe unionvisor;
|
4 | 4 |
|
5 |
| - # mkUpgradeProposal = version: height: pkgs.runCommand "upgrade-proposal" { } '' |
6 |
| - # mkdir -p $out |
7 |
| - # echo '{ |
8 |
| - # "messages": [ |
9 |
| - # { |
10 |
| - # "@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", |
11 |
| - # "authority": "union10d07y265gmmuvt4z0w9aw880jnsr700js4jdcz", |
12 |
| - # "plan": { |
13 |
| - # "name": "${version}", |
14 |
| - # "height": "${toString height}", |
15 |
| - # "info": "${version}" |
16 |
| - # } |
17 |
| - # } |
18 |
| - # ], |
19 |
| - # "deposit": "15000000stake", |
20 |
| - # "title": "${version}", |
21 |
| - # "summary": "Upgrade to ${version}" |
22 |
| - # }' > proposal-${version}.json |
23 |
| - # mv proposal-${version}.json $out |
24 |
| - # ''; |
| 5 | + mkUpgradeProposal = version: height: pkgs.runCommand "upgrade-proposal" { } '' |
| 6 | + mkdir -p $out |
| 7 | + echo '{ |
| 8 | + "messages": [ |
| 9 | + { |
| 10 | + "@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", |
| 11 | + "authority": "union10d07y265gmmuvt4z0w9aw880jnsr700js4jdcz", |
| 12 | + "plan": { |
| 13 | + "name": "${version}", |
| 14 | + "height": "${toString height}", |
| 15 | + "info": "${version}" |
| 16 | + } |
| 17 | + } |
| 18 | + ], |
| 19 | + "deposit": "15000000stake", |
| 20 | + "title": "${version}", |
| 21 | + "summary": "Upgrade to ${version}" |
| 22 | + }' > proposal-${version}.json |
| 23 | + mv proposal-${version}.json $out |
| 24 | + ''; |
25 | 25 |
|
26 | 26 | forEachNode = f: ''
|
27 | 27 | ${f "0"}
|
|
30 | 30 | ${f "3"}
|
31 | 31 | '';
|
32 | 32 |
|
33 |
| - # upgradeTo = version: height: '' |
34 |
| - # union.succeed('docker cp ${mkUpgradeProposal version height}/proposal-${version}.json devnet-minimal-uniond-0-1:/proposal-${version}.json') |
35 |
| - # print(union.succeed('docker exec devnet-minimal-uniond-0-1 ${unionvisorBin} --root . call --bundle /bundle -- tx gov submit-proposal proposal-${version}.json --from val-0 --keyring-backend test --home ./home -y --gas 3000000000')) |
| 33 | + upgradeTo = version: height: '' |
| 34 | + union.succeed('docker cp ${mkUpgradeProposal version height}/proposal-${version}.json devnet-minimal-uniond-0-1:/proposal-${version}.json') |
| 35 | + print(union.succeed('docker exec devnet-minimal-uniond-0-1 ${unionvisorBin} --root . call --bundle /bundle -- tx gov submit-proposal proposal-${version}.json --from val-0 --keyring-backend test --home ./home -y --gas 3000000000')) |
36 | 36 |
|
37 |
| - # time.sleep(6) |
| 37 | + time.sleep(6) |
38 | 38 |
|
39 |
| - # union.wait_until_succeeds("[[ $(docker exec devnet-minimal-uniond-0-1 ${unionvisorBin} -l off --root . call --bundle /bundle -- query gov proposal ${toString (height / 10)} --home ./home --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.status == \"PROPOSAL_STATUS_VOTING_PERIOD\"') == true ]]", timeout=30) |
| 39 | + union.wait_until_succeeds("[[ $(docker exec devnet-minimal-uniond-0-1 ${unionvisorBin} -l off --root . call --bundle /bundle -- query gov proposal ${toString (height / 10)} --home ./home --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.status == \"PROPOSAL_STATUS_VOTING_PERIOD\"') == true ]]", timeout=30) |
40 | 40 |
|
41 |
| - # ${forEachNode (id: "print(union.succeed('docker exec devnet-minimal-uniond-${id}-1 ${unionvisorBin} --root . call --bundle /bundle -- tx gov vote ${toString (height / 10)} yes --keyring-backend test --from val-${id} --home ./home -y'))")} |
| 41 | + ${forEachNode (id: "print(union.succeed('docker exec devnet-minimal-uniond-${id}-1 ${unionvisorBin} --root . call --bundle /bundle -- tx gov vote ${toString (height / 10)} yes --keyring-backend test --from val-${id} --home ./home -y'))")} |
42 | 42 |
|
43 |
| - # union.wait_until_succeeds("[[ $(docker exec devnet-minimal-uniond-0-1 ${unionvisorBin} -l off --root . call --bundle /bundle -- query gov proposal ${toString (height / 10)} --home ./home --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.status == \"PROPOSAL_STATUS_PASSED\"') == true ]]", timeout=30) |
| 43 | + union.wait_until_succeeds("[[ $(docker exec devnet-minimal-uniond-0-1 ${unionvisorBin} -l off --root . call --bundle /bundle -- query gov proposal ${toString (height / 10)} --home ./home --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.status == \"PROPOSAL_STATUS_PASSED\"') == true ]]", timeout=30) |
44 | 44 |
|
45 |
| - # union.wait_until_succeeds('[[ $(curl "http://localhost:26660/block" --fail --silent | ${pkgs.lib.meta.getExe pkgs.jq} ".result.block.header.height | tonumber > ${toString height}") == "true" ]]') |
46 |
| - # ''; |
| 45 | + union.wait_until_succeeds('[[ $(curl "http://localhost:26660/block" --fail --silent | ${pkgs.lib.meta.getExe pkgs.jq} ".result.block.header.height | tonumber > ${toString height}") == "true" ]]') |
| 46 | + ''; |
47 | 47 | in
|
48 | 48 | {
|
49 | 49 | upgrade-from-genesis = e2e.mkTest {
|
|
56 | 56 |
|
57 | 57 | # Ensure the union network commits more than one block
|
58 | 58 | union.wait_until_succeeds('[[ $(curl "http://localhost:26660/block" --fail --silent | ${pkgs.lib.meta.getExe pkgs.jq} ".result.block.header.height | tonumber > 1") == "true" ]]')
|
| 59 | +
|
| 60 | + ${upgradeTo "v0.20.0" 10} |
59 | 61 | '';
|
60 | 62 |
|
61 | 63 | nodes = {
|
|
78 | 80 | union.succeed("docker exec devnet-minimal-uniond-0-1 ${unionvisorBin} --root . call --bundle /bundle -- tx tokenfactory create-denom bazinga --from val-0 --keyring-backend test --home ./home -y --gas 3000000000")
|
79 | 81 | time.sleep(6)
|
80 | 82 | union.succeed("[[ $(docker exec devnet-minimal-uniond-0-1 ${unionvisorBin} -l off --root . call --bundle /bundle -- query tokenfactory denom-authority-metadata factory/union14fldwd959h7glh2e3k45veuqfszvgm69q07jhw/bazinga --home ./home --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.authority_metadata.admin == \"union14fldwd959h7glh2e3k45veuqfszvgm69q07jhw\"') == true ]]")
|
| 83 | +
|
| 84 | + ${upgradeTo "v0.20.0" 10} |
| 85 | + union.succeed("[[ $(docker exec devnet-minimal-uniond-0-1 ${unionvisorBin} -l off --root . call --bundle /bundle -- query tokenfactory denom-authority-metadata factory/union14fldwd959h7glh2e3k45veuqfszvgm69q07jhw/bazinga --home ./home --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.authority_metadata.admin == \"union14fldwd959h7glh2e3k45veuqfszvgm69q07jhw\"') == true ]]") |
81 | 86 | '';
|
82 | 87 |
|
83 | 88 | nodes = {
|
|
0 commit comments