Skip to content

Commit 112d40b

Browse files
improvements(cli): Align debug CLI commands with Cosmos SDK plus other minor clean up (#54)
1 parent 78d16bd commit 112d40b

File tree

7 files changed

+26
-18
lines changed

7 files changed

+26
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This changelog was created using the `clu` binary
88

99
### Improvements
1010

11+
- (cli) [#54](https://github.com/evmos/os/pull/54) Align debug CLI commands with Cosmos SDK plus other minor clean up.
1112
- (cli) [#53](https://github.com/evmos/os/pull/53) Enable specifying default key type for adding keys.
1213
- (ante) [#52](https://github.com/evmos/os/pull/52) Refactor ante handlers to be easier to use in partner chains.
1314
- (all) [#48](https://github.com/evmos/os/pull/48) Move latest changes from evmOS main (f943af3b incl. SDK v50).

client/debug/debug.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/ethereum/go-ethereum/common"
2020

2121
"github.com/cosmos/cosmos-sdk/client"
22+
cosmosclientdebug "github.com/cosmos/cosmos-sdk/client/debug"
2223
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
2324
sdk "github.com/cosmos/cosmos-sdk/types"
2425
"github.com/cosmos/cosmos-sdk/version"
@@ -35,10 +36,18 @@ func Cmd() *cobra.Command {
3536
RunE: client.ValidateCmd,
3637
}
3738

38-
cmd.AddCommand(PubkeyCmd())
39-
cmd.AddCommand(AddrCmd())
40-
cmd.AddCommand(RawBytesCmd())
41-
cmd.AddCommand(LegacyEIP712Cmd())
39+
cmd.AddCommand(
40+
// default Cosmos SDK debug commands
41+
cosmosclientdebug.CodecCmd(),
42+
cosmosclientdebug.PrefixesCmd(),
43+
cosmosclientdebug.PubkeyRawCmd(), // TODO: support eth_secp256k1 pubkeys for this one too?
44+
45+
// evmOS adjusted debug commands
46+
PubkeyCmd(),
47+
AddrCmd(),
48+
RawBytesCmd(),
49+
LegacyEIP712Cmd(),
50+
)
4251

4352
return cmd
4453
}

client/keys.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@ import (
2222
//
2323
// The defaultToEthKeys boolean indicates whether to use
2424
// Ethereum compatible keys by default or stick with the Cosmos SDK default.
25-
//
26-
// TODO: (on follow up PR) adjust Tendermint mentions to CometBFT
2725
func KeyCommands(defaultNodeHome string, defaultToEthKeys bool) *cobra.Command {
2826
cmd := &cobra.Command{
2927
Use: "keys",
3028
Short: "Manage your application's keys",
3129
Long: `Keyring management commands. These keys may be in any format supported by the
32-
Tendermint crypto library and can be used by light-clients, full nodes, or any other application
30+
CometBFT crypto library and can be used by light-clients, full nodes, or any other application
3331
that needs to sign with a private key.
3432
3533
The keyring supports the following backends:

server/util.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ func AddCommands(
3030
appExport types.AppExporter,
3131
addStartFlags types.ModuleInitFlags,
3232
) {
33-
// TODO: this needs to be updated to use the comet subcommands and alias it to tendermint
34-
tendermintCmd := &cobra.Command{
35-
Use: "tendermint",
36-
Short: "Tendermint subcommands",
33+
cometbftCmd := &cobra.Command{
34+
Use: "comet",
35+
Aliases: []string{"cometbft", "tendermint"},
36+
Short: "CometBFT subcommands",
3737
}
3838

39-
tendermintCmd.AddCommand(
39+
cometbftCmd.AddCommand(
4040
sdkserver.ShowNodeIDCmd(),
4141
sdkserver.ShowValidatorCmd(),
4242
sdkserver.ShowAddressCmd(),
@@ -51,7 +51,7 @@ func AddCommands(
5151

5252
rootCmd.AddCommand(
5353
startCmd,
54-
tendermintCmd,
54+
cometbftCmd,
5555
sdkserver.ExportCmd(appExport, opts.DefaultNodeHome),
5656
version.NewVersionCommand(),
5757
sdkserver.NewRollbackCmd(opts.AppCreator, opts.DefaultNodeHome),

x/evm/client/cli/tx.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func NewRawTxCmd() *cobra.Command {
101101
return err
102102
}
103103

104-
// broadcast to a Tendermint node
104+
// broadcast to a CometBFT node
105105
res, err := clientCtx.BroadcastTx(txBytes)
106106
if err != nil {
107107
return err

x/evm/types/codec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var (
2626

2727
const (
2828
// Amino names
29-
updateParamsName = "os/MsgUpdateParams"
29+
updateParamsName = "os/evm/MsgUpdateParams"
3030
)
3131

3232
// NOTE: This is required for the GetSignBytes function
@@ -47,7 +47,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
4747
&MsgUpdateParams{},
4848
)
4949
registry.RegisterInterface(
50-
"ethermint.evm.v1.TxData",
50+
"os.evm.v1.TxData",
5151
(*TxData)(nil),
5252
&DynamicFeeTx{},
5353
&AccessListTx{},

x/evm/types/logs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (log *Log) Validate() error {
6969
return nil
7070
}
7171

72-
// ToEthereum returns the Ethereum type Log from a Ethermint proto compatible Log.
72+
// ToEthereum returns the Ethereum type Log from an evmOS proto compatible Log.
7373
func (log *Log) ToEthereum() *ethtypes.Log {
7474
topics := make([]common.Hash, len(log.Topics))
7575
for i, topic := range log.Topics {
@@ -98,7 +98,7 @@ func NewLogsFromEth(ethlogs []*ethtypes.Log) []*Log {
9898
return logs
9999
}
100100

101-
// LogsToEthereum casts the Ethermint Logs to a slice of Ethereum Logs.
101+
// LogsToEthereum casts the evmOS logs to a slice of Ethereum Logs.
102102
func LogsToEthereum(logs []*Log) []*ethtypes.Log {
103103
var ethLogs []*ethtypes.Log //nolint: prealloc
104104
for i := range logs {

0 commit comments

Comments
 (0)