Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
### Bug Fixes

- [#833](https://github.com/crypto-org-chain/cronos/pull/833) Fix rollback command.
- [#945](https://github.com/crypto-org-chain/cronos/pull/945) Fix no handler exists for proposal type error when update-client due to wrong ibc route.

### Improvements

Expand Down
3 changes: 2 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ import (
ibc "github.com/cosmos/ibc-go/v5/modules/core"
ibcclient "github.com/cosmos/ibc-go/v5/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v5/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v5/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v5/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper"
Expand Down Expand Up @@ -508,7 +509,7 @@ func New(
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
AddRoute(cronostypes.RouterKey, cronos.NewTokenMappingChangeProposalHandler(app.CronosKeeper))

govConfig := govtypes.DefaultConfig()
Expand Down
25 changes: 25 additions & 0 deletions integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,31 @@ def gov_propose_token_mapping_change_legacy(
)
)

def gov_propose_update_client_legacy(self, proposal, **kwargs):
kwargs.setdefault("gas_prices", DEFAULT_GAS_PRICE)
kwargs.setdefault("gas", 600000)
return json.loads(
self.raw(
"tx",
"gov",
"submit-legacy-proposal",
"update-client",
proposal.get("subject_client_id"),
proposal.get("substitute_client_id"),
"-y",
from_=proposal.get("from"),
keyring_backend="test",
# content
title=proposal.get("title"),
description=proposal.get("description"),
deposit=proposal.get("deposit"),
chain_id=self.chain_id,
home=self.data_dir,
stderr=subprocess.DEVNULL,
**kwargs,
)
)

def submit_gov_proposal(self, proposal, **kwargs):
default_kwargs = self.get_default_kwargs()
return json.loads(
Expand Down
47 changes: 47 additions & 0 deletions integration_tests/test_ibc_update_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import subprocess
import time

import pytest

from .ibc_utils import prepare_network


@pytest.fixture(scope="module")
def ibc(request, tmp_path_factory):
"prepare-network"
name = "ibc"
path = tmp_path_factory.mktemp(name)
network = prepare_network(path, name)
yield from network


def test_ibc_update_client(ibc):
"""
test update expire subject client with new active client
"""
cmd = [
"hermes",
"--config",
ibc.hermes.configpath,
"create",
"client",
"--host-chain",
"cronos_777-1",
"--reference-chain",
"chainmain-1",
]
subprocess.check_call(cmd + ["--trusting-period", "1s"])
time.sleep(1)
subprocess.check_call(cmd)
cli = ibc.cronos.cosmos_cli()
rsp = cli.gov_propose_update_client_legacy(
{
"subject_client_id": "07-tendermint-1",
"substitute_client_id": "07-tendermint-2",
"from": "validator",
"title": "update-client-title",
"description": "update-client-description",
"deposit": "1basetcro",
},
)
assert rsp["code"] == 0, rsp["raw_log"]