diff --git a/app/ante/check_machine_decorator.go b/app/ante/check_machine_decorator.go index d5499a1..0d792b7 100644 --- a/app/ante/check_machine_decorator.go +++ b/app/ante/check_machine_decorator.go @@ -51,21 +51,21 @@ func (cm CheckMachineDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate func (cm CheckMachineDecorator) handleNotarizeAsset(ctx sdk.Context, notarizeMsg *assettypes.MsgNotarizeAsset) (sdk.Context, error) { _, found := cm.mk.GetMachineIndexByAddress(ctx, notarizeMsg.GetCreator()) if !found { - return ctx, errorsmod.Wrapf(machinetypes.ErrMachineNotFound, ErrorAnteContext) + return ctx, errorsmod.Wrap(machinetypes.ErrMachineNotFound, ErrorAnteContext) } return ctx, nil } func (cm CheckMachineDecorator) handleAttestMachine(ctx sdk.Context, attestMsg *machinetypes.MsgAttestMachine) (sdk.Context, error) { if attestMsg.GetCreator() != attestMsg.Machine.GetAddress() { - return ctx, errorsmod.Wrapf(machinetypes.ErrMachineIsNotCreator, ErrorAnteContext) + return ctx, errorsmod.Wrap(machinetypes.ErrMachineIsNotCreator, ErrorAnteContext) } _, activated, found := cm.mk.GetTrustAnchor(ctx, attestMsg.Machine.MachineId) if !found { - return ctx, errorsmod.Wrapf(machinetypes.ErrTrustAnchorNotFound, ErrorAnteContext) + return ctx, errorsmod.Wrap(machinetypes.ErrTrustAnchorNotFound, ErrorAnteContext) } if activated { - return ctx, errorsmod.Wrapf(machinetypes.ErrTrustAnchorAlreadyInUse, ErrorAnteContext) + return ctx, errorsmod.Wrap(machinetypes.ErrTrustAnchorAlreadyInUse, ErrorAnteContext) } return ctx, nil } @@ -73,7 +73,7 @@ func (cm CheckMachineDecorator) handleAttestMachine(ctx sdk.Context, attestMsg * func (cm CheckMachineDecorator) handlePopResult(ctx sdk.Context, popMsg *daotypes.MsgReportPopResult) (sdk.Context, error) { _, found := cm.mk.GetMachineIndexByAddress(ctx, popMsg.GetCreator()) if !found { - return ctx, errorsmod.Wrapf(machinetypes.ErrMachineNotFound, ErrorAnteContext) + return ctx, errorsmod.Wrap(machinetypes.ErrMachineNotFound, ErrorAnteContext) } return ctx, nil } diff --git a/app/ante/check_validator_decorator.go b/app/ante/check_validator_decorator.go index db46075..3d7071e 100644 --- a/app/ante/check_validator_decorator.go +++ b/app/ante/check_validator_decorator.go @@ -53,7 +53,7 @@ func (cv CheckValidatorDecorator) handleMsg(ctx sdk.Context, msg sdk.Msg) (_ sdk signer := msg.GetSigners()[0] _, found := cv.sk.GetValidator(ctx, sdk.ValAddress(signer)) if !found { - return ctx, errorsmod.Wrapf(types.ErrRestrictedMsg, ErrorAnteContext) + return ctx, errorsmod.Wrap(types.ErrRestrictedMsg, ErrorAnteContext) } return ctx, nil } diff --git a/app/ante/deduct_fee_decorator.go b/app/ante/deduct_fee_decorator.go index f14985e..2cb7baf 100644 --- a/app/ante/deduct_fee_decorator.go +++ b/app/ante/deduct_fee_decorator.go @@ -166,7 +166,7 @@ func (dfd DeductFeeDecorator) deductFees(bankKeeper authtypes.BankKeeper, ctx sd err := bankKeeper.SendCoinsFromAccountToModule(ctx, acc.GetAddress(), authtypes.FeeCollectorName, fees) if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, err.Error()) + return errorsmod.Wrap(sdkerrors.ErrInsufficientFunds, err.Error()) } return nil diff --git a/app/ante/setup_context_decorator.go b/app/ante/setup_context_decorator.go index 416033b..2479b6a 100644 --- a/app/ante/setup_context_decorator.go +++ b/app/ante/setup_context_decorator.go @@ -39,7 +39,7 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate // Set a gas meter with limit 0 as to prevent an infinite gas meter attack // during runTx. newCtx = SetGasMeter(simulate, ctx, 0) - return newCtx, errorsmod.Wrapf(sdkerrors.ErrTxDecode, "Tx must be GasTx") + return newCtx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "Tx must be GasTx") } gasLimit := sud.dk.GetTxGasLimit(ctx) @@ -70,7 +70,7 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate "out of gas in location: %v; gasWanted: %d, gasUsed: %d", rType.Descriptor, gasTx.GetGas(), newCtx.GasMeter().GasConsumed()) - err = errorsmod.Wrapf(sdkerrors.ErrOutOfGas, log) + err = errorsmod.Wrap(sdkerrors.ErrOutOfGas, log) default: panic(r) } diff --git a/monitor/mqtt_monitor.go b/monitor/mqtt_monitor.go index e9aa70a..23023f2 100644 --- a/monitor/mqtt_monitor.go +++ b/monitor/mqtt_monitor.go @@ -256,7 +256,7 @@ func IsLegitMachineAddress(address string) (active bool, err error) { // Check the status code if resp.StatusCode != http.StatusOK { - log.Printf("[app] [Monitor] Error: unexpected status code: " + string(body)) + log.Print("[app] [Monitor] Error: unexpected status code: " + string(body)) return } diff --git a/util/logger.go b/util/logger.go index 1ad7fdf..861034a 100644 --- a/util/logger.go +++ b/util/logger.go @@ -54,7 +54,7 @@ func (logger *AppLogger) testingLog(msg string, keyvals ...interface{}) { return } msg = format(msg, keyvals...) - logger.testingLogger.Logf(msg) + logger.testingLogger.Log(msg) } func (logger *AppLogger) Info(ctx sdk.Context, msg string, keyvals ...interface{}) { diff --git a/x/dao/keeper/msg_server_reissue_rddl_proposal.go b/x/dao/keeper/msg_server_reissue_rddl_proposal.go index 5107e6c..dae5d7c 100644 --- a/x/dao/keeper/msg_server_reissue_rddl_proposal.go +++ b/x/dao/keeper/msg_server_reissue_rddl_proposal.go @@ -58,7 +58,7 @@ func (k msgServer) validateReissuanceProposal(ctx sdk.Context, msg *types.MsgRei isValid := k.IsValidReissuanceProposal(ctx, msg) if !isValid { util.GetAppLogger().Info(ctx, reissueTag+"rejected reissuance proposal") - return errorsmod.Wrapf(types.ErrReissuanceProposal, reissueTag) + return errorsmod.Wrap(types.ErrReissuanceProposal, reissueTag) } util.GetAppLogger().Debug(ctx, reissueTag+"accepted reissuance proposal: "+msg.String()) return diff --git a/x/dao/keeper/msg_server_report_pop_result.go b/x/dao/keeper/msg_server_report_pop_result.go index 4f28b70..46847a3 100644 --- a/x/dao/keeper/msg_server_report_pop_result.go +++ b/x/dao/keeper/msg_server_report_pop_result.go @@ -35,7 +35,7 @@ func (k msgServer) ReportPopResult(goCtx context.Context, msg *types.MsgReportPo err := util.ValidateStruct(*msg.Challenge) if err != nil { - return nil, errorsmod.Wrapf(types.ErrInvalidChallenge, err.Error()) + return nil, errorsmod.Wrap(types.ErrInvalidChallenge, err.Error()) } // verify that the report origin is the challenger @@ -64,7 +64,7 @@ func (k msgServer) ReportPopResult(goCtx context.Context, msg *types.MsgReportPo err = k.issuePoPRewards(ctx, *msg.Challenge) if err != nil { - return nil, errorsmod.Wrapf(types.ErrFailedPoPRewardsIssuance, err.Error()) + return nil, errorsmod.Wrap(types.ErrFailedPoPRewardsIssuance, err.Error()) } return &types.MsgReportPopResultResponse{}, nil