From c32cace3b9a80bbad72afefa0b83bd78e00b6e16 Mon Sep 17 00:00:00 2001 From: brewmaster012 <88689859+brewmaster012@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:52:42 -0600 Subject: [PATCH] revise more error message --- x/observer/keeper/msg_server_add_block_header.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/observer/keeper/msg_server_add_block_header.go b/x/observer/keeper/msg_server_add_block_header.go index da76e41740..84f7fa6024 100644 --- a/x/observer/keeper/msg_server_add_block_header.go +++ b/x/observer/keeper/msg_server_add_block_header.go @@ -36,7 +36,7 @@ func (k msgServer) AddBlockHeader(goCtx context.Context, msg *types.MsgAddBlockH _, found = k.GetBlockHeader(ctx, msg.BlockHash) if found { - return nil, cosmoserrors.Wrap(types.ErrBlockAlreadyExist, msg.BlockHash) + return nil, cosmoserrors.Wrap(types.ErrBlockAlreadyExist, fmt.Sprintf("block hash: %x", msg.BlockHash)) } bhs, found := k.Keeper.GetBlockHeaderState(ctx, msg.ChainId) @@ -45,7 +45,7 @@ func (k msgServer) AddBlockHeader(goCtx context.Context, msg *types.MsgAddBlockH if err != nil { return nil, cosmoserrors.Wrap(types.ErrNoParentHash, err.Error()) } - _, found = k.GetBlockHeader(ctx, phash) + _, found = k.GetBlockHeader(ctx, pHash) if !found { return nil, cosmoserrors.Wrap(types.ErrNoParentHash, "parent block header not found") }