diff --git a/x/dao/keeper/msg_server_reissue_rddl_result.go b/x/dao/keeper/msg_server_reissue_rddl_result.go index def8e2b..32c5b1b 100644 --- a/x/dao/keeper/msg_server_reissue_rddl_result.go +++ b/x/dao/keeper/msg_server_reissue_rddl_result.go @@ -11,19 +11,19 @@ import ( func (k msgServer) ReissueRDDLResult(goCtx context.Context, msg *types.MsgReissueRDDLResult) (*types.MsgReissueRDDLResultResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - + errmsg := " for provided block height %s" reissuance, found := k.LookupReissuance(ctx, msg.GetBlockHeight()) if !found { - return nil, errorsmod.Wrapf(types.ErrReissuanceNotFound, " for provided block height %s", strconv.FormatInt(msg.GetBlockHeight(), 10)) + return nil, errorsmod.Wrapf(types.ErrReissuanceNotFound, errmsg, strconv.FormatInt(msg.GetBlockHeight(), 10)) } if reissuance.GetBlockHeight() != msg.GetBlockHeight() { - return nil, errorsmod.Wrapf(types.ErrWrongBlockHeight, " for provided block height %s", strconv.FormatInt(msg.GetBlockHeight(), 10)) + return nil, errorsmod.Wrapf(types.ErrWrongBlockHeight, errmsg, strconv.FormatInt(msg.GetBlockHeight(), 10)) } if reissuance.GetProposer() != msg.GetProposer() { - return nil, errorsmod.Wrapf(types.ErrInvalidProposer, " for provided block height %s", strconv.FormatInt(msg.GetBlockHeight(), 10)) + return nil, errorsmod.Wrapf(types.ErrInvalidProposer, errmsg, strconv.FormatInt(msg.GetBlockHeight(), 10)) } if reissuance.GetTxID() != "" { - return nil, errorsmod.Wrapf(types.ErrTXAlreadySet, " for provided block height %s", strconv.FormatInt(msg.GetBlockHeight(), 10)) + return nil, errorsmod.Wrapf(types.ErrTXAlreadySet, errmsg, strconv.FormatInt(msg.GetBlockHeight(), 10)) } reissuance.TxID = msg.GetTxID() diff --git a/x/dao/keeper/msg_server_test.go b/x/dao/keeper/msg_server_test.go index e591d34..be230d5 100644 --- a/x/dao/keeper/msg_server_test.go +++ b/x/dao/keeper/msg_server_test.go @@ -31,6 +31,7 @@ func TestMsgServerReportPoPResult(t *testing.T) { initiator := sample.Secp256k1AccAddress() challenger := sample.Secp256k1AccAddress() challengee := sample.Secp256k1AccAddress() + errInvalidPopData := "Invalid pop data" testCases := []struct { name string @@ -81,7 +82,7 @@ func TestMsgServerReportPoPResult(t *testing.T) { "Initiator is not set: invalid challenge", }, { - "Invalid pop data", + errInvalidPopData, types.MsgReportPopResult{ Creator: challenger.String(), Challenge: &types.Challenge{ @@ -96,7 +97,7 @@ func TestMsgServerReportPoPResult(t *testing.T) { "PoP report data does not match challenge: invalid challenge", }, { - "Invalid pop data", + errInvalidPopData, types.MsgReportPopResult{ Creator: challenger.String(), Challenge: &types.Challenge{ @@ -111,7 +112,7 @@ func TestMsgServerReportPoPResult(t *testing.T) { "PoP reporter is not the challenger: invalid PoP reporter", }, { - "Invalid pop data", + errInvalidPopData, types.MsgReportPopResult{ Creator: challenger.String(), Challenge: &types.Challenge{