From 6285203b9c36e876d62f61e83670362c8edbfc3b Mon Sep 17 00:00:00 2001 From: ChengenH Date: Thu, 12 Dec 2024 19:09:31 +0800 Subject: [PATCH] chore: use errors.New to replace fmt.Errorf with no parameters Signed-off-by: ChengenH --- x/blob/types/params.go | 5 +++-- x/mint/types/minter.go | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/x/blob/types/params.go b/x/blob/types/params.go index b852473632..0ca7176564 100644 --- a/x/blob/types/params.go +++ b/x/blob/types/params.go @@ -1,6 +1,7 @@ package types import ( + "errors" "fmt" "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" @@ -67,7 +68,7 @@ func validateGasPerBlobByte(v interface{}) error { } if gasPerBlobByte == 0 { - return fmt.Errorf("gas per blob byte cannot be 0") + return errors.New("gas per blob byte cannot be 0") } return nil @@ -81,7 +82,7 @@ func validateGovMaxSquareSize(v interface{}) error { } if govMaxSquareSize == 0 { - return fmt.Errorf("gov max square size cannot be zero") + return errors.New("gov max square size cannot be zero") } if !square.IsPowerOfTwo(govMaxSquareSize) { diff --git a/x/mint/types/minter.go b/x/mint/types/minter.go index 7adca0bf20..bc2290a1f5 100644 --- a/x/mint/types/minter.go +++ b/x/mint/types/minter.go @@ -1,6 +1,7 @@ package types import ( + "errors" "fmt" "time" @@ -33,7 +34,7 @@ func (m Minter) Validate() error { return fmt.Errorf("annual provisions %v should be positive", m.AnnualProvisions.String()) } if m.BondDenom == "" { - return fmt.Errorf("bond denom should not be empty string") + return errors.New("bond denom should not be empty string") } return nil }