-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: refactor eotsd keys cmd #102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one question about this todo
eotsmanager/cmd/eotsd/utils.go
Outdated
// and exists a value in the config that could be used, it will be set in the ctx. | ||
func PersistClientCtx(ctx client.Context) func(cmd *cobra.Command, _ []string) error { | ||
return func(cmd *cobra.Command, _ []string) error { | ||
// TODO(verify): if it uses the default encoding config it fails to list keys! output: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh do we have some test case for this ? or this is cosmos-sdk bug and we do not need to do anything with this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I copied it from
func PersistClientCtx(ctx client.Context) func(cmd *cobra.Command, _ []string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah I remembered
I only create the whole app to get the configs to ctx
tempApp := app.NewTmpBabylonApp()
ctx = ctx.
WithCodec(tempApp.AppCodec()).
WithInterfaceRegistry(tempApp.InterfaceRegistry()).
WithTxConfig(tempApp.TxConfig()).
WithLegacyAmino(tempApp.LegacyAmino()).
WithInput(os.Stdin)
If we use the appparams.DefaultEncodingConfig()
instead of tempApp := app.NewTmpBabylonApp()
it fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to add std.RegisterInterfaces(encCfg.InterfaceRegistry)
. Otherwise, it does not how to decode the key. See the fix in 942df6e
Closes #63:
eotsd
cli library withcobra
lib to be consistent withfpd
export-pop
andsign-schnorr
because they are not needed for phase-2keys
commands fromcosmos-sdk
keys add
commands to save the public key and key name wrappingExample after change: