0g-chain/x/kavadist/keeper/proposal_handler.go
Robert Pirtle 05a705be79
remove x/community references (#1454)
* remove new community pool from earn

* remove x/community from kavadist

* remove overridden community-pool query
2023-01-26 10:01:28 -07:00

24 lines
777 B
Go

package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/kava-labs/kava/x/kavadist/types"
)
// HandleCommunityPoolMultiSpendProposal is a handler for executing a passed community multi-spend proposal
func HandleCommunityPoolMultiSpendProposal(ctx sdk.Context, k Keeper, p *types.CommunityPoolMultiSpendProposal) error {
for _, receiverInfo := range p.RecipientList {
if k.blacklistedAddrs[receiverInfo.Address] {
return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is blacklisted from receiving external funds", receiverInfo.Address)
}
err := k.distKeeper.DistributeFromFeePool(ctx, receiverInfo.Amount, receiverInfo.GetAddress())
if err != nil {
return err
}
}
return nil
}