-
Notifications
You must be signed in to change notification settings - Fork 29
/
proposal_handler.go
33 lines (31 loc) · 1.23 KB
/
proposal_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
33
package ledger
import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/stafihub/stafihub/x/ledger/keeper"
"github.com/stafihub/stafihub/x/ledger/types"
rvotetypes "github.com/stafihub/stafihub/x/rvote/types"
)
// NewParamChangeProposalHandler creates a new governance Handler for a ParamChangeProposal
func NewProposalHandler(k keeper.Keeper) rvotetypes.Handler {
return func(ctx sdk.Context, content rvotetypes.Content) error {
switch c := content.(type) {
case *types.SetChainEraProposal:
return k.ProcessSetChainEraProposal(ctx, c)
case *types.BondReportProposal:
return k.ProcessBondReportProposal(ctx, c)
case *types.ActiveReportProposal:
return k.ProcessActiveReportProposal(ctx, c)
case *types.TransferReportProposal:
return k.ProcessTransferReportProposal(ctx, c)
case *types.ExecuteBondProposal:
return k.ProcessExecuteBondProposal(ctx, c)
case *types.ExecuteNativeAndLsmBondProposal:
return k.ProcessExecuteNativeAndLsmBondProposal(ctx, c)
case *types.InterchainTxProposal:
return k.ProcessInterchainTxProposal(ctx, c)
default:
return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized param proposal content type: %T", c)
}
}
}