diff --git a/test/integration/framework/src/siftool/chainbuilder.py b/test/integration/framework/src/siftool/chainbuilder.py index b758d46a00..f46c4d8342 100644 --- a/test/integration/framework/src/siftool/chainbuilder.py +++ b/test/integration/framework/src/siftool/chainbuilder.py @@ -10,6 +10,9 @@ def __brutally_terminate_processes(cmd): # This is used for bulding sifchain-testnet-2 def install_testnet(cmd: command.Command, base_dir: str, chain_id: str): + prj = project.Project(cmd) + mnemonics = prj.read_peruser_config_file("mnemonics.json") + faucet_mnemonic = "fiction cousin fragile allow fruit slogan useless sting exile virus scale dress fatigue eight clay sort tape between cargo flag civil rude umbrella sing".split() node0_admin_mnemonic = "frog skin business valve fish fat glory syrup chicken skin slow ensure sun luggage wild click into paper swamp car ecology infant thought squeeze".split() node1_admin_mnemonic = "system faculty master promote among arrive dose zone cream fame barrel warm slice please creek puzzle boat excess rain lonely cupboard flame punch shed".split() diff --git a/test/integration/framework/src/siftool/cosmos.py b/test/integration/framework/src/siftool/cosmos.py index f64ee39fda..036e147822 100644 --- a/test/integration/framework/src/siftool/cosmos.py +++ b/test/integration/framework/src/siftool/cosmos.py @@ -133,7 +133,7 @@ def transfer(cmd, channel, address, amount, from_addr, chain_id, node, gas_price args = [akash_binary, "tx", "ibc-transfer", "transfer", "transfer", channel, address, amount, "--from", from_addr, "--keyring-backend", keyring_backend, "--chain-id", chain_id, "--node", node, "-y", "--gas-prices", gas_prices, - "--gas", gas, "--packet-timeout-timestam[", str(packet_timeout_timestamp)] + "--gas", gas, "--packet-timeout-timestamp", str(packet_timeout_timestamp)] res = cmd.execst(args) return res @@ -141,6 +141,7 @@ def transfer(cmd, channel, address, amount, from_addr, chain_id, node, gas_price # Example: "channel-141", "uosmo" -> "ibc/14F9BC3E44B8A9C1BE1FB08980FAB87034C9905EF17CF2F5008FC085218811CC" +# The channel_id is for the side that is receiving the denom (not the counterparty). # See https://tutorials.cosmos.network/tutorials/6-ibc-dev/ def derive_ibc_denom_hash(channel: str, denom: str) -> str: port = "transfer" # Seems to be a constant for IBC token transfers diff --git a/test/integration/framework/src/siftool/environments.py b/test/integration/framework/src/siftool/environments.py index e9e945c59d..df33ca9d4e 100644 --- a/test/integration/framework/src/siftool/environments.py +++ b/test/integration/framework/src/siftool/environments.py @@ -17,6 +17,7 @@ def __init__(self, cmd: command.Command, chain_id: Optional[str] = None, sifnode self.chain_id = chain_id or "localnet" self.staking_denom = ROWAN self.default_binary = "sifnoded" + self.port_offset = 0 self.node_info: List[JsonDict] = [] self.clp_admin: Optional[cosmos.Address] = None self.oracle_admin: Optional[cosmos.Address] = None @@ -113,12 +114,12 @@ def add_validator(self, /, binary: Optional[str] = None, admin_name: Optional[s def ports_for_node(self, i: int) -> JsonDict: assert i < 10, "Change port configuration for 10 or more nodes" return { - "rpc": 10286 + i, - "api": 10131 + i, - "grpc": 10909 + i, - "grpc_web": 10919 + i, - "p2p": 10276 + i, - "pprof": 10606 + i, + "rpc": 10286 + self.port_offset + i, + "api": 10131 + self.port_offset + i, + "grpc": 10909 + self.port_offset + i, + "grpc_web": 10919 + self.port_offset + i, + "p2p": 10276 + self.port_offset + i, + "pprof": 10606 + self.port_offset + i, } def init(self, faucet_balance: Optional[cosmos.Balance] = None, faucet_mnemonic: Optional[Sequence[str]] = None, diff --git a/test/integration/framework/src/siftool/project.py b/test/integration/framework/src/siftool/project.py index d4ee2026d0..b71738b518 100644 --- a/test/integration/framework/src/siftool/project.py +++ b/test/integration/framework/src/siftool/project.py @@ -168,14 +168,14 @@ def write_vagrantenv_sh(self, state_vars, data_dir, ethereum_websocket_address, self.cmd.write_text_file(vagrantenv_path, joinlines(format_as_shell_env_vars(env))) self.cmd.write_text_file(project_dir("test/integration/vagrantenv.json"), json.dumps(env)) - def get_peruser_config_dir(self): + def get_peruser_config_dir(self) -> str: return self.cmd.get_user_home(".config", "siftool") - def get_user_env_vars(self): + def get_user_env_vars(self) -> JsonDict: env_file = os.environ["SIFTOOL_ENV_FILE"] return json.loads(self.cmd.read_text_file(env_file)) - def read_peruser_config_file(self, name): + def read_peruser_config_file(self, name) -> Optional[JsonDict]: path = os.path.join(self.get_peruser_config_dir(), name + ".json") if self.cmd.exists(path): return json.loads(self.cmd.read_text_file(path)) diff --git a/test/integration/framework/src/siftool/sifchain.py b/test/integration/framework/src/siftool/sifchain.py index 6a406d69e2..0c1cee52bc 100644 --- a/test/integration/framework/src/siftool/sifchain.py +++ b/test/integration/framework/src/siftool/sifchain.py @@ -6,7 +6,7 @@ import re import toml import web3 # TODO Remove dependency -from typing import Mapping, Any, Tuple, AnyStr +from typing import Mapping, Any, Tuple from siftool import command, cosmos, eth from siftool.common import * @@ -1022,6 +1022,20 @@ def version(self) -> str: def gov_submit_software_upgrade(self, version: str, from_acct: cosmos.Address, deposit: cosmos.Balance, upgrade_height: int, upgrade_info: str, title: str, description: str, broadcast_mode: Optional[str] = None ): + # Example: + # sifnoded tx gov submit-proposal software-upgrade 1.2.0-beta \ + # --title "Sifchain 1.2.0-beta Upgrade" \ + # --description "Sifchain 1.2.0-beta Upgrade" \ + # --upgrade-height BLOCK_HEIGHT \ + # --deposit 50000000000000000000000rowan \ + # --from ACCOUNT \ + # --keyring-backend test \ + # --chain-id=sifchain-1 \ + # --node https://sifchain-rpc.polkachu.com:443 \ + # --broadcast-mode block \ + # --fees 10000000000000000000000rowan \ + # --gas 200000 \ + # --yes args = ["tx", "gov", "submit-proposal", "software-upgrade", version, "--from", from_acct, "--deposit", cosmos.balance_format(deposit), "--upgrade-height", str(upgrade_height), "--upgrade-info", upgrade_info, "--title", title, "--description", description] + self._home_args() + self._keyring_backend_args() + \