diff --git a/changelog.md b/changelog.md index 1482f56507..f81be79b31 100644 --- a/changelog.md +++ b/changelog.md @@ -47,6 +47,7 @@ - [#3068](https://github.com/ignite/cli/pull/3068) Fix REST codegen method casing bug - [#3031](https://github.com/ignite/cli/pull/3031) Move keeper hooks to after all keepers initialized in `app.go` template. - [#3098](https://github.com/ignite/cli/issues/3098) Fix config upgrade issue that left config empty on error. +- [#3129](https://github.com/ignite/cli/issues/3129) Remove redundant `keyring-backend` config option. - [#3187](https://github.com/ignite/cli/issues/3187) Change prompt text to fit within 80 characters width. ## [`v0.25.2`](https://github.com/ignite/cli/releases/tag/v0.25.1) diff --git a/ignite/config/chain/base/config.go b/ignite/config/chain/base/config.go index bb38d92198..227297c33f 100644 --- a/ignite/config/chain/base/config.go +++ b/ignite/config/chain/base/config.go @@ -122,9 +122,6 @@ type Init struct { // Home overwrites default home directory used for the app Home string `yaml:"home"` - - // KeyringBackend is the default keyring backend to use for blockchain initialization - KeyringBackend string `yaml:"keyring-backend"` } // Host keeps configuration related to started servers. diff --git a/ignite/config/chain/v0/config_convert.go b/ignite/config/chain/v0/config_convert.go index 5a251947d4..8bdbdb822f 100644 --- a/ignite/config/chain/v0/config_convert.go +++ b/ignite/config/chain/v0/config_convert.go @@ -18,7 +18,6 @@ func (c *Config) ConvertNext() (chainconfig.Converter, error) { validator.Name = c.Validator.Name validator.Bonded = c.Validator.Staked validator.Home = c.Init.Home - validator.KeyringBackend = c.Init.KeyringBackend validator.Client = c.Init.Client if c.Init.App != nil { diff --git a/ignite/config/chain/v0/config_convert_test.go b/ignite/config/chain/v0/config_convert_test.go index d344f76719..a43a4c30e2 100644 --- a/ignite/config/chain/v0/config_convert_test.go +++ b/ignite/config/chain/v0/config_convert_test.go @@ -50,7 +50,6 @@ func TestV0ToV1Validator(t *testing.T) { require.Equal(t, cfgV0.Validator.Name, validator.Name) require.Equal(t, cfgV0.Validator.Staked, validator.Bonded) require.Equal(t, cfgV0.Init.Home, validator.Home) - require.Equal(t, cfgV0.Init.KeyringBackend, validator.KeyringBackend) require.Equal(t, cfgV0.Init.Client, validator.Client) require.Equal(t, cfgV0.Host.RPC, servers.RPC.Address) require.Equal(t, cfgV0.Host.P2P, servers.P2P.Address) diff --git a/ignite/config/chain/v0/testdata/config.yaml b/ignite/config/chain/v0/testdata/config.yaml index 9d75e02198..987fe43432 100644 --- a/ignite/config/chain/v0/testdata/config.yaml +++ b/ignite/config/chain/v0/testdata/config.yaml @@ -17,6 +17,8 @@ build: binary: "evmosd" init: home: "$HOME/.evmosd" + client: + keyring-backend: "os" app: evm-rpc: address: "0.0.0.0:8545" diff --git a/ignite/config/chain/v1/testdata/config.yaml b/ignite/config/chain/v1/testdata/config.yaml index e6fa3438bb..82ea30a3b8 100644 --- a/ignite/config/chain/v1/testdata/config.yaml +++ b/ignite/config/chain/v1/testdata/config.yaml @@ -50,4 +50,6 @@ validators: evm-rpc: address: 0.0.0.0:8545 ws-address: 0.0.0.0:8546 + client: + keyring-backend: os home: $HOME/.evmosd diff --git a/ignite/config/chain/v1/validator.go b/ignite/config/chain/v1/validator.go index d65d2e1c9a..bfeb1fffd0 100644 --- a/ignite/config/chain/v1/validator.go +++ b/ignite/config/chain/v1/validator.go @@ -24,9 +24,6 @@ type Validator struct { // Home overwrites default home directory used for the app Home string `yaml:"home,omitempty"` - // KeyringBackend is the default keyring backend to use for blockchain initialization - KeyringBackend string `yaml:"keyring-backend,omitempty"` - // Gentx overwrites appd's config/gentx.toml configs. Gentx *Gentx `yaml:"gentx,omitempty"` } diff --git a/ignite/services/chain/chain.go b/ignite/services/chain/chain.go index bb00d5c380..f6cec62c9d 100644 --- a/ignite/services/chain/chain.go +++ b/ignite/services/chain/chain.go @@ -371,20 +371,15 @@ func (c *Chain) KeyringBackend() (chaincmd.KeyringBackend, error) { // 2nd. validator := config.Validators[0] - if validator.KeyringBackend != "" { - return chaincmd.KeyringBackendFromString(validator.KeyringBackend) - } - - // 3rd. if validator.Client != nil { - if backend, ok := validator.Client["keyring-backend"]; ok { - if backendStr, ok := backend.(string); ok { - return chaincmd.KeyringBackendFromString(backendStr) + if v, ok := validator.Client["keyring-backend"]; ok { + if backend, ok := v.(string); ok { + return chaincmd.KeyringBackendFromString(backend) } } } - // 4th. + // 3rd. configTOMLPath, err := c.ClientTOMLPath() if err != nil { return "", err @@ -400,7 +395,7 @@ func (c *Chain) KeyringBackend() (chaincmd.KeyringBackend, error) { return chaincmd.KeyringBackendFromString(conf.KeyringBackend) } - // 5th. + // 4th. return chaincmd.KeyringBackendTest, nil } diff --git a/integration/node/cmd_query_bank_test.go b/integration/node/cmd_query_bank_test.go index 4a4a1a1f76..e6464cc84f 100644 --- a/integration/node/cmd_query_bank_test.go +++ b/integration/node/cmd_query_bank_test.go @@ -20,6 +20,7 @@ import ( "github.com/ignite/cli/ignite/pkg/cosmosclient" "github.com/ignite/cli/ignite/pkg/randstr" "github.com/ignite/cli/ignite/pkg/xurl" + xyaml "github.com/ignite/cli/ignite/pkg/yaml" envtest "github.com/ignite/cli/integration" ) @@ -74,7 +75,9 @@ func TestNodeQueryBankBalances(t *testing.T) { }, } c.Faucet = base.Faucet{} - c.Validators[0].KeyringBackend = keyring.BackendTest + c.Validators[0].Client = xyaml.Map{ + "keyring-backend": keyring.BackendTest, + } }) env.Must(env.Exec("import alice", diff --git a/integration/node/cmd_tx_bank_send_test.go b/integration/node/cmd_tx_bank_send_test.go index 9c742a7e4b..44338c267e 100644 --- a/integration/node/cmd_tx_bank_send_test.go +++ b/integration/node/cmd_tx_bank_send_test.go @@ -18,6 +18,7 @@ import ( "github.com/ignite/cli/ignite/pkg/cosmosclient" "github.com/ignite/cli/ignite/pkg/randstr" "github.com/ignite/cli/ignite/pkg/xurl" + xyaml "github.com/ignite/cli/ignite/pkg/yaml" envtest "github.com/ignite/cli/integration" ) @@ -70,7 +71,9 @@ func TestNodeTxBankSend(t *testing.T) { }, } c.Faucet = base.Faucet{} - c.Validators[0].KeyringBackend = keyring.BackendTest + c.Validators[0].Client = xyaml.Map{ + "keyring-backend": keyring.BackendTest, + } }) env.Must(env.Exec("import alice", step.NewSteps(step.New(