Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Nov 30, 2024
1 parent 3797446 commit 66f00b5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 34 deletions.
15 changes: 0 additions & 15 deletions integration_tests/configs/permissions.jsonnet

This file was deleted.

25 changes: 7 additions & 18 deletions integration_tests/test_permissions.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand All @@ -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)
3 changes: 2 additions & 1 deletion scripts/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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"
export IBC_CRO_DENOM="ibc/6411AE2ADA1E73DB59DB151A8988F9B7D5E7E233D8414DB6817F8F1A01611F86"

0 comments on commit 66f00b5

Please sign in to comment.