Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(x/distribution): panic on set community pool #23507

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions x/distribution/types/fee_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func (f FeePool) ValidateGenesis() error {
return fmt.Errorf("negative DecimalPool in distribution fee pool, is %v", f.DecimalPool)
}

if f.CommunityPool.IsAnyNegative() { // TODO(@julienrbrt) in v0.53, panic if the community pool is set
return fmt.Errorf("negative CommunityPool in distribution fee pool, is %v", f.CommunityPool)
if f.CommunityPool.IsAnyNegative() {
Copy link
Member

@julienrbrt julienrbrt Jan 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment means to panic if it is set at all, as it should be specified in protocolpool.

Copy link
Author

@DeVikingMark DeVikingMark Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment means to panic if it is set at all, as it should be specified in protocolpool.

@julienrbrt Made an update and it seems that code works as expected—if CommunityPool has any non-zero value, it triggers a panic because those values should now be set in the protocolpool module.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

panic(fmt.Sprintf("negative CommunityPool in distribution fee pool, is %v", f.CommunityPool))
}

return nil
Expand Down
Loading