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 <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>
  • 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.