cosmos-sdk/x/mint/client/module_client.go
Alexander Bezobchuk b95ade93bd Merge PR #4011: Mint/Inflation Querier, LCD and CLI
* A few godoc updates

* More minor tweaks and reformatting

* Implement initial minting querier

* Implement stringer interface for minting params

* Minor cleanup

* Add minting CLI commands

* Implement inflation query command

* Implement annual provisions query and CLI command

* Update x/mint/client/module_client.go

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update x/mint/client/module_client.go

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update x/mint/client/module_client.go

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update x/mint/querier.go

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Add minting REST client routes/handlers

* Fix build issues

* Implement querier unit tests

* Update gaiacli docs

* Implement LCD tests

* Update Swagger docs

* Add pending log entry

* add examples

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* revert adding examples

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
2019-04-01 10:28:36 -07:00

48 lines
1.1 KiB
Go

package clientpackage
import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/x/mint"
"github.com/cosmos/cosmos-sdk/x/mint/client/cli"
"github.com/spf13/cobra"
"github.com/tendermint/go-amino"
)
// ModuleClient exports all CLI client functionality from the minting module.
type ModuleClient struct {
storeKey string
cdc *amino.Codec
}
func NewModuleClient(storeKey string, cdc *amino.Codec) ModuleClient {
return ModuleClient{storeKey, cdc}
}
// GetQueryCmd returns the cli query commands for the minting module.
func (mc ModuleClient) GetQueryCmd() *cobra.Command {
mintingQueryCmd := &cobra.Command{
Use: mint.ModuleName,
Short: "Querying commands for the minting module",
}
mintingQueryCmd.AddCommand(
client.GetCommands(
cli.GetCmdQueryParams(mc.cdc),
cli.GetCmdQueryInflation(mc.cdc),
cli.GetCmdQueryAnnualProvisions(mc.cdc),
)...,
)
return mintingQueryCmd
}
// GetTxCmd returns the transaction commands for the minting module.
func (mc ModuleClient) GetTxCmd() *cobra.Command {
mintTxCmd := &cobra.Command{
Use: mint.ModuleName,
Short: "Minting transaction subcommands",
}
return mintTxCmd
}