2019-11-06 13:08:02 -08:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
2020-06-01 05:46:03 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/client"
|
2019-11-06 13:08:02 -08:00
|
|
|
"github.com/cosmos/cosmos-sdk/x/evidence/client/rest"
|
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
// RESTHandlerFn defines a REST service handler for evidence submission
|
2020-06-01 05:46:03 -07:00
|
|
|
RESTHandlerFn func(client.Context) rest.EvidenceRESTHandler
|
2019-11-06 13:08:02 -08:00
|
|
|
|
|
|
|
// CLIHandlerFn defines a CLI command handler for evidence submission
|
2020-07-20 09:42:46 -07:00
|
|
|
CLIHandlerFn func() *cobra.Command
|
2019-11-06 13:08:02 -08:00
|
|
|
|
|
|
|
// EvidenceHandler defines a type that exposes REST and CLI client handlers for
|
|
|
|
// evidence submission.
|
|
|
|
EvidenceHandler struct {
|
|
|
|
CLIHandler CLIHandlerFn
|
|
|
|
RESTHandler RESTHandlerFn
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func NewEvidenceHandler(cliHandler CLIHandlerFn, restHandler RESTHandlerFn) EvidenceHandler {
|
|
|
|
return EvidenceHandler{
|
|
|
|
CLIHandler: cliHandler,
|
|
|
|
RESTHandler: restHandler,
|
|
|
|
}
|
|
|
|
}
|