Update context

This commit is contained in:
Aleksandr Bezobchuk
2020-03-13 13:59:14 -04:00
parent 7838d750e1
commit c49af0b8dd
4 changed files with 36 additions and 23 deletions
+13 -3
View File
@@ -1,17 +1,27 @@
package std
import (
"github.com/cosmos/cosmos-sdk/client"
clientx "github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth"
)
var (
_ sdk.Tx = (*Transaction)(nil)
_ client.ClientTx = (*Transaction)(nil)
_ sdk.Tx = (*Transaction)(nil)
_ clientx.ClientTx = (*Transaction)(nil)
_ clientx.TxGenerator = TxGenerator{}
)
// TxGenerator defines a transaction generator that allows clients to construct
// transactions.
type TxGenerator struct{}
// NewTx returns a reference to an empty Transaction type.
func (TxGenerator) NewTx() clientx.ClientTx {
return &Transaction{}
}
func NewTransaction(fee auth.StdFee, memo string, sdkMsgs []sdk.Msg) (*Transaction, error) {
tx := &Transaction{
StdTxBase: auth.NewStdTxBase(fee, nil, memo),