From 814fcacedf60ce6c64282965da75a0d0f896dc8e Mon Sep 17 00:00:00 2001 From: yihuang Date: Thu, 2 May 2024 12:31:19 +0800 Subject: [PATCH] Problem: app don't have access to current keyring-backend config (backport #483) (#484) Update CHANGELOG.md fix lint add keyring flag Update server/start.go Signed-off-by: yihuang --- CHANGELOG.md | 4 ++++ server/start.go | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc230ba0f7..3240818be6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#473](https://github.com/crypto-org-chain/ethermint/pull/473) Avoid panic on invalid elasticity_multiplier. * (rpc) [#480](https://github.com/crypto-org-chain/ethermint/pull/480) Fix parsed logs from old events. +### Improvements + +* (app) [#483](https://github.com/crypto-org-chain/ethermint/pull/483) Make keyring-backend client config accessible in app. + ## v0.21.x-cronos ### Bug Fixes diff --git a/server/start.go b/server/start.go index 783a440b78..c162adf217 100644 --- a/server/start.go +++ b/server/start.go @@ -147,8 +147,8 @@ which accepts a path for the resulting pprof file. serverCtx.Logger.Info("Unlocking keyring") // fire unlock precess for keyring - keyringBackend, _ := cmd.Flags().GetString(flags.FlagKeyringBackend) - if keyringBackend == keyring.BackendFile { + krBackend := clientCtx.Keyring.Backend() + if krBackend == keyring.BackendFile { _, err = clientCtx.Keyring.List() if err != nil { return err @@ -157,6 +157,9 @@ which accepts a path for the resulting pprof file. serverCtx.Logger.Info("starting ABCI with Tendermint") + // set keyring backend type to the server context + serverCtx.Viper.Set(flags.FlagKeyringBackend, krBackend) + // amino is needed here for backwards compatibility of REST routes err = wrapCPUProfile(serverCtx, func() error { return startInProcess(serverCtx, clientCtx, opts)