diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 97590141f7..0865f6be2e 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -45,7 +45,7 @@ func (k msgServer) DesignateConsensusKeyForConsumerChain(goCtx context.Context, if err != nil { return nil, sdkerrors.Wrapf( types.ErrInvalidValidatorPubKey, - "%w; Second error", + "cryptocodec error: %w", err, ) } @@ -69,16 +69,24 @@ func (k msgServer) DesignateConsensusKeyForConsumerChain(goCtx context.Context, if err != nil { return nil, sdkerrors.Wrapf( types.ErrInvalidValidatorPubKey, - "%w; Second error", + "cryptocodec error: %w", err, ) } - k.KeyMap(ctx, msg.ChainId).SetProviderPubKeyToConsumerPubKey( + err = k.KeyMap(ctx, msg.ChainId).SetProviderPubKeyToConsumerPubKey( providerTMPublicKey, consumerTMPublicKey, ) + if err != nil { + return nil, sdkerrors.Wrapf( + types.ErrInvalidValidatorPubKey, + "info: %w", + err, + ) + } + // TODO: emit events? return &types.MsgDesignateConsensusKeyForConsumerChainResponse{}, nil