From ae5812b7a65ac5b57ddfba6a428f5b899279ff85 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:13:25 -0500 Subject: [PATCH] fix wrapf --- protocol/x/delaymsg/keeper/delayed_message.go | 2 +- protocol/x/prices/keeper/market_param_test.go | 2 +- protocol/x/vest/types/vest_entry.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/protocol/x/delaymsg/keeper/delayed_message.go b/protocol/x/delaymsg/keeper/delayed_message.go index 23afda663f..dd3395e62e 100644 --- a/protocol/x/delaymsg/keeper/delayed_message.go +++ b/protocol/x/delaymsg/keeper/delayed_message.go @@ -188,7 +188,7 @@ func validateSigners(signers [][]byte) error { ) } if !bytes.Equal(signers[0], types.ModuleAddress) { - return errorsmod.Wrapf( + return errorsmod.Wrap( types.ErrInvalidSigner, "message signer must be delaymsg module address", ) diff --git a/protocol/x/prices/keeper/market_param_test.go b/protocol/x/prices/keeper/market_param_test.go index f74f07f18e..89ebd1cc64 100644 --- a/protocol/x/prices/keeper/market_param_test.go +++ b/protocol/x/prices/keeper/market_param_test.go @@ -228,7 +228,7 @@ func TestModifyMarketParam_Errors(t *testing.T) { minExchanges: uint32(1), minPriceChangePpm: uint32(50), exchangeConfigJson: validExchangeConfigJson, - expectedErr: errorsmod.Wrapf( + expectedErr: errorsmod.Wrap( types.ErrMarketParamPairAlreadyExists, "1-1", ).Error(), diff --git a/protocol/x/vest/types/vest_entry.go b/protocol/x/vest/types/vest_entry.go index 2f6b4b4d2f..babf8c64ad 100644 --- a/protocol/x/vest/types/vest_entry.go +++ b/protocol/x/vest/types/vest_entry.go @@ -7,11 +7,11 @@ import ( func (entry VestEntry) Validate() error { if entry.VesterAccount == "" { - return errorsmod.Wrapf(ErrInvalidVesterAccount, "vester account cannot be empty") + return errorsmod.Wrap(ErrInvalidVesterAccount, "vester account cannot be empty") } if entry.TreasuryAccount == "" { - return errorsmod.Wrapf(ErrInvalidTreasuryAccount, "treasury account cannot be empty") + return errorsmod.Wrap(ErrInvalidTreasuryAccount, "treasury account cannot be empty") } if err := sdk.ValidateDenom(entry.Denom); err != nil { @@ -23,11 +23,11 @@ func (entry VestEntry) Validate() error { } if entry.StartTime.Location().String() != "UTC" { - return errorsmod.Wrapf(ErrInvalidTimeZone, "start_time must be in UTC") + return errorsmod.Wrap(ErrInvalidTimeZone, "start_time must be in UTC") } if entry.EndTime.Location().String() != "UTC" { - return errorsmod.Wrapf(ErrInvalidTimeZone, "end_time must be in UTC") + return errorsmod.Wrap(ErrInvalidTimeZone, "end_time must be in UTC") } return nil }