Skip to content

Commit

Permalink
Tx CLI proto module interface (cosmos#5989)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Alexander Bezobchuk <[email protected]>

* group vars

Co-authored-by: Alexander Bezobchuk <[email protected]>
  • Loading branch information
aaronc and alexanderbez authored May 21, 2020
1 parent 552a50b commit f32e829
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cmd/simcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ import (
"os"
"path"

"github.com/cosmos/cosmos-sdk/codec"

"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/tendermint/tendermint/libs/cli"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/client/lcd"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
authclient "github.com/cosmos/cosmos-sdk/x/auth/client"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest"
"github.com/cosmos/cosmos-sdk/x/auth/types"
bankcmd "github.com/cosmos/cosmos-sdk/x/bank/client/cli"
)

Expand Down Expand Up @@ -117,8 +118,15 @@ func txCmd(cdc *codec.Codec) *cobra.Command {
RunE: client.ValidateCmd,
}

cliCtx := context.CLIContext{}
cliCtx = cliCtx.
WithJSONMarshaler(appCodec).
WithTxGenerator(types.StdTxGenerator{Cdc: cdc}).
WithAccountRetriever(types.NewAccountRetriever(appCodec)).
WithCodec(cdc)

txCmd.AddCommand(
bankcmd.SendTxCmd(cdc),
bankcmd.NewSendTxCmd(cliCtx),
flags.LineBreak,
authcmd.GetSignCommand(cdc),
authcmd.GetMultiSignCommand(cdc),
Expand All @@ -131,7 +139,7 @@ func txCmd(cdc *codec.Codec) *cobra.Command {
)

// add modules' tx commands
simapp.ModuleBasics.AddTxCommands(txCmd, cdc)
simapp.ModuleBasics.AddTxCommands(txCmd, cliCtx)

return txCmd
}
Expand Down

0 comments on commit f32e829

Please sign in to comment.