context

package
v0.24.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TxContext

type TxContext struct {
	Codec         *wire.Codec
	AccountNumber int64
	Sequence      int64
	Gas           int64
	ChainID       string
	Memo          string
	Fee           string
}

TxContext implements a transaction context created in SDK modules.

func NewTxContextFromCLI

func NewTxContextFromCLI() TxContext

NewTxContextFromCLI returns a new initialized TxContext with parameters from the command line using Viper.

func (TxContext) Build

func (ctx TxContext) Build(msgs []sdk.Msg) (auth.StdSignMsg, error)

Build builds a single message to be signed from a TxContext given a set of messages. It returns an error if a fee is supplied but cannot be parsed.

func (TxContext) BuildAndSign

func (ctx TxContext) BuildAndSign(name, passphrase string, msgs []sdk.Msg) ([]byte, error)

BuildAndSign builds a single message to be signed, and signs a transaction with the built message given a name, passphrase, and a set of messages.

func (TxContext) Sign

func (ctx TxContext) Sign(name, passphrase string, msg auth.StdSignMsg) ([]byte, error)

Sign signs a transaction given a name, passphrase, and a single message to signed. An error is returned if signing fails.

func (TxContext) WithAccountNumber

func (ctx TxContext) WithAccountNumber(accnum int64) TxContext

WithAccountNumber returns a copy of the context with an account number.

func (TxContext) WithChainID

func (ctx TxContext) WithChainID(chainID string) TxContext

WithChainID returns a copy of the context with an updated chainID.

func (TxContext) WithCodec

func (ctx TxContext) WithCodec(cdc *wire.Codec) TxContext

WithCodec returns a copy of the context with an updated codec.

func (TxContext) WithFee

func (ctx TxContext) WithFee(fee string) TxContext

WithFee returns a copy of the context with an updated fee.

func (TxContext) WithGas

func (ctx TxContext) WithGas(gas int64) TxContext

WithGas returns a copy of the context with an updated gas.

func (TxContext) WithMemo

func (ctx TxContext) WithMemo(memo string) TxContext

WithMemo returns a copy of the context with an updated memo.

func (TxContext) WithSequence

func (ctx TxContext) WithSequence(sequence int64) TxContext

WithSequence returns a copy of the context with an updated sequence number.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL