Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Apr 11, 2024
1 parent 6aad8db commit 90d99d3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
29 changes: 17 additions & 12 deletions x/emissions/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,39 @@ func DefaultParams() Params {

// Validate validates the set of params
func (p Params) Validate() error {
if err := validateMaxBondFactor(p.MaxBondFactor); err != nil {
return err
}
if err := validateMinBondFactor(p.MinBondFactor); err != nil {
err := validateMaxBondFactor(p.MaxBondFactor)
if err != nil {
return err

Check warning on line 36 in x/emissions/types/params.go

View check run for this annotation

Codecov / codecov/patch

x/emissions/types/params.go#L36

Added line #L36 was not covered by tests
}
if err := validateAvgBlockTime(p.AvgBlockTime); err != nil {
err = validateMinBondFactor(p.MinBondFactor)
if err != nil {
return err

Check warning on line 40 in x/emissions/types/params.go

View check run for this annotation

Codecov / codecov/patch

x/emissions/types/params.go#L40

Added line #L40 was not covered by tests
}
if err := validateTargetBondRatio(p.TargetBondRatio); err != nil {
err = validateAvgBlockTime(p.AvgBlockTime)
if err != nil {
return err

Check warning on line 44 in x/emissions/types/params.go

View check run for this annotation

Codecov / codecov/patch

x/emissions/types/params.go#L44

Added line #L44 was not covered by tests
}
if err := validateValidatorEmissionPercentage(p.ValidatorEmissionPercentage); err != nil {
err = validateTargetBondRatio(p.TargetBondRatio)
if err != nil {
return err

Check warning on line 48 in x/emissions/types/params.go

View check run for this annotation

Codecov / codecov/patch

x/emissions/types/params.go#L48

Added line #L48 was not covered by tests
}
if err := validateObserverEmissionPercentage(p.ObserverEmissionPercentage); err != nil {
err = validateValidatorEmissionPercentage(p.ValidatorEmissionPercentage)
if err != nil {
return err

Check warning on line 52 in x/emissions/types/params.go

View check run for this annotation

Codecov / codecov/patch

x/emissions/types/params.go#L52

Added line #L52 was not covered by tests
}
if err := validateTssEmissionPercentage(p.TssSignerEmissionPercentage); err != nil {
err = validateObserverEmissionPercentage(p.ObserverEmissionPercentage)
if err != nil {
return err

Check warning on line 56 in x/emissions/types/params.go

View check run for this annotation

Codecov / codecov/patch

x/emissions/types/params.go#L56

Added line #L56 was not covered by tests
}
if err := validateDurationFactorConstant(p.DurationFactorConstant); err != nil {
err = validateTssEmissionPercentage(p.TssSignerEmissionPercentage)
if err != nil {
return err

Check warning on line 60 in x/emissions/types/params.go

View check run for this annotation

Codecov / codecov/patch

x/emissions/types/params.go#L60

Added line #L60 was not covered by tests
}
if err := validateObserverSlashAmount(p.ObserverSlashAmount); err != nil {
err = validateDurationFactorConstant(p.DurationFactorConstant)
if err != nil {
return err

Check warning on line 64 in x/emissions/types/params.go

View check run for this annotation

Codecov / codecov/patch

x/emissions/types/params.go#L64

Added line #L64 was not covered by tests
}
return nil
return validateObserverSlashAmount(p.ObserverSlashAmount)
}

// String implements the Stringer interface.
Expand Down
8 changes: 3 additions & 5 deletions x/observer/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ func DefaultAdminPolicy() []*Admin_Policy {

// Validate validates the set of params
func (p Params) Validate() error {
if err := validateAdminPolicy(p.AdminPolicy); err != nil {
return err
}
if err := validateBallotMaturityBlocks(p.BallotMaturityBlocks); err != nil {
err := validateAdminPolicy(p.AdminPolicy)
if err != nil {
return err

Check warning on line 53 in x/observer/types/params.go

View check run for this annotation

Codecov / codecov/patch

x/observer/types/params.go#L53

Added line #L53 was not covered by tests
}
return nil
return validateBallotMaturityBlocks(p.BallotMaturityBlocks)
}

// String implements the Stringer interface.
Expand Down

0 comments on commit 90d99d3

Please sign in to comment.