chore: Better error msgs when node isn't synced (#11449)
* better err msg by checking node height * get node sync info and check for catching up * small fix * small fix * fix test * add changelog Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
parent
b6d2c1ee9a
commit
a69764f9f0
|
@ -170,6 +170,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|
||||||
|
* [\#11449](https://github.com/cosmos/cosmos-sdk/pull/11449) Improved error messages when node isn't synced.
|
||||||
* [\#11349](https://github.com/cosmos/cosmos-sdk/pull/11349) Add `RegisterAminoMsg` function that checks that a msg name is <40 chars (else this would break ledger nano signing) then registers the concrete msg type with amino, it should be used for registering `sdk.Msg`s with amino instead of `cdc.RegisterConcrete`.
|
* [\#11349](https://github.com/cosmos/cosmos-sdk/pull/11349) Add `RegisterAminoMsg` function that checks that a msg name is <40 chars (else this would break ledger nano signing) then registers the concrete msg type with amino, it should be used for registering `sdk.Msg`s with amino instead of `cdc.RegisterConcrete`.
|
||||||
* [\#11089](https://github.com/cosmos/cosmos-sdk/pull/11089]) Now cosmos-sdk consumers can upgrade gRPC to its newest versions.
|
* [\#11089](https://github.com/cosmos/cosmos-sdk/pull/11089]) Now cosmos-sdk consumers can upgrade gRPC to its newest versions.
|
||||||
* [\#10439](https://github.com/cosmos/cosmos-sdk/pull/10439) Check error for `RegisterQueryHandlerClient` in all modules `RegisterGRPCGatewayRoutes`.
|
* [\#10439](https://github.com/cosmos/cosmos-sdk/pull/10439) Check error for `RegisterQueryHandlerClient` in all modules `RegisterGRPCGatewayRoutes`.
|
||||||
|
|
|
@ -100,6 +100,18 @@ func GetAccountCmd() *cobra.Command {
|
||||||
queryClient := types.NewQueryClient(clientCtx)
|
queryClient := types.NewQueryClient(clientCtx)
|
||||||
res, err := queryClient.Account(cmd.Context(), &types.QueryAccountRequest{Address: key.String()})
|
res, err := queryClient.Account(cmd.Context(), &types.QueryAccountRequest{Address: key.String()})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
node, err2 := clientCtx.GetNode()
|
||||||
|
if err2 != nil {
|
||||||
|
return err2
|
||||||
|
}
|
||||||
|
status, err2 := node.Status(context.Background())
|
||||||
|
if err2 != nil {
|
||||||
|
return err2
|
||||||
|
}
|
||||||
|
catchingUp := status.SyncInfo.CatchingUp
|
||||||
|
if !catchingUp {
|
||||||
|
return errors.Wrapf(err, "your node may be syncing, please check node status using `/status`")
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue