tests

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 36 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

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

func NewMockClient

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

func (MockClient) ABCIQueryWithOptions

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

func (*MockClient) Block

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

func (*MockClient) BlockInfo

func (m *MockClient) BlockInfo(height *int64) (meta *types.BlockMeta, err error)

func (*MockClient) BlockchainInfo

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

func (MockClient) BroadcastTxSync

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

func (*MockClient) CommitBlock

func (c *MockClient) CommitBlock()

func (*MockClient) CommitTx

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

func (*MockClient) GetAddressList

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

func (MockClient) GetPendingNonce

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

func (MockClient) GetUnconfirmedTxByHash

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

func (*MockClient) LatestBlockNumber

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

func (*MockClient) NumUnconfirmedTxs

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

func (*MockClient) StartTmRPC

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

func (MockClient) Status

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

func (*MockClient) Tx

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

func (*MockClient) UnconfirmedTxs

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

func (MockClient) UserNumUnconfirmedTxs

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

func (*MockClient) UserUnconfirmedTxs

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