Skip to content

Commit

Permalink
Update fee_pool.go
Browse files Browse the repository at this point in the history
  • Loading branch information
DeVikingMark authored Feb 26, 2025
1 parent 71d2841 commit 298c204
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions x/distribution/types/fee_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ func (f FeePool) ValidateGenesis() error {
return fmt.Errorf("negative DecimalPool in distribution fee pool, is %v", f.DecimalPool)
}

if !f.CommunityPool.IsZero() {
panic(fmt.Sprintf("CommunityPool must be zero in distribution fee pool as it should be specified in protocolpool, current value: %v", f.CommunityPool))
// Negative values in CommunityPool represent an invalid state that should never occur
// We panic instead of returning an error to prevent the chain from starting with an invalid state
if f.CommunityPool.IsAnyNegative() {
panic(fmt.Sprintf("negative CommunityPool in distribution fee pool, is %v", f.CommunityPool))
}

return nil
Expand Down

0 comments on commit 298c204

Please sign in to comment.