Skip to content

Commit

Permalink
Return error in tx body if semantic fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel committed Oct 28, 2022
1 parent ecc9260 commit f86122f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions x/ccv/provider/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}
Expand All @@ -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
Expand Down

0 comments on commit f86122f

Please sign in to comment.