tests

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAddress

func GetAddress(netAddr string) ([]byte, error)

func GetNonce

func GetNonce(t *testing.T, netAddr string, block string, addr string) hexutil.Uint64

func GetTransactionReceipt

func GetTransactionReceipt(t *testing.T, addr string, hash ethcmn.Hash) map[string]interface{}

nolint

func UnlockAllAccounts

func UnlockAllAccounts(t *testing.T, netAddr string)

func WaitForReceipt

func WaitForReceipt(t *testing.T, netAddr string, hash ethcmn.Hash) map[string]interface{}

Types

type MockClient added in v1.3.0

type MockClient struct {
	mock.Client
	// contains filtered or unexported fields
}

func NewMockClient added in v1.3.0

func NewMockClient(chainId string, chain apptesting.TestChainI, app abci.Application) *MockClient

func (MockClient) ABCIQueryWithOptions added in v1.3.0

func (c MockClient) ABCIQueryWithOptions(
	path string,
	data bytes.HexBytes,
	opts client.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error)

func (*MockClient) Block added in v1.3.0

func (c *MockClient) Block(heightPtr *int64) (*ctypes.ResultBlock, error)

func (*MockClient) BlockchainInfo added in v1.3.0

func (c *MockClient) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error)

func (MockClient) BroadcastTxSync added in v1.3.0

func (c MockClient) BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)

func (*MockClient) CommitBlock added in v1.3.0

func (c *MockClient) CommitBlock()

func (*MockClient) CommitTx added in v1.3.0

func (c *MockClient) CommitTx(height int64, txs types.Txs, resDeliverTxs []*abci.ResponseDeliverTx)

func (*MockClient) GetAddressList added in v1.3.0

func (c *MockClient) GetAddressList() (*ctypes.ResultUnconfirmedAddresses, error)

func (MockClient) GetPendingNonce added in v1.3.0

func (c MockClient) GetPendingNonce(address string) (*ctypes.ResultPendingNonce, bool)

func (MockClient) GetUnconfirmedTxByHash added in v1.3.0

func (c MockClient) GetUnconfirmedTxByHash(hash [sha256.Size]byte) (types.Tx, error)

func (*MockClient) LatestBlockNumber added in v1.6.0

func (c *MockClient) LatestBlockNumber() (int64, error)

func (*MockClient) NumUnconfirmedTxs added in v1.3.0

func (c *MockClient) NumUnconfirmedTxs() (*ctypes.ResultUnconfirmedTxs, error)

func (*MockClient) StartTmRPC added in v1.5.3

func (m *MockClient) StartTmRPC() (net.Listener, string, error)

func (MockClient) Status added in v1.3.0

func (c MockClient) Status() (*ctypes.ResultStatus, error)

func (*MockClient) Tx added in v1.3.0

func (c *MockClient) Tx(hash []byte, prove bool) (*ctypes.ResultTx, error)

func (*MockClient) UnconfirmedTxs added in v1.3.0

func (c *MockClient) UnconfirmedTxs(limit int) (*ctypes.ResultUnconfirmedTxs, error)

func (MockClient) UserNumUnconfirmedTxs added in v1.3.0

func (c MockClient) UserNumUnconfirmedTxs(address string) (*ctypes.ResultUserUnconfirmedTxs, error)

func (*MockClient) UserUnconfirmedTxs added in v1.3.0

func (c *MockClient) UserUnconfirmedTxs(address string, limit int) (*ctypes.ResultUserUnconfirmedTxs, error)

type RPCError

type RPCError struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type Request

type Request struct {
	Version string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
	ID      int         `json:"id"`
}

func CreateRequest

func CreateRequest(method string, params interface{}) Request

type Response

type Response struct {
	Error  *RPCError       `json:"error"`
	ID     int             `json:"id"`
	Result json.RawMessage `json:"result,omitempty"`
}

func Call

func Call(t *testing.T, addr string, method string, params interface{}) *Response

func CallWithError

func CallWithError(netAddr string, method string, params interface{}) (*Response, error)

Jump to

Keyboard shortcuts

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