x/auth/client/context -> x/auth/client/txbuilder
This commit is contained in:
parent
54b3b5c028
commit
acd125029d
|
@ -8,7 +8,7 @@ import (
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
auth "github.com/cosmos/cosmos-sdk/x/auth"
|
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 (
|
const (
|
||||||
|
@ -52,7 +52,7 @@ func ParseFloat64OrReturnBadRequest(w http.ResponseWriter, s string, defaultIfEm
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteGenerateStdTxResponse writes response for the generate_only mode.
|
// 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)
|
stdMsg, err := txBld.Build(msgs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
WriteErrorResponse(w, http.StatusBadRequest, err.Error())
|
WriteErrorResponse(w, http.StatusBadRequest, err.Error())
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
auth "github.com/cosmos/cosmos-sdk/x/auth"
|
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"
|
amino "github.com/tendermint/go-amino"
|
||||||
"github.com/tendermint/tendermint/libs/common"
|
"github.com/tendermint/tendermint/libs/common"
|
||||||
)
|
)
|
||||||
|
@ -18,7 +18,7 @@ import (
|
||||||
// ensures that the account exists, has a proper number and sequence set. In
|
// ensures that the account exists, has a proper number and sequence set. In
|
||||||
// addition, it builds and signs a transaction with the supplied messages.
|
// addition, it builds and signs a transaction with the supplied messages.
|
||||||
// Finally, it broadcasts the signed transaction to a node.
|
// 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)
|
txBld, err := prepareTxContext(txBld, cliCtx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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.
|
// 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)
|
txBytes, err := txBld.WithGas(gas).BuildWithPubKey(name, msgs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
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
|
// EnrichCtxWithGas calculates the gas estimate that would be consumed by the
|
||||||
// transaction and set the transaction's respective value accordingly.
|
// 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)
|
_, adjusted, err := SimulateMsgs(txBld, cliCtx, name, msgs, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return txBld, err
|
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.
|
// 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)
|
stdTx, err := buildUnsignedStdTx(txBld, cliCtx, msgs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@ -111,7 +111,7 @@ func parseQueryResponse(cdc *amino.Codec, rawRes []byte) (int64, error) {
|
||||||
return simulationResult.GasUsed, nil
|
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 {
|
if err := cliCtx.EnsureAccountExists(); err != nil {
|
||||||
return txBld, err
|
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
|
// buildUnsignedStdTx builds a StdTx as per the parameters passed in the
|
||||||
// contexts. Gas is automatically estimated if gas wanted is set to 0.
|
// 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)
|
txBld, err = prepareTxContext(txBld, cliCtx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"github.com/cosmos/cosmos-sdk/wire"
|
||||||
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
|
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.
|
// QuizTxCmd invokes the coolness quiz transaction.
|
||||||
|
@ -21,7 +21,7 @@ func QuizTxCmd(cdc *wire.Codec) *cobra.Command {
|
||||||
Short: "What's cooler than being cool?",
|
Short: "What's cooler than being cool?",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
@ -46,7 +46,7 @@ func SetTrendTxCmd(cdc *wire.Codec) *cobra.Command {
|
||||||
Short: "You're so cool, tell us what is cool!",
|
Short: "You're so cool, tell us what is cool!",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"github.com/cosmos/cosmos-sdk/wire"
|
||||||
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
|
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/cobra"
|
||||||
)
|
)
|
||||||
|
@ -22,7 +22,7 @@ func MineCmd(cdc *wire.Codec) *cobra.Command {
|
||||||
Short: "Mine some coins with proof-of-work!",
|
Short: "Mine some coins with proof-of-work!",
|
||||||
Args: cobra.ExactArgs(4),
|
Args: cobra.ExactArgs(4),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"github.com/cosmos/cosmos-sdk/wire"
|
||||||
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
|
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/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
@ -30,7 +30,7 @@ func BondTxCmd(cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "bond",
|
Use: "bond",
|
||||||
Short: "Bond to a validator",
|
Short: "Bond to a validator",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
@ -84,7 +84,7 @@ func UnbondTxCmd(cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "unbond",
|
Use: "unbond",
|
||||||
Short: "Unbond from a validator",
|
Short: "Unbond from a validator",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout)
|
WithLogger(os.Stdout)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"github.com/cosmos/cosmos-sdk/wire"
|
||||||
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
|
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/cosmos/cosmos-sdk/x/bank/client"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
@ -27,7 +27,7 @@ func SendTxCmd(cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "send",
|
Use: "send",
|
||||||
Short: "Create and sign a send tx",
|
Short: "Create and sign a send tx",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"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"
|
||||||
"github.com/cosmos/cosmos-sdk/x/bank/client"
|
"github.com/cosmos/cosmos-sdk/x/bank/client"
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ func SendRequestHandlerFn(cdc *wire.Codec, kb keys.Keybase, cliCtx context.CLICo
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
txBld := authctx.TxBuilder{
|
txBld := authtxb.TxBuilder{
|
||||||
Codec: cdc,
|
Codec: cdc,
|
||||||
Gas: m.Gas,
|
Gas: m.Gas,
|
||||||
ChainID: m.ChainID,
|
ChainID: m.ChainID,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"github.com/cosmos/cosmos-sdk/wire"
|
||||||
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
|
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"
|
"github.com/cosmos/cosmos-sdk/x/gov"
|
||||||
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
@ -77,7 +77,7 @@ $ gaiacli gov submit-proposal --title="Test Proposal" --description="My awesome
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
@ -161,7 +161,7 @@ func GetCmdDeposit(cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "deposit",
|
Use: "deposit",
|
||||||
Short: "deposit tokens for activing proposal",
|
Short: "deposit tokens for activing proposal",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
@ -207,7 +207,7 @@ func GetCmdVote(cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "vote",
|
Use: "vote",
|
||||||
Short: "vote for an active proposal, options: Yes/No/NoWithVeto/Abstain",
|
Short: "vote for an active proposal, options: Yes/No/NoWithVeto/Abstain",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/client/utils"
|
"github.com/cosmos/cosmos-sdk/client/utils"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"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 {
|
type baseReq struct {
|
||||||
|
@ -70,7 +70,7 @@ func (req baseReq) baseReqValidate(w http.ResponseWriter) bool {
|
||||||
// (probably should live in client/lcd).
|
// (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) {
|
func signAndBuild(w http.ResponseWriter, r *http.Request, cliCtx context.CLIContext, baseReq baseReq, msg sdk.Msg, cdc *wire.Codec) {
|
||||||
var err error
|
var err error
|
||||||
txBld := authctx.TxBuilder{
|
txBld := authtxb.TxBuilder{
|
||||||
Codec: cdc,
|
Codec: cdc,
|
||||||
AccountNumber: baseReq.AccountNumber,
|
AccountNumber: baseReq.AccountNumber,
|
||||||
Sequence: baseReq.Sequence,
|
Sequence: baseReq.Sequence,
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
wire "github.com/cosmos/cosmos-sdk/wire"
|
wire "github.com/cosmos/cosmos-sdk/wire"
|
||||||
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
|
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/cosmos/cosmos-sdk/x/ibc"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -28,7 +28,7 @@ func IBCTransferCmd(cdc *wire.Codec) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "transfer",
|
Use: "transfer",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
wire "github.com/cosmos/cosmos-sdk/wire"
|
wire "github.com/cosmos/cosmos-sdk/wire"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||||
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
|
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/cosmos/cosmos-sdk/x/ibc"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -199,7 +199,7 @@ func (c relayCommander) refine(bz []byte, sequence int64, passphrase string) []b
|
||||||
Sequence: sequence,
|
Sequence: sequence,
|
||||||
}
|
}
|
||||||
|
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithSequence(sequence).WithCodec(c.cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithSequence(sequence).WithCodec(c.cdc)
|
||||||
cliCtx := context.NewCLIContext()
|
cliCtx := context.NewCLIContext()
|
||||||
|
|
||||||
res, err := txBld.BuildAndSign(cliCtx.FromAddressName, passphrase, []sdk.Msg{msg})
|
res, err := txBld.BuildAndSign(cliCtx.FromAddressName, passphrase, []sdk.Msg{msg})
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"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/cosmos/cosmos-sdk/x/ibc"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"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)
|
packet := ibc.NewIBCPacket(sdk.AccAddress(info.GetPubKey().Address()), to, m.Amount, m.SrcChainID, destChainID)
|
||||||
msg := ibc.IBCTransferMsg{packet}
|
msg := ibc.IBCTransferMsg{packet}
|
||||||
|
|
||||||
txBld := authctx.TxBuilder{
|
txBld := authtxb.TxBuilder{
|
||||||
Codec: cdc,
|
Codec: cdc,
|
||||||
ChainID: m.SrcChainID,
|
ChainID: m.SrcChainID,
|
||||||
AccountNumber: m.AccountNumber,
|
AccountNumber: m.AccountNumber,
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"github.com/cosmos/cosmos-sdk/wire"
|
||||||
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
|
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/cosmos/cosmos-sdk/x/slashing"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -21,7 +21,7 @@ func GetCmdUnjail(cdc *wire.Codec) *cobra.Command {
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
Short: "unjail validator previously jailed for downtime",
|
Short: "unjail validator previously jailed for downtime",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"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/cosmos/cosmos-sdk/x/slashing"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
@ -70,7 +70,7 @@ func unjailRequestHandlerFn(cdc *wire.Codec, kb keys.Keybase, cliCtx context.CLI
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
txBld := authctx.TxBuilder{
|
txBld := authtxb.TxBuilder{
|
||||||
Codec: cdc,
|
Codec: cdc,
|
||||||
ChainID: m.ChainID,
|
ChainID: m.ChainID,
|
||||||
AccountNumber: m.AccountNumber,
|
AccountNumber: m.AccountNumber,
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"github.com/cosmos/cosmos-sdk/wire"
|
||||||
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
|
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"
|
||||||
"github.com/cosmos/cosmos-sdk/x/stake/types"
|
"github.com/cosmos/cosmos-sdk/x/stake/types"
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ func GetCmdCreateValidator(cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "create-validator",
|
Use: "create-validator",
|
||||||
Short: "create new validator initialized with a self-delegation to it",
|
Short: "create new validator initialized with a self-delegation to it",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
@ -99,7 +99,7 @@ func GetCmdEditValidator(cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "edit-validator",
|
Use: "edit-validator",
|
||||||
Short: "edit and existing validator account",
|
Short: "edit and existing validator account",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
@ -138,7 +138,7 @@ func GetCmdDelegate(cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "delegate",
|
Use: "delegate",
|
||||||
Short: "delegate liquid tokens to an validator",
|
Short: "delegate liquid tokens to an validator",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
@ -197,7 +197,7 @@ func GetCmdBeginRedelegate(storeName string, cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "begin",
|
Use: "begin",
|
||||||
Short: "begin redelegation",
|
Short: "begin redelegation",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
@ -301,7 +301,7 @@ func GetCmdCompleteRedelegate(cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "complete",
|
Use: "complete",
|
||||||
Short: "complete redelegation",
|
Short: "complete redelegation",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
@ -359,7 +359,7 @@ func GetCmdBeginUnbonding(storeName string, cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "begin",
|
Use: "begin",
|
||||||
Short: "begin unbonding",
|
Short: "begin unbonding",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
@ -408,7 +408,7 @@ func GetCmdCompleteUnbonding(cdc *wire.Codec) *cobra.Command {
|
||||||
Use: "complete",
|
Use: "complete",
|
||||||
Short: "complete unbonding",
|
Short: "complete unbonding",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBld := authctx.NewTxBuilderFromCLI().WithCodec(cdc)
|
txBld := authtxb.NewTxBuilderFromCLI().WithCodec(cdc)
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
WithCodec(cdc).
|
WithCodec(cdc).
|
||||||
WithLogger(os.Stdout).
|
WithLogger(os.Stdout).
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"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/cosmos/cosmos-sdk/x/stake"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
@ -263,7 +263,7 @@ func delegationsRequestHandlerFn(cdc *wire.Codec, kb keys.Keybase, cliCtx contex
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
|
||||||
txBld := authcliCtx.TxBuilder{
|
txBld := authtxb.TxBuilder{
|
||||||
Codec: cdc,
|
Codec: cdc,
|
||||||
ChainID: m.ChainID,
|
ChainID: m.ChainID,
|
||||||
Gas: m.Gas,
|
Gas: m.Gas,
|
||||||
|
|
Loading…
Reference in New Issue