client

package
v0.0.0-...-6ceb869 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package client is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) GetBalance

func (c *Client) GetBalance(ctx context.Context, address string) (int64, error)

func (*Client) GetBlockchainHeight

func (c *Client) GetBlockchainHeight(ctx context.Context) (uint32, error)

func (*Client) GetBlockchainInfo

func (c *Client) GetBlockchainInfo(ctx context.Context) (*pactus.GetBlockchainInfoResponse, error)

func (*Client) GetNetworkInfo

func (c *Client) GetNetworkInfo(ctx context.Context) (*pactus.GetNetworkInfoResponse, error)

func (*Client) GetNodeInfo

func (c *Client) GetNodeInfo(ctx context.Context) (*pactus.GetNodeInfoResponse, error)

func (*Client) GetPeerInfo

func (c *Client) GetPeerInfo(ctx context.Context, address string) (*pactus.PeerInfo, error)

func (*Client) GetTransactionData

func (c *Client) GetTransactionData(ctx context.Context, txID string) (*pactus.GetTransactionResponse, error)

func (*Client) GetValidatorInfo

func (c *Client) GetValidatorInfo(ctx context.Context, address string) (*pactus.GetValidatorResponse, error)

func (*Client) GetValidatorInfoByNumber

func (c *Client) GetValidatorInfoByNumber(ctx context.Context, num int32) (*pactus.GetValidatorResponse, error)

func (*Client) LastBlockTime

func (c *Client) LastBlockTime(ctx context.Context) (uint32, uint32, error)

func (*Client) TransactionData

func (c *Client) TransactionData(ctx context.Context, hash string) (*pactus.TransactionInfo, error)

type IClient

type IClient interface {
	GetBlockchainInfo(context.Context) (*pactus.GetBlockchainInfoResponse, error)
	GetBlockchainHeight(context.Context) (uint32, error)
	LastBlockTime(context.Context) (uint32, uint32, error)
	GetNetworkInfo(context.Context) (*pactus.GetNetworkInfoResponse, error)
	GetValidatorInfo(context.Context, string) (*pactus.GetValidatorResponse, error)
	GetValidatorInfoByNumber(context.Context, int32) (*pactus.GetValidatorResponse, error)
	GetTransactionData(context.Context, string) (*pactus.GetTransactionResponse, error)
	GetBalance(context.Context, string) (int64, error)
	Close() error
}

type Mgr

type Mgr struct {
	// contains filtered or unexported fields
}

func NewClientMgr

func NewClientMgr(ctx context.Context) *Mgr

func (*Mgr) AddClient

func (cm *Mgr) AddClient(c IClient)

AddClient should call before Start.

func (*Mgr) FindPublicKey

func (cm *Mgr) FindPublicKey(address string, firstVal bool) (string, error)

func (*Mgr) GetBalance

func (cm *Mgr) GetBalance(addr string) (int64, error)

func (*Mgr) GetBlockchainHeight

func (cm *Mgr) GetBlockchainHeight() (uint32, error)

func (*Mgr) GetBlockchainInfo

func (cm *Mgr) GetBlockchainInfo() (*pactus.GetBlockchainInfoResponse, error)

func (*Mgr) GetCirculatingSupply

func (cm *Mgr) GetCirculatingSupply() (int64, error)

func (*Mgr) GetLastBlockTime

func (cm *Mgr) GetLastBlockTime() (uint32, uint32)

func (*Mgr) GetNetworkInfo

func (cm *Mgr) GetNetworkInfo() (*pactus.GetNetworkInfoResponse, error)

func (*Mgr) GetPeerInfo

func (cm *Mgr) GetPeerInfo(address string) (*pactus.PeerInfo, error)

func (*Mgr) GetRandomClient

func (cm *Mgr) GetRandomClient() IClient

func (*Mgr) GetTransactionData

func (cm *Mgr) GetTransactionData(txID string) (*pactus.GetTransactionResponse, error)

func (*Mgr) GetValidatorInfo

func (cm *Mgr) GetValidatorInfo(address string) (*pactus.GetValidatorResponse, error)

func (*Mgr) GetValidatorInfoByNumber

func (cm *Mgr) GetValidatorInfoByNumber(num int32) (*pactus.GetValidatorResponse, error)

func (*Mgr) Start

func (cm *Mgr) Start()

