mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 18:15:19 +00:00
36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
|
package client
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/cosmos/cosmos-sdk/client"
|
||
|
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
|
||
|
govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest"
|
||
|
|
||
|
"github.com/kava-labs/kava/x/community/client/cli"
|
||
|
"github.com/kava-labs/kava/x/community/types"
|
||
|
)
|
||
|
|
||
|
// community-pool deposit/withdraw lend proposal handlers
|
||
|
var (
|
||
|
LendDepositProposalHandler = govclient.NewProposalHandler(
|
||
|
cli.NewCmdSubmitCommunityPoolLendDepositProposal,
|
||
|
notImplementedRestHandler(types.ProposalTypeCommunityPoolLendDeposit),
|
||
|
)
|
||
|
LendWithdrawProposalHandler = govclient.NewProposalHandler(
|
||
|
cli.NewCmdSubmitCommunityPoolLendWithdrawProposal,
|
||
|
notImplementedRestHandler(types.ProposalTypeCommunityPoolLendDeposit),
|
||
|
)
|
||
|
)
|
||
|
|
||
|
func notImplementedRestHandler(subRoute string) govclient.RESTHandlerFn {
|
||
|
return func(ctx client.Context) govrest.ProposalRESTHandler {
|
||
|
return govrest.ProposalRESTHandler{
|
||
|
SubRoute: subRoute,
|
||
|
Handler: func(w http.ResponseWriter, r *http.Request) {
|
||
|
http.Error(w, "Unimplemented", http.StatusNotImplemented)
|
||
|
},
|
||
|
}
|
||
|
}
|
||
|
}
|