From acd125029d8a4d8c61e9f9a56921513fa401732f Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Fri, 7 Sep 2018 10:04:58 -0700 Subject: [PATCH] x/auth/client/context -> x/auth/client/txbuilder --- client/utils/rest.go | 4 ++-- client/utils/utils.go | 14 +++++++------- examples/democoin/x/cool/client/cli/tx.go | 6 +++--- examples/democoin/x/pow/client/cli/tx.go | 4 ++-- .../x/simplestake/client/cli/commands.go | 6 +++--- .../context.go => txbuilder/txbuilder.go} | 0 x/auth/client/{context => txbuilder}/utils.go | 0 x/bank/client/cli/sendtx.go | 4 ++-- x/bank/client/rest/sendtx.go | 4 ++-- x/gov/client/cli/tx.go | 8 ++++---- x/gov/client/rest/util.go | 4 ++-- x/ibc/client/cli/ibctx.go | 4 ++-- x/ibc/client/cli/relay.go | 4 ++-- x/ibc/client/rest/transfer.go | 4 ++-- x/slashing/client/cli/tx.go | 4 ++-- x/slashing/client/rest/tx.go | 4 ++-- x/stake/client/cli/tx.go | 16 ++++++++-------- x/stake/client/rest/tx.go | 4 ++-- 18 files changed, 47 insertions(+), 47 deletions(-) rename x/auth/client/{context/context.go => txbuilder/txbuilder.go} (100%) rename x/auth/client/{context => txbuilder}/utils.go (100%) diff --git a/client/utils/rest.go b/client/utils/rest.go index 6446fb1337..ea85dfa74c 100644 --- a/client/utils/rest.go +++ b/client/utils/rest.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" auth "github.com/cosmos/cosmos-sdk/x/auth" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" ) const ( @@ -52,7 +52,7 @@ func ParseFloat64OrReturnBadRequest(w http.ResponseWriter, s string, defaultIfEm } // WriteGenerateStdTxResponse writes response for the generate_only mode. -func WriteGenerateStdTxResponse(w http.ResponseWriter, txBld authctx.TxBuilder, msgs []sdk.Msg) { +func WriteGenerateStdTxResponse(w http.ResponseWriter, txBld authtxb.TxBuilder, msgs []sdk.Msg) { stdMsg, err := txBld.Build(msgs) if err != nil { WriteErrorResponse(w, http.StatusBadRequest, err.Error()) diff --git a/client/utils/utils.go b/client/utils/utils.go index 32cc810006..341bba9a5d 100644 --- a/client/utils/utils.go +++ b/client/utils/utils.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/keys" sdk "github.com/cosmos/cosmos-sdk/types" auth "github.com/cosmos/cosmos-sdk/x/auth" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" amino "github.com/tendermint/go-amino" "github.com/tendermint/tendermint/libs/common" ) @@ -18,7 +18,7 @@ import ( // ensures that the account exists, has a proper number and sequence set. In // addition, it builds and signs a transaction with the supplied messages. // Finally, it broadcasts the signed transaction to a node. -func SendTx(txBld authctx.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) error { +func SendTx(txBld authtxb.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) error { txBld, err := prepareTxContext(txBld, cliCtx) if err != nil { return err @@ -50,7 +50,7 @@ func SendTx(txBld authctx.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) } // SimulateMsgs simulates the transaction and returns the gas estimate and the adjusted value. -func SimulateMsgs(txBld authctx.TxBuilder, cliCtx context.CLIContext, name string, msgs []sdk.Msg, gas int64) (estimated, adjusted int64, err error) { +func SimulateMsgs(txBld authtxb.TxBuilder, cliCtx context.CLIContext, name string, msgs []sdk.Msg, gas int64) (estimated, adjusted int64, err error) { txBytes, err := txBld.WithGas(gas).BuildWithPubKey(name, msgs) if err != nil { return @@ -61,7 +61,7 @@ func SimulateMsgs(txBld authctx.TxBuilder, cliCtx context.CLIContext, name strin // EnrichCtxWithGas calculates the gas estimate that would be consumed by the // transaction and set the transaction's respective value accordingly. -func EnrichCtxWithGas(txBld authctx.TxBuilder, cliCtx context.CLIContext, name string, msgs []sdk.Msg) (authctx.TxBuilder, error) { +func EnrichCtxWithGas(txBld authtxb.TxBuilder, cliCtx context.CLIContext, name string, msgs []sdk.Msg) (authtxb.TxBuilder, error) { _, adjusted, err := SimulateMsgs(txBld, cliCtx, name, msgs, 0) if err != nil { return txBld, err @@ -87,7 +87,7 @@ func CalculateGas(queryFunc func(string, common.HexBytes) ([]byte, error), cdc * } // PrintUnsignedStdTx builds an unsigned StdTx and prints it to os.Stdout. -func PrintUnsignedStdTx(txBld authctx.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) (err error) { +func PrintUnsignedStdTx(txBld authtxb.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) (err error) { stdTx, err := buildUnsignedStdTx(txBld, cliCtx, msgs) if err != nil { return @@ -111,7 +111,7 @@ func parseQueryResponse(cdc *amino.Codec, rawRes []byte) (int64, error) { return simulationResult.GasUsed, nil } -func prepareTxContext(txBld authctx.TxBuilder, cliCtx context.CLIContext) (authctx.TxBuilder, error) { +func prepareTxContext(txBld authtxb.TxBuilder, cliCtx context.CLIContext) (authtxb.TxBuilder, error) { if err := cliCtx.EnsureAccountExists(); err != nil { return txBld, err } @@ -145,7 +145,7 @@ func prepareTxContext(txBld authctx.TxBuilder, cliCtx context.CLIContext) (authc // buildUnsignedStdTx builds a StdTx as per the parameters passed in the // contexts. Gas is automatically estimated if gas wanted is set to 0. -func buildUnsignedStdTx(txBld authctx.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) (stdTx auth.StdTx, err error) { +func buildUnsignedStdTx(txBld authtxb.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) (stdTx auth.StdTx, err error) { txBld, err = prepareTxContext(txBld, cliCtx) if err != nil { return diff --git a/examples/democoin/x/cool/client/cli/tx.go b/examples/democoin/x/cool/client/cli/tx.go index 0134a1ea62..abdfcb2401 100644 --- a/examples/democoin/x/cool/client/cli/tx.go +++ b/examples/democoin/x/cool/client/cli/tx.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" ) // QuizTxCmd invokes the coolness quiz transaction. @@ -21,7 +21,7 @@ func QuizTxCmd(cdc *wire.Codec) *cobra.Command { Short: "What's cooler than being cool?", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). @@ -46,7 +46,7 @@ func SetTrendTxCmd(cdc *wire.Codec) *cobra.Command { Short: "You're so cool, tell us what is cool!", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). diff --git a/examples/democoin/x/pow/client/cli/tx.go b/examples/democoin/x/pow/client/cli/tx.go index 820dd105c6..3b576da880 100644 --- a/examples/democoin/x/pow/client/cli/tx.go +++ b/examples/democoin/x/pow/client/cli/tx.go @@ -10,7 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/spf13/cobra" ) @@ -22,7 +22,7 @@ func MineCmd(cdc *wire.Codec) *cobra.Command { Short: "Mine some coins with proof-of-work!", Args: cobra.ExactArgs(4), RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). diff --git a/examples/democoin/x/simplestake/client/cli/commands.go b/examples/democoin/x/simplestake/client/cli/commands.go index f8bd075de4..75a5cacc8c 100644 --- a/examples/democoin/x/simplestake/client/cli/commands.go +++ b/examples/democoin/x/simplestake/client/cli/commands.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -30,7 +30,7 @@ func BondTxCmd(cdc *wire.Codec) *cobra.Command { Use: "bond", Short: "Bond to a validator", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). @@ -84,7 +84,7 @@ func UnbondTxCmd(cdc *wire.Codec) *cobra.Command { Use: "unbond", Short: "Unbond from a validator", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout) diff --git a/x/auth/client/context/context.go b/x/auth/client/txbuilder/txbuilder.go similarity index 100% rename from x/auth/client/context/context.go rename to x/auth/client/txbuilder/txbuilder.go diff --git a/x/auth/client/context/utils.go b/x/auth/client/txbuilder/utils.go similarity index 100% rename from x/auth/client/context/utils.go rename to x/auth/client/txbuilder/utils.go diff --git a/x/bank/client/cli/sendtx.go b/x/bank/client/cli/sendtx.go index 98fb3e9843..1ea3a27ef9 100644 --- a/x/bank/client/cli/sendtx.go +++ b/x/bank/client/cli/sendtx.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/bank/client" "github.com/pkg/errors" @@ -27,7 +27,7 @@ func SendTxCmd(cdc *wire.Codec) *cobra.Command { Use: "send", Short: "Create and sign a send tx", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). diff --git a/x/bank/client/rest/sendtx.go b/x/bank/client/rest/sendtx.go index f0d2d6308d..436803c628 100644 --- a/x/bank/client/rest/sendtx.go +++ b/x/bank/client/rest/sendtx.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/bank" "github.com/cosmos/cosmos-sdk/x/bank/client" @@ -80,7 +80,7 @@ func SendRequestHandlerFn(cdc *wire.Codec, kb keys.Keybase, cliCtx context.CLICo return } - txBld := authctx.TxBuilder{ + txBld := authtxb.TxBuilder{ Codec: cdc, Gas: m.Gas, ChainID: m.ChainID, diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index da828e513a..6eb7a30582 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/gov" "encoding/json" @@ -77,7 +77,7 @@ $ gaiacli gov submit-proposal --title="Test Proposal" --description="My awesome return err } - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). @@ -161,7 +161,7 @@ func GetCmdDeposit(cdc *wire.Codec) *cobra.Command { Use: "deposit", Short: "deposit tokens for activing proposal", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). @@ -207,7 +207,7 @@ func GetCmdVote(cdc *wire.Codec) *cobra.Command { Use: "vote", Short: "vote for an active proposal, options: Yes/No/NoWithVeto/Abstain", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). diff --git a/x/gov/client/rest/util.go b/x/gov/client/rest/util.go index f8152042e3..83160ecd0e 100644 --- a/x/gov/client/rest/util.go +++ b/x/gov/client/rest/util.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/utils" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" ) type baseReq struct { @@ -70,7 +70,7 @@ func (req baseReq) baseReqValidate(w http.ResponseWriter) bool { // (probably should live in client/lcd). func signAndBuild(w http.ResponseWriter, r *http.Request, cliCtx context.CLIContext, baseReq baseReq, msg sdk.Msg, cdc *wire.Codec) { var err error - txBld := authctx.TxBuilder{ + txBld := authtxb.TxBuilder{ Codec: cdc, AccountNumber: baseReq.AccountNumber, Sequence: baseReq.Sequence, diff --git a/x/ibc/client/cli/ibctx.go b/x/ibc/client/cli/ibctx.go index 9c20a44f71..a8b90a6713 100644 --- a/x/ibc/client/cli/ibctx.go +++ b/x/ibc/client/cli/ibctx.go @@ -10,7 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" wire "github.com/cosmos/cosmos-sdk/wire" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/ibc" "github.com/spf13/cobra" @@ -28,7 +28,7 @@ func IBCTransferCmd(cdc *wire.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "transfer", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). diff --git a/x/ibc/client/cli/relay.go b/x/ibc/client/cli/relay.go index 1bb679987b..d274edd49a 100644 --- a/x/ibc/client/cli/relay.go +++ b/x/ibc/client/cli/relay.go @@ -10,7 +10,7 @@ import ( wire "github.com/cosmos/cosmos-sdk/wire" "github.com/cosmos/cosmos-sdk/x/auth" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/ibc" "github.com/spf13/cobra" @@ -199,7 +199,7 @@ func (c relayCommander) refine(bz []byte, sequence int64, passphrase string) []b Sequence: sequence, } - txBld := authctx.NewTxBuilderFromCLI().WithSequence(sequence).WithCodec(c.cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithSequence(sequence).WithCodec(c.cdc) cliCtx := context.NewCLIContext() res, err := txBld.BuildAndSign(cliCtx.FromAddressName, passphrase, []sdk.Msg{msg}) diff --git a/x/ibc/client/rest/transfer.go b/x/ibc/client/rest/transfer.go index c071e48d14..5367bc88b3 100644 --- a/x/ibc/client/rest/transfer.go +++ b/x/ibc/client/rest/transfer.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/ibc" "github.com/gorilla/mux" @@ -71,7 +71,7 @@ func TransferRequestHandlerFn(cdc *wire.Codec, kb keys.Keybase, cliCtx context.C packet := ibc.NewIBCPacket(sdk.AccAddress(info.GetPubKey().Address()), to, m.Amount, m.SrcChainID, destChainID) msg := ibc.IBCTransferMsg{packet} - txBld := authctx.TxBuilder{ + txBld := authtxb.TxBuilder{ Codec: cdc, ChainID: m.SrcChainID, AccountNumber: m.AccountNumber, diff --git a/x/slashing/client/cli/tx.go b/x/slashing/client/cli/tx.go index 60c89a2cb0..86abdeade7 100644 --- a/x/slashing/client/cli/tx.go +++ b/x/slashing/client/cli/tx.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/spf13/cobra" @@ -21,7 +21,7 @@ func GetCmdUnjail(cdc *wire.Codec) *cobra.Command { Args: cobra.NoArgs, Short: "unjail validator previously jailed for downtime", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). diff --git a/x/slashing/client/rest/tx.go b/x/slashing/client/rest/tx.go index 4c07515cbd..b8e4c46547 100644 --- a/x/slashing/client/rest/tx.go +++ b/x/slashing/client/rest/tx.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/gorilla/mux" @@ -70,7 +70,7 @@ func unjailRequestHandlerFn(cdc *wire.Codec, kb keys.Keybase, cliCtx context.CLI return } - txBld := authctx.TxBuilder{ + txBld := authtxb.TxBuilder{ Codec: cdc, ChainID: m.ChainID, AccountNumber: m.AccountNumber, diff --git a/x/stake/client/cli/tx.go b/x/stake/client/cli/tx.go index a103932c36..b93fdb1f46 100644 --- a/x/stake/client/cli/tx.go +++ b/x/stake/client/cli/tx.go @@ -10,7 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - authctx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/stake" "github.com/cosmos/cosmos-sdk/x/stake/types" @@ -25,7 +25,7 @@ func GetCmdCreateValidator(cdc *wire.Codec) *cobra.Command { Use: "create-validator", Short: "create new validator initialized with a self-delegation to it", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). @@ -99,7 +99,7 @@ func GetCmdEditValidator(cdc *wire.Codec) *cobra.Command { Use: "edit-validator", Short: "edit and existing validator account", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). @@ -138,7 +138,7 @@ func GetCmdDelegate(cdc *wire.Codec) *cobra.Command { Use: "delegate", Short: "delegate liquid tokens to an validator", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). @@ -197,7 +197,7 @@ func GetCmdBeginRedelegate(storeName string, cdc *wire.Codec) *cobra.Command { Use: "begin", Short: "begin redelegation", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). @@ -301,7 +301,7 @@ func GetCmdCompleteRedelegate(cdc *wire.Codec) *cobra.Command { Use: "complete", Short: "complete redelegation", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). @@ -359,7 +359,7 @@ func GetCmdBeginUnbonding(storeName string, cdc *wire.Codec) *cobra.Command { Use: "begin", Short: "begin unbonding", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). @@ -408,7 +408,7 @@ func GetCmdCompleteUnbonding(cdc *wire.Codec) *cobra.Command { Use: "complete", Short: "complete unbonding", RunE: func(cmd *cobra.Command, args []string) error { - txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc) + txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc) cliCtx := context.NewCLIContext(). WithCodec(cdc). WithLogger(os.Stdout). diff --git a/x/stake/client/rest/tx.go b/x/stake/client/rest/tx.go index f43e837496..c506935a50 100644 --- a/x/stake/client/rest/tx.go +++ b/x/stake/client/rest/tx.go @@ -12,7 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" - authcliCtx "github.com/cosmos/cosmos-sdk/x/auth/client/context" + authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/stake" "github.com/gorilla/mux" @@ -263,7 +263,7 @@ func delegationsRequestHandlerFn(cdc *wire.Codec, kb keys.Keybase, cliCtx contex i++ } - txBld := authcliCtx.TxBuilder{ + txBld := authtxb.TxBuilder{ Codec: cdc, ChainID: m.ChainID, Gas: m.Gas,