func (*Mgr) Stop

func (cm *Mgr) Stop()

type MockIClient

type MockIClient struct {
	// contains filtered or unexported fields
}

MockIClient is a mock of IClient interface.

func NewMockIClient

func NewMockIClient(ctrl *gomock.Controller) *MockIClient

NewMockIClient creates a new mock instance.

func (*MockIClient) Close

func (m *MockIClient) Close() error

Close mocks base method.

func (*MockIClient) EXPECT

func (m *MockIClient) EXPECT() *MockIClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIClient) GetBalance

func (m *MockIClient) GetBalance(arg0 context.Context, arg1 string) (int64, error)

GetBalance mocks base method.

func (*MockIClient) GetBlockchainHeight

func (m *MockIClient) GetBlockchainHeight(arg0 context.Context) (uint32, error)

GetBlockchainHeight mocks base method.

func (*MockIClient) GetBlockchainInfo

func (m *MockIClient) GetBlockchainInfo(arg0 context.Context) (*pactus.GetBlockchainInfoResponse, error)

GetBlockchainInfo mocks base method.

func (*MockIClient) GetNetworkInfo

func (m *MockIClient) GetNetworkInfo(arg0 context.Context) (*pactus.GetNetworkInfoResponse, error)

GetNetworkInfo mocks base method.

func (*MockIClient) GetTransactionData

func (m *MockIClient) GetTransactionData(arg0 context.Context, arg1 string) (*pactus.GetTransactionResponse, error)

GetTransactionData mocks base method.

func (*MockIClient) GetValidatorInfo

func (m *MockIClient) GetValidatorInfo(arg0 context.Context, arg1 string) (*pactus.GetValidatorResponse, error)

GetValidatorInfo mocks base method.

func (*MockIClient) GetValidatorInfoByNumber

func (m *MockIClient) GetValidatorInfoByNumber(arg0 context.Context, arg1 int32) (*pactus.GetValidatorResponse, error)

GetValidatorInfoByNumber mocks base method.

func (*MockIClient) LastBlockTime

func (m *MockIClient) LastBlockTime(arg0 context.Context) (uint32, uint32, error)

LastBlockTime mocks base method.

type MockIClientMockRecorder

type MockIClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockIClientMockRecorder is the mock recorder for MockIClient.

func (*MockIClientMockRecorder) Close

func (mr *MockIClientMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockIClientMockRecorder) GetBalance

func (mr *MockIClientMockRecorder) GetBalance(arg0, arg1 any) *gomock.Call

GetBalance indicates an expected call of GetBalance.

func (*MockIClientMockRecorder) GetBlockchainHeight

func (mr *MockIClientMockRecorder) GetBlockchainHeight(arg0 any) *gomock.Call

GetBlockchainHeight indicates an expected call of GetBlockchainHeight.

func (*MockIClientMockRecorder) GetBlockchainInfo

func (mr *MockIClientMockRecorder) GetBlockchainInfo(arg0 any) *gomock.Call

GetBlockchainInfo indicates an expected call of GetBlockchainInfo.

func (*MockIClientMockRecorder) GetNetworkInfo

func (mr *MockIClientMockRecorder) GetNetworkInfo(arg0 any) *gomock.Call

GetNetworkInfo indicates an expected call of GetNetworkInfo.

func (*MockIClientMockRecorder) GetTransactionData

func (mr *MockIClientMockRecorder) GetTransactionData(arg0, arg1 any) *gomock.Call

GetTransactionData indicates an expected call of GetTransactionData.

func (*MockIClientMockRecorder) GetValidatorInfo

func (mr *MockIClientMockRecorder) GetValidatorInfo(arg0, arg1 any) *gomock.Call

GetValidatorInfo indicates an expected call of GetValidatorInfo.

func (*MockIClientMockRecorder) GetValidatorInfoByNumber

func (mr *MockIClientMockRecorder) GetValidatorInfoByNumber(arg0, arg1 any) *gomock.Call

GetValidatorInfoByNumber indicates an expected call of GetValidatorInfoByNumber.

func (*MockIClientMockRecorder) LastBlockTime

func (mr *MockIClientMockRecorder) LastBlockTime(arg0 any) *gomock.Call

LastBlockTime indicates an expected call of LastBlockTime.

Jump to

Keyboard shortcuts

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