context

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureAccountExists added in v0.23.0

func EnsureAccountExists(ctx CoreContext, name string) error

EnsureAccountExists - Make sure account exists

Types

type CoreContext added in v0.16.0

type CoreContext struct {
	ChainID         string
	Height          int64
	Gas             int64
	Fee             string
	TrustNode       bool
	NodeURI         string
	FromAddressName string
	AccountNumber   int64
	Sequence        int64
	Memo            string
	Client          rpcclient.Client
	Decoder         auth.AccountDecoder
	AccountStore    string
	UseLedger       bool
	Async           bool
	JSON            bool
	PrintResponse   bool
}

typical context created in sdk modules for transactions/queries

func EnsureAccountNumber added in v0.19.0

func EnsureAccountNumber(ctx CoreContext) (CoreContext, error)

EnsureAccount - automatically set account number if none provided

func EnsureSequence added in v0.15.0

func EnsureSequence(ctx CoreContext) (CoreContext, error)

EnsureSequence - automatically set sequence number if none provided

func NewCoreContextFromViper

func NewCoreContextFromViper() CoreContext

NewCoreContextFromViper - return a new context with parameters from the command line

func (CoreContext) BroadcastTx added in v0.16.0

func (ctx CoreContext) BroadcastTx(tx []byte) (*ctypes.ResultBroadcastTxCommit, error)

Broadcast the transaction bytes to Tendermint

func (CoreContext) BroadcastTxAsync added in v0.20.0

func (ctx CoreContext) BroadcastTxAsync(tx []byte) (*ctypes.ResultBroadcastTx, error)

Broadcast the transaction bytes to Tendermint

func (CoreContext) EnsureSignBuildBroadcast added in v0.16.0

func (ctx CoreContext) EnsureSignBuildBroadcast(name string, msgs []sdk.Msg, cdc *wire.Codec) (err error)

sign and build the transaction from the msg

func (CoreContext) GetAccountNumber added in v0.19.0

func (ctx CoreContext) GetAccountNumber(address []byte) (int64, error)

get the next sequence for the account address

func (CoreContext) GetFromAddress added in v0.16.0

func (ctx CoreContext) GetFromAddress() (from sdk.AccAddress, err error)

Get the from address from the name flag

func (CoreContext) GetNode added in v0.16.0

func (ctx CoreContext) GetNode() (rpcclient.Client, error)

GetNode prepares a simple rpc.Client

func (CoreContext) GetPassphraseFromStdin added in v0.16.0

func (ctx CoreContext) GetPassphraseFromStdin(name string) (pass string, err error)

get passphrase from std input

func (CoreContext) NextSequence added in v0.16.0

func (ctx CoreContext) NextSequence(address []byte) (int64, error)

get the next sequence for the account address

func (CoreContext) Query added in v0.16.0

func (ctx CoreContext) Query(path string) (res []byte, err error)

Query information about the connected node

func (CoreContext) QueryStore added in v0.20.0

func (ctx CoreContext) QueryStore(key cmn.HexBytes, storeName string) (res []byte, err error)

QueryStore from Tendermint with the provided key and storename

func (CoreContext) QuerySubspace added in v0.17.0

func (ctx CoreContext) QuerySubspace(cdc *wire.Codec, subspace []byte, storeName string) (res []sdk.KVPair, err error)

Query from Tendermint with the provided storename and subspace

func (CoreContext) SignAndBuild added in v0.16.0

func (ctx CoreContext) SignAndBuild(name, passphrase string, msgs []sdk.Msg, cdc *wire.Codec) ([]byte, error)

sign and build the transaction from the msg

func (CoreContext) WithAccountNumber added in v0.19.0

func (c CoreContext) WithAccountNumber(accnum int64) CoreContext

WithSequence - return a copy of the context with an account number

func (CoreContext) WithAccountStore added in v0.16.0

func (c CoreContext) WithAccountStore(accountStore string) CoreContext

WithAccountStore - return a copy of the context with an updated AccountStore

func (CoreContext) WithChainID added in v0.16.0

func (c CoreContext) WithChainID(chainID string) CoreContext

WithChainID - return a copy of the context with an updated chainID

func (CoreContext) WithClient added in v0.16.0

func (c CoreContext) WithClient(client rpcclient.Client) CoreContext

WithClient - return a copy of the context with an updated RPC client instance

func (CoreContext) WithDecoder added in v0.16.0

func (c CoreContext) WithDecoder(decoder auth.AccountDecoder) CoreContext

WithDecoder - return a copy of the context with an updated Decoder

func (CoreContext) WithFee added in v0.20.0

func (c CoreContext) WithFee(fee string) CoreContext

WithFee - return a copy of the context with an updated fee

func (CoreContext) WithFromAddressName added in v0.16.0

func (c CoreContext) WithFromAddressName(fromAddressName string) CoreContext

WithFromAddressName - return a copy of the context with an updated from address

func (CoreContext) WithGas added in v0.18.0

func (c CoreContext) WithGas(gas int64) CoreContext

WithGas - return a copy of the context with an updated gas

func (CoreContext) WithHeight added in v0.16.0

func (c CoreContext) WithHeight(height int64) CoreContext

WithHeight - return a copy of the context with an updated height

func (CoreContext) WithMemo added in v0.20.0

func (c CoreContext) WithMemo(memo string) CoreContext

WithMemo - return a copy of the context with an updated memo

func (CoreContext) WithNodeURI added in v0.16.0

func (c CoreContext) WithNodeURI(nodeURI string) CoreContext

WithNodeURI - return a copy of the context with an updated node URI

func (CoreContext) WithSequence added in v0.16.0

func (c CoreContext) WithSequence(sequence int64) CoreContext

WithSequence - return a copy of the context with an updated sequence number

func (CoreContext) WithTrustNode added in v0.16.0

func (c CoreContext) WithTrustNode(trustNode bool) CoreContext

WithTrustNode - return a copy of the context with an updated TrustNode flag

func (CoreContext) WithUseLedger added in v0.20.0

func (c CoreContext) WithUseLedger(useLedger bool) CoreContext

WithUseLedger - return a copy of the context with an updated UseLedger

Jump to

Keyboard shortcuts

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