context

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientContext

type ClientContext struct {
	Height         int64
	TrustNode      bool
	NodeURI        string
	InputAddresses string
	Client         rpcclient.Client
	Decoder        UTXODecoder
	UTXOStore      string
}

func NewClientContextFromViper

func NewClientContextFromViper() ClientContext

Return a new context with parameters from the command line

func (ClientContext) BroadcastTx

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

Broadcast the transaction bytes to Tendermint

func (ClientContext) GetInputAddresses

func (ctx ClientContext) GetInputAddresses(dir string) (from [2]common.Address, err error)

Get the from address from the name flag

func (ClientContext) GetNode

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

Prepares a simple rpc.Client

func (ClientContext) GetPassphraseFromStdin

func (ctx ClientContext) GetPassphraseFromStdin(addr common.Address) (pass string, err error)

Get passphrase from std input

func (ClientContext) GetSignature

func (ctx ClientContext) GetSignature(addr common.Address, msg types.SpendMsg, dir string) (sig []byte, err error)

func (ClientContext) SignBuildBroadcast

func (ctx ClientContext) SignBuildBroadcast(addrs [2]common.Address, msg types.SpendMsg, dir string) (res *ctypes.ResultBroadcastTxCommit, err error)

sign and build the transaction from the msg

func (ClientContext) WithClient

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

Returns a copy of the context with an updated RPC client instance

func (ClientContext) WithDecoder

func (c ClientContext) WithDecoder(decoder UTXODecoder) ClientContext

Returns a copy of the context with an updated utxo decoder

func (ClientContext) WithHeight

func (c ClientContext) WithHeight(height int64) ClientContext

Returns a copy of the context with an updated height

func (ClientContext) WithInputAddresses

func (c ClientContext) WithInputAddresses(inputAddresses string) ClientContext

Returns a copy of the context with an updated from address

func (ClientContext) WithNodeURI

func (c ClientContext) WithNodeURI(nodeURI string) ClientContext

Returns a copy of the xontext with an updated node URI

func (ClientContext) WithTrustNode

func (c ClientContext) WithTrustNode(trustNode bool) ClientContext

Returns a copy of the context with an updated TrustNode flag

func (ClientContext) WithUTXOStore

func (c ClientContext) WithUTXOStore(utxoStore string) ClientContext

Returns a copy of the context with an updated UTXOStore

type UTXODecoder

type UTXODecoder func(utxoBytes []byte) (types.UTXO, error)

redefine in utxo.go

Jump to

Keyboard shortcuts

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