-
Notifications
You must be signed in to change notification settings - Fork 589
/
handler.go
32 lines (26 loc) · 1.15 KB
/
handler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package pool_incentives
import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/osmosis-labs/osmosis/v10/x/pool-incentives/keeper"
"github.com/osmosis-labs/osmosis/v10/x/pool-incentives/types"
)
func NewPoolIncentivesProposalHandler(k keeper.Keeper) govtypes.Handler {
return func(ctx sdk.Context, content govtypes.Content) error {
switch c := content.(type) {
case *types.UpdatePoolIncentivesProposal:
return handleUpdatePoolIncentivesProposal(ctx, k, c)
case *types.ReplacePoolIncentivesProposal:
return handleReplacePoolIncentivesProposal(ctx, k, c)
default:
return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized pool incentives proposal content type: %T", c)
}
}
}
func handleReplacePoolIncentivesProposal(ctx sdk.Context, k keeper.Keeper, p *types.ReplacePoolIncentivesProposal) error {
return k.HandleReplacePoolIncentivesProposal(ctx, p)
}
func handleUpdatePoolIncentivesProposal(ctx sdk.Context, k keeper.Keeper, p *types.UpdatePoolIncentivesProposal) error {
return k.HandleUpdatePoolIncentivesProposal(ctx, p)
}