* WIP * WIP * WIP on removing x/auth dependency from client/tx * Revert unneeded changes * Simplify cli tx UX * Wire up bank tx REST routes * Fix assignment issue * Wire up bank NewSendTxCmd * fix lint * revert file * revert file * fix simcli * Refactor AccountRetriever * Fix build * Fix build * Fix build * Fix integration tests * Fix tests * Docs, linting * Linting * WIP on all modules * Implement other module new tx cmd's * Fix cmd's * Refactor existing GetTxCmd * Fix cmd * Removing deprecated code * Update ADR 020 & CHANGELOG * Lint * Lint * Lint * Lint * Lint * Lint * Lint * Fix client/tx tests * Fix mocks * Fix tests * Lint fixes * REST tx migration * Wire up REST * Linting * Update CHANGELOG, docs * Fix tests * lint * Address review feedback * Update CHANGELOG.md Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> * Update CHANGELOG.md Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> * group vars Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
29 lines
748 B
Go
29 lines
748 B
Go
package client
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/cosmos/cosmos-sdk/client/context"
|
|
"github.com/cosmos/cosmos-sdk/x/gov/client/rest"
|
|
)
|
|
|
|
// function to create the rest handler
|
|
type RESTHandlerFn func(context.CLIContext) rest.ProposalRESTHandler
|
|
|
|
// function to create the cli handler
|
|
type CLIHandlerFn func(context.CLIContext) *cobra.Command
|
|
|
|
// The combined type for a proposal handler for both cli and rest
|
|
type ProposalHandler struct {
|
|
CLIHandler CLIHandlerFn
|
|
RESTHandler RESTHandlerFn
|
|
}
|
|
|
|
// NewProposalHandler creates a new ProposalHandler object
|
|
func NewProposalHandler(cliHandler CLIHandlerFn, restHandler RESTHandlerFn) ProposalHandler {
|
|
return ProposalHandler{
|
|
CLIHandler: cliHandler,
|
|
RESTHandler: restHandler,
|
|
}
|
|
}
|