From 8d79c35320a2c7c18fcadd0513b2668f6df453b5 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 12 Apr 2024 09:31:28 +0800 Subject: [PATCH] Problem: autocli use wrong clientCtx Solution: - update dependency to include the fix, see https://github.com/cosmos/cosmos-sdk/pull/19060 changelog fix test --- CHANGELOG.md | 1 + cmd/ethermintd/root.go | 8 +++----- go.mod | 1 + go.sum | 4 ++-- gomod2nix.toml | 5 +++-- tests/integration_tests/test_fee_history.py | 2 +- tests/integration_tests/utils.py | 4 ++-- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98d486a023..d39866b7c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#434](https://github.com/crypto-org-chain/ethermint/pull/434) No need gasPrice when patch gasUsed for `eth_getTransactionReceipt`. * (rpc) [#439](https://github.com/crypto-org-chain/ethermint/pull/439), [#441](https://github.com/crypto-org-chain/ethermint/pull/441) Align trace response for failed tx with go-ethereum. * (evm) [#463](https://github.com/crypto-org-chain/ethermint/pull/463) Avoid broken bank total supply when creates a validator. +* (cli) [#464](https://github.com/crypto-org-chain/ethermint/pull/464) Update client/v2 to include bug fixes. ### Improvements diff --git a/cmd/ethermintd/root.go b/cmd/ethermintd/root.go index a9b4eeded9..bc2c70eeb4 100644 --- a/cmd/ethermintd/root.go +++ b/cmd/ethermintd/root.go @@ -196,7 +196,7 @@ func queryCommand() *cobra.Command { Use: "query", Aliases: []string{"q"}, Short: "Querying subcommands", - DisableFlagParsing: true, + DisableFlagParsing: false, SuggestionsMinimumDistance: 2, RunE: client.ValidateCmd, } @@ -204,12 +204,12 @@ func queryCommand() *cobra.Command { cmd.AddCommand( rpc.ValidatorCommand(), sdkserver.QueryBlockCmd(), + sdkserver.QueryBlocksCmd(), sdkserver.QueryBlockResultsCmd(), authcmd.QueryTxsByEventsCmd(), authcmd.QueryTxCmd(), rpc.QueryEventForTxCmd(), ) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd } @@ -218,7 +218,7 @@ func txCommand() *cobra.Command { cmd := &cobra.Command{ Use: "tx", Short: "Transactions subcommands", - DisableFlagParsing: true, + DisableFlagParsing: false, SuggestionsMinimumDistance: 2, RunE: client.ValidateCmd, } @@ -235,8 +235,6 @@ func txCommand() *cobra.Command { authcmd.GetSimulateCmd(), ) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") - return cmd } diff --git a/go.mod b/go.mod index fcd3f30f63..8f91b4d507 100644 --- a/go.mod +++ b/go.mod @@ -243,6 +243,7 @@ require ( replace ( // release/v0.50.x + cosmossdk.io/client/v2 => github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240410035034-e8854d5aada6 cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240410035034-e8854d5aada6 cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240410035034-e8854d5aada6 github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240410035034-e8854d5aada6 diff --git a/go.sum b/go.sum index 13de42a668..26f9761d6c 100644 --- a/go.sum +++ b/go.sum @@ -186,8 +186,6 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= -cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -415,6 +413,8 @@ github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c h1:MOgfS4+F github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240410035034-e8854d5aada6 h1:hkCJuCgoDFQEtq5zc8SmfTbIBVRdHk0QPagykrmwXlY= github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240410035034-e8854d5aada6/go.mod h1:nRk8EA8/fEG4zSme2i/Rq5z3k7TrlsHkOYhrY79hhD8= +github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240410035034-e8854d5aada6 h1:5y6aqDzUWNTv/8FgIAx+M3TPAgpUIE2vMRr9hSNsVsE= +github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240410035034-e8854d5aada6/go.mod h1:GjpaaxatOEnkSlNKjYxSbzVVtHHAG0tWm26AoPA1g9Q= github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240410035034-e8854d5aada6 h1:x7yeS5Kfvt6W2Q8RQjsraazqovYXJyCA+/V+cJMWtlY= github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240410035034-e8854d5aada6/go.mod h1:lfuLI1f4o+0SGtlHQS4x5qsjRcZZfYqG8bp3k8hM0M8= github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240410035034-e8854d5aada6 h1:oQVP5BWGHvbuY37s+SUKNFu74y2oFpp6lWgBbVkm7oU= diff --git a/gomod2nix.toml b/gomod2nix.toml index 8e93fb41f3..af86f17570 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -20,8 +20,9 @@ schema = 3 version = "v0.7.3" hash = "sha256-G72m5tUKLrpl89YKM/S7J/e8rYkqctuDOqHbqxyzTBI=" [mod."cosmossdk.io/client/v2"] - version = "v2.0.0-beta.1" - hash = "sha256-5o3FSZ9xcYG4KLTOMbVFfPhV4CtlUn4LxjEm3/t1nOU=" + version = "v2.0.0-20240410035034-e8854d5aada6" + hash = "sha256-PqDZ72kHFknqUO6MKF5cRudMFIH1syCRI+7gpCMuYkI=" + replaced = "github.com/crypto-org-chain/cosmos-sdk/client/v2" [mod."cosmossdk.io/collections"] version = "v0.4.0" hash = "sha256-minFyzgO/D+Oda4E3B1qvOAN5qd65SjS6nmjca4cp/8=" diff --git a/tests/integration_tests/test_fee_history.py b/tests/integration_tests/test_fee_history.py index a341604be6..22f21d5b9b 100644 --- a/tests/integration_tests/test_fee_history.py +++ b/tests/integration_tests/test_fee_history.py @@ -186,7 +186,7 @@ def update_feemarket_param(node, tmp_path, new_multiplier=2, new_denominator=200 proposal.write_text(json.dumps(proposal_src)) rsp = cli.submit_gov_proposal(proposal, from_="community") assert rsp["code"] == 0, rsp["raw_log"] - approve_proposal(node, rsp, status=3) + approve_proposal(node, rsp) print("check params have been updated now") p = cli.get_params("feemarket")["params"] assert p["base_fee"] == new_base_fee diff --git a/tests/integration_tests/utils.py b/tests/integration_tests/utils.py index 177e273002..4a0fc62206 100644 --- a/tests/integration_tests/utils.py +++ b/tests/integration_tests/utils.py @@ -328,7 +328,7 @@ def find_log_event_attrs(events, ev_type, cond=None): return None -def approve_proposal(n, rsp, status="PROPOSAL_STATUS_PASSED"): +def approve_proposal(n, rsp): cli = n.cosmos_cli() rsp = cli.event_query_tx_for(rsp["txhash"]) # get proposal_id @@ -351,4 +351,4 @@ def cb(attrs): proposal = cli.query_proposal(proposal_id) wait_for_block_time(cli, isoparse(proposal["voting_end_time"])) proposal = cli.query_proposal(proposal_id) - assert proposal["status"] == status, proposal + assert proposal["status"] == "PROPOSAL_STATUS_PASSED", proposal