various linter fixes (#8666)
This commit is contained in:
+2
-13
@@ -80,8 +80,6 @@ func precisionMultiplier(prec int64) *big.Int {
|
||||
return precisionMultipliers[prec]
|
||||
}
|
||||
|
||||
//______________________________________________________________________________________________
|
||||
|
||||
// create a new Dec from integer assuming whole number
|
||||
func NewDec(i int64) Dec {
|
||||
return NewDecWithPrec(i, 0)
|
||||
@@ -195,8 +193,6 @@ func MustNewDecFromStr(s string) Dec {
|
||||
return dec
|
||||
}
|
||||
|
||||
//______________________________________________________________________________________________
|
||||
//nolint
|
||||
func (d Dec) IsNil() bool { return d.i == nil } // is decimal nil
|
||||
func (d Dec) IsZero() bool { return (d.i).Sign() == 0 } // is equal to zero
|
||||
func (d Dec) IsNegative() bool { return (d.i).Sign() == -1 } // is negative
|
||||
@@ -215,8 +211,8 @@ func (d Dec) BigInt() *big.Int {
|
||||
return nil
|
||||
}
|
||||
|
||||
copy := new(big.Int)
|
||||
return copy.Set(d.i)
|
||||
cp := new(big.Int)
|
||||
return cp.Set(d.i)
|
||||
}
|
||||
|
||||
// addition
|
||||
@@ -561,8 +557,6 @@ func (d Dec) RoundInt() Int {
|
||||
return NewIntFromBigInt(chopPrecisionAndRoundNonMutative(d.i))
|
||||
}
|
||||
|
||||
//___________________________________________________________________________________
|
||||
|
||||
// similar to chopPrecisionAndRound, but always rounds down
|
||||
func chopPrecisionAndTruncate(d *big.Int) *big.Int {
|
||||
return d.Quo(d, precisionReuse)
|
||||
@@ -612,8 +606,6 @@ func (d Dec) Ceil() Dec {
|
||||
return NewDecFromBigInt(quo.Add(quo, oneInt))
|
||||
}
|
||||
|
||||
//___________________________________________________________________________________
|
||||
|
||||
// MaxSortableDec is the largest Dec that can be passed into SortableDecBytes()
|
||||
// Its negative form is the least Dec that can be passed in.
|
||||
var MaxSortableDec = OneDec().Quo(SmallestDec())
|
||||
@@ -648,8 +640,6 @@ func SortableDecBytes(dec Dec) []byte {
|
||||
return []byte(fmt.Sprintf(fmt.Sprintf("%%0%ds", Precision*2+1), dec.String()))
|
||||
}
|
||||
|
||||
//___________________________________________________________________________________
|
||||
|
||||
// reuse nil values
|
||||
var nilJSON []byte
|
||||
|
||||
@@ -758,7 +748,6 @@ func (dp DecProto) String() string {
|
||||
return dp.Dec.String()
|
||||
}
|
||||
|
||||
//___________________________________________________________________________________
|
||||
// helpers
|
||||
|
||||
// test if two decimal arrays are equal
|
||||
|
||||
@@ -29,8 +29,6 @@ func (s *decimalTestSuite) mustNewDecFromStr(str string) (d sdk.Dec) {
|
||||
return d
|
||||
}
|
||||
|
||||
//_______________________________________
|
||||
|
||||
func (s *decimalTestSuite) TestNewDecFromStr() {
|
||||
largeBigInt, success := new(big.Int).SetString("3144605511029693144278234343371835", 10)
|
||||
s.Require().True(success)
|
||||
|
||||
@@ -15,7 +15,6 @@ const UndefinedCodespace = "undefined"
|
||||
|
||||
var (
|
||||
// errInternal should never be exposed, but we reserve this code for non-specified errors
|
||||
//nolint
|
||||
errInternal = Register(UndefinedCodespace, 1, "internal")
|
||||
|
||||
// ErrTxDecode is returned if we cannot parse a transaction
|
||||
|
||||
@@ -43,8 +43,6 @@ import (
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
)
|
||||
|
||||
//__________________________________________________________________________________________
|
||||
|
||||
// AppModuleBasic is the standard form for basic non-dependant elements of an application module.
|
||||
type AppModuleBasic interface {
|
||||
Name() string
|
||||
@@ -146,8 +144,6 @@ func (bm BasicManager) AddQueryCommands(rootQueryCmd *cobra.Command) {
|
||||
}
|
||||
}
|
||||
|
||||
//_________________________________________________________
|
||||
|
||||
// AppModuleGenesis is the standard form for an application module genesis functions
|
||||
type AppModuleGenesis interface {
|
||||
AppModuleBasic
|
||||
@@ -186,8 +182,6 @@ type AppModule interface {
|
||||
EndBlock(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate
|
||||
}
|
||||
|
||||
//___________________________
|
||||
|
||||
// GenesisOnlyAppModule is an AppModule that only has import/export functionality
|
||||
type GenesisOnlyAppModule struct {
|
||||
AppModuleGenesis
|
||||
@@ -226,8 +220,6 @@ func (GenesisOnlyAppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []ab
|
||||
return []abci.ValidatorUpdate{}
|
||||
}
|
||||
|
||||
//____________________________________________________________________________
|
||||
|
||||
// Manager defines a module manager that provides the high level utility for managing and executing
|
||||
// operations for a group of modules
|
||||
type Manager struct {
|
||||
|
||||
@@ -6,8 +6,8 @@ type Config struct {
|
||||
ParamsFile string // custom simulation params file which overrides any random params; cannot be used with genesis
|
||||
|
||||
ExportParamsPath string // custom file path to save the exported params JSON
|
||||
ExportParamsHeight int //height to which export the randomly generated params
|
||||
ExportStatePath string //custom file path to save the exported app state JSON
|
||||
ExportParamsHeight int // height to which export the randomly generated params
|
||||
ExportStatePath string // custom file path to save the exported app state JSON
|
||||
ExportStatsPath string // custom file path to save the exported simulation statistics JSON
|
||||
|
||||
Seed int64 // simulation random seed
|
||||
|
||||
@@ -125,8 +125,6 @@ func (om OperationMsg) LogEvent(eventLogger func(route, op, evResult string)) {
|
||||
eventLogger(om.Route, om.Name, pass)
|
||||
}
|
||||
|
||||
//________________________________________________________________________
|
||||
|
||||
// FutureOperation is an operation which will be ran at the beginning of the
|
||||
// provided BlockHeight. If both a BlockHeight and BlockTime are specified, it
|
||||
// will use the BlockHeight. In the (likely) event that multiple operations
|
||||
|
||||
@@ -207,8 +207,6 @@ func (u *Uint) Size() int {
|
||||
func (u Uint) MarshalAmino() ([]byte, error) { return u.Marshal() }
|
||||
func (u *Uint) UnmarshalAmino(bz []byte) error { return u.Unmarshal(bz) }
|
||||
|
||||
//__________________________________________________________________________
|
||||
|
||||
// UintOverflow returns true if a given unsigned integer overflows and false
|
||||
// otherwise.
|
||||
func UintOverflow(i *big.Int) error {
|
||||
|
||||
Reference in New Issue
Block a user