From 66f00b5bd49ba9fe5cef1a710d1f8634c2758d1b Mon Sep 17 00:00:00 2001 From: HuangYi Date: Sat, 30 Nov 2024 10:13:40 +0800 Subject: [PATCH] cleanup --- integration_tests/configs/permissions.jsonnet | 15 ----------- integration_tests/test_permissions.py | 25 ++++++------------- scripts/.env | 3 ++- 3 files changed, 9 insertions(+), 34 deletions(-) delete mode 100644 integration_tests/configs/permissions.jsonnet diff --git a/integration_tests/configs/permissions.jsonnet b/integration_tests/configs/permissions.jsonnet deleted file mode 100644 index 5d5d30d220..0000000000 --- a/integration_tests/configs/permissions.jsonnet +++ /dev/null @@ -1,15 +0,0 @@ -local config = import 'default.jsonnet'; - -config { - 'cronos_777-1'+: { - genesis+: { - app_state+: { - cronos+: { - params+: { - cronos_admin: 'crc18z6q38mhvtsvyr5mak8fj8s8g4gw7kjjtsgrn7', //same account as VALIDATOR2_MNEMONIC - }, - }, - }, - }, - }, -} diff --git a/integration_tests/test_permissions.py b/integration_tests/test_permissions.py index 97e2df9c40..ce7131b1fe 100644 --- a/integration_tests/test_permissions.py +++ b/integration_tests/test_permissions.py @@ -1,28 +1,17 @@ import os -from pathlib import Path -import pytest - -from .network import setup_custom_cronos from .utils import ADDRS, eth_to_bech32, wait_for_new_blocks -@pytest.fixture(scope="module") -def custom_cronos(tmp_path_factory): - path = tmp_path_factory.mktemp("cronos") - yield from setup_custom_cronos( - path, 27100, Path(__file__).parent / "configs/permissions.jsonnet" - ) - - -def test_permissions_updates(custom_cronos): +def test_permissions_updates(cronos): """ - test permissions updates - reproduce an iavl prune issue: https://github.com/cosmos/iavl/pull/1007 """ acc = eth_to_bech32(ADDRS["signer1"]) - cli = custom_cronos.cosmos_cli(1) # node1 is iavl + cli = cronos.cosmos_cli(1) # node1 is iavl cli.create_account("community", os.environ["COMMUNITY_MNEMONIC"]) + cli.create_account("admin", os.environ["VALIDATOR1_MNEMONIC"]) rsp = cli.query_permissions(acc) print("permissions", rsp) assert rsp["can_change_token_mapping"] is False @@ -32,7 +21,7 @@ def test_permissions_updates(custom_cronos): rsp = cli.update_permissions(acc, 3, from_="community") assert rsp["code"] != 0, "should not have the permission" - rsp = cli.update_permissions(acc, 3, from_="validator") + rsp = cli.update_permissions(acc, 3, from_="admin") assert rsp["code"] == 0, rsp["raw_log"] wait_for_new_blocks(cli, 5) @@ -42,11 +31,11 @@ def test_permissions_updates(custom_cronos): assert rsp["can_change_token_mapping"] is True assert rsp["can_turn_bridge"] is True - custom_cronos.supervisorctl("stop", "cronos_777-1-node1") + cronos.supervisorctl("stop", "cronos_777-1-node1") print(cli.prune()) - custom_cronos.supervisorctl("start", "cronos_777-1-node1") + cronos.supervisorctl("start", "cronos_777-1-node1") - rsp = cli.update_permissions(acc, 4, from_="validator") + rsp = cli.update_permissions(acc, 4, from_="admin") assert rsp["code"] == 0, rsp["raw_log"] wait_for_new_blocks(cli, 5) diff --git a/scripts/.env b/scripts/.env index 8626f66794..94fa816854 100644 --- a/scripts/.env +++ b/scripts/.env @@ -6,5 +6,6 @@ export COMMUNITY_MNEMONIC="notable error gospel wave pair ugly measure elite tod export SIGNER1_MNEMONIC="shed crumble dismiss loyal latin million oblige gesture shrug still oxygen custom remove ribbon disorder palace addict again blanket sad flock consider obey popular" export SIGNER2_MNEMONIC="night renew tonight dinner shaft scheme domain oppose echo summer broccoli agent face guitar surface belt veteran siren poem alcohol menu custom crunch index" export SIGNER3_MNEMONIC="step endless survey brand topic warrior merry boat metal throw tag recycle pitch animal drill jar hero library arm swift kitten proof acoustic chef" +# same account as VALIDATOR1_MNEMONIC export CRONOS_ADMIN="crc12luku6uxehhak02py4rcz65zu0swh7wjsrw0pp" -export IBC_CRO_DENOM="ibc/6411AE2ADA1E73DB59DB151A8988F9B7D5E7E233D8414DB6817F8F1A01611F86" \ No newline at end of file +export IBC_CRO_DENOM="ibc/6411AE2ADA1E73DB59DB151A8988F9B7D5E7E233D8414DB6817F8F1A01611F86"