Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gzukel committed Sep 20, 2023
1 parent d65c460 commit c863c40
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/actions/upgrade-testing/scripts/raise_gov_proposal.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import requests
import json
import hashlib
import bech32

os.environ['NODE'] = "http://127.0.0.1:26657"
CURRENT_HEIGHT = requests.get(f"{os.environ['NODE']}/status").json()["result"]["sync_info"]["latest_block_height"]
Expand All @@ -10,11 +12,18 @@
github_file.write(f"UPGRADE_HEIGHT={UPGRADE_HEIGHT}")
github_file.close()

def derive_module_address(module_name: str, prefix="cosmos") -> str:
hash_bytes = hashlib.sha256(module_name.encode()).digest()
address_bytes = hash_bytes[:20]
address = bech32.bech32_encode(prefix, bech32.convertbits(address_bytes, 8, 5))
return address

gov_address = derive_module_address("gov")
proposal_json = {
"messages": [
{
"@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",
"authority": os.environ["GOV_ADDRESS"],
"authority": gov_address,
"plan": {
"name": os.environ['VERSION'],
"time": "0001-01-01T00:00:00Z",
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/upgrade_path_testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ jobs:
run: |
echo "*****UPGRADE TYPE*****"
echo ${UPGRADE_TYPE}
export GOV_ADDRESS=$(zetacored query gov params deposit --chain-id=${CHAINID} | jq -r '.pool_address')
echo "GOV_ADDRESS: ${GOV_ADDRESS}"
echo "*****BUILD GOV PROPOSAL*****"
GOV_PROPOSAL=$(python .github/actions/upgrade-testing/scripts/raise_gov_proposal.py)
echo "${GOV_PROPOSAL}"
Expand Down

0 comments on commit c863c40

Please sign in to comment.