0g-chain/x/circuit-breaker/gov-handler.go
rhuairahrighairigh 4989c0938a rough draft
2020-03-04 14:35:16 +00:00

14 lines
431 B
Go

package circuit-breaker
func NewCircuitBreakerProposalHandler(k Keeper) govtypes.Handler {
return func(ctx sdk.Context, content govtypes.Content) sdk.Error {
switch c := content.(type) {
case types.CircuitBreakerProposal:
return keeper.HandleCircuitBreakerProposal(ctx, k, c)
default:
errMsg := fmt.Sprintf("unrecognized circuit-breaker proposal content type: %T", c)
return sdk.ErrUnknownRequest(errMsg)
}
}
}