Skip to content

Commit

Permalink
Problem: miss keypair of SendEnabled to restore legacy param set befo…
Browse files Browse the repository at this point in the history
…re migration (#1206)

* Problem: miss keypair of SendEnabled to restore legacy param set before migration

* Update CHANGELOG.md

Signed-off-by: mmsqe <[email protected]>

* cleanup

* update deps

---------

Signed-off-by: mmsqe <[email protected]>
  • Loading branch information
mmsqe authored Oct 16, 2023
1 parent f48d42e commit c47cc56
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [Unreleased]

### Bug Fixes
* [#1206](https://github.com/crypto-org-chain/cronos/pull/1206) Add missing keypair of SendEnabled to restore legacy param set before migration.

*October 9, 2023*

## v1.1.0
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ replace (
// Use cosmos keyring
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
github.com/cometbft/cometbft-db => github.com/crypto-org-chain/cometbft-db v0.0.0-20230921030527-0d47d7537e32
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231009083556-8fbcfbe50690
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231013072415-eec017435467
github.com/crypto-org-chain/cronos/memiavl => ./memiavl
github.com/crypto-org-chain/cronos/store => ./store
github.com/crypto-org-chain/cronos/versiondb => ./versiondb
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/crypto-org-chain/cometbft-db v0.0.0-20230921030527-0d47d7537e32 h1:VqP0YWKZ6bPHkVHu47EvlrqjYzQiQ0MyRE7NY/fJpU4=
github.com/crypto-org-chain/cometbft-db v0.0.0-20230921030527-0d47d7537e32/go.mod h1:V32HRAjDsAYLfAT90mk0O9UH+sE7P5apfiCmmmVLt3Q=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231009083556-8fbcfbe50690 h1:qDb6BvtxeKsm6o5U4o1oZMhJ9gdXZS8HtO58IXfawd8=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231009083556-8fbcfbe50690/go.mod h1:G384omH7cXgm90xXR7xpHvsKG7vdBaDuz4To6GpTHUU=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231013072415-eec017435467 h1:m0/aHPIJAzi2MSP3TXzzbLTFf+koRFQiaYmerRZUtK4=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231013072415-eec017435467/go.mod h1:G384omH7cXgm90xXR7xpHvsKG7vdBaDuz4To6GpTHUU=
github.com/crypto-org-chain/ethermint v0.6.1-0.20230925072753-4062d0cc2a32 h1:A++epzNCr3EY57dnU6UTSDwbCiPD6MjvUKHKSd/PoI8=
github.com/crypto-org-chain/ethermint v0.6.1-0.20230925072753-4062d0cc2a32/go.mod h1:wnJQyK4n0vShhL+YIAUd7XCzUhgZ9fgG6yJ14n7qefo=
github.com/crypto-org-chain/gravity-bridge/module/v2 v2.0.1-0.20230825054824-75403cd90c6e h1:rSTc35OBjjCBx47rHPWBCIHNGPbMnEj8f7fNcK2TjVI=
Expand Down
4 changes: 2 additions & 2 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ schema = 3
version = "v1.0.0-beta.2"
hash = "sha256-Am8A44NSxdY77GIEDx1AY+pLU0npeyuTlr3mc4stg3I="
[mod."github.com/cosmos/cosmos-sdk"]
version = "v0.46.0-beta2.0.20231009083556-8fbcfbe50690"
hash = "sha256-WfGn4NQwgHwgMoGiWs5sJA5grI18rd/OlKpdnt+34gc="
version = "v0.46.0-beta2.0.20231013072415-eec017435467"
hash = "sha256-TA3D7opzAx0jjhoj54yQbvXc0z+4V93kgpsnCryEuFA="
replaced = "github.com/crypto-org-chain/cosmos-sdk"
[mod."github.com/cosmos/go-bip39"]
version = "v1.0.0"
Expand Down
14 changes: 14 additions & 0 deletions integration_tests/configs/cosmovisor.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ config {
],
},
},
bank+: {
params: {
send_enabled: [
{
denom: 'stake',
enabled: true,
},
{
denom: 'basetcro',
enabled: false,
},
],
},
},
feemarket+: {
params+: {
no_base_fee: false,
Expand Down
13 changes: 13 additions & 0 deletions integration_tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
deploy_contract,
edit_ini_sections,
get_consensus_params,
get_send_enable,
send_transaction,
wait_for_block,
wait_for_new_blocks,
Expand Down Expand Up @@ -81,6 +82,14 @@ def test_cosmovisor_upgrade(custom_cronos: Cronos, tmp_path_factory):
- it should work transparently
"""
cli = custom_cronos.cosmos_cli()
port = ports.api_port(custom_cronos.base_port(0))
send_enable = [
{"denom": "basetcro", "enabled": False},
{"denom": "stake", "enabled": True},
]
p = get_send_enable(port)
assert sorted(p, key=lambda x: x["denom"]) == send_enable

# export genesis from cronos v0.8.x
custom_cronos.supervisorctl("stop", "all")
migrate = tmp_path_factory.mktemp("migrate")
Expand Down Expand Up @@ -164,6 +173,10 @@ def test_cosmovisor_upgrade(custom_cronos: Cronos, tmp_path_factory):
res = get_consensus_params(port, w3.eth.get_block_number())
assert res["block"]["max_gas"] == "60000000"

# check bank send enable
p = cli.query_bank_send()
assert sorted(p, key=lambda x: x["denom"]) == send_enable

rsp = cli.query_params("icaauth")
assert rsp["params"]["min_timeout_duration"] == "3600s", rsp
assert cli.query_params()["max_callback_gas"] == "300000", rsp
Expand Down
6 changes: 6 additions & 0 deletions integration_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,3 +722,9 @@ def get_logs_since(w3, addr, start):
def get_consensus_params(port, height):
url = f"http://127.0.0.1:{port}/consensus_params?height={height}"
return requests.get(url).json()["result"]["consensus_params"]


def get_send_enable(port):
url = f"http://127.0.0.1:{port}/cosmos/bank/v1beta1/params"
raw = requests.get(url).json()
return raw["params"]["send_enabled"]

0 comments on commit c47cc56

Please sign in to comment.