client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 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(target 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) GetClientInfo

func (c *Client) GetClientInfo() string

func (*Client) GetFee

func (c *Client) GetFee(ctx context.Context, amt int64) (int64, error)

func (*Client) GetLastBlockTime

func (c *Client) GetLastBlockTime(ctx context.Context) (lastBlockTime, lastBlockHeight uint32)

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, hash 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) Target

func (c *Client) Target() string

type IClient

type IClient interface {
	Target() string
	GetBlockchainInfo(context.Context) (*pactus.GetBlockchainInfoResponse, error)
	GetBlockchainHeight(context.Context) (uint32, error)
	GetLastBlockTime(context.Context) (uint32, uint32)
	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)
	GetFee(context.Context, int64) (int64, error)
	Close() error
}

type IManager

type IManager interface {
	Start()
	Stop()
	AddClient(c IClient)
	GetLocalClient() IClient
	GetRandomClient() IClient
	GetBlockchainInfo() (*pactus.GetBlockchainInfoResponse, error)
	GetBlockchainHeight() (uint32, error)
	GetLastBlockTime() (uint32, uint32)
	GetNetworkInfo() (*pactus.GetNetworkInfoResponse, error)
	GetPeerInfo(address string) (*pactus.PeerInfo, error)
	GetValidatorInfo(address string) (*pactus.GetValidatorResponse, error)
	GetValidatorInfoByNumber(num int32) (*pactus.GetValidatorResponse, error)
	GetTransactionData(txID string) (*pactus.GetTransactionResponse, error)
	GetBalance(addr string) (int64, error)
	GetFee(amt int64) (int64, error)
	GetCirculatingSupply() int64
	FindPublicKey(address string, firstVal bool) (string, error)
}

type Manager

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

func NewClientMgr

func NewClientMgr(ctx context.Context) *Manager

func (*Manager) AddClient

func (cm *Manager) AddClient(c IClient)

AddClient should call before Start.

func (*Manager) FindPublicKey

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

func (*Manager) GetBalance

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

func (*Manager) GetBlockchainHeight

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

func (*Manager) GetBlockchainInfo

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

func (*Manager) GetCirculatingSupply

func (cm *Manager) GetCirculatingSupply() int64

func (*Manager) GetFee

func (cm *Manager) GetFee(amt int64) (int64, error)

func (*Manager) GetLastBlockTime

func (cm *Manager) GetLastBlockTime() (lastBlockTime, lastBlockHeight uint32)

func (*Manager) GetLocalClient

func (cm *Manager) GetLocalClient() IClient

GetLocalClient returns the local client. The local is always the first client in list of clients.

func (*Manager) GetNetworkInfo

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

func (*Manager) GetPeerInfo

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

func (*Manager) GetRandomClient

func (cm *Manager) GetRandomClient() IClient

func (*Manager) GetTransactionData

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

func (*Manager) GetValidatorInfo

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

func (*Manager) GetValidatorInfoByNumber

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

func (*Manager) Start

func (cm *Manager) Start()

func (*Manager) Stop

func (cm *Manager) 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) GetFee

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

GetFee mocks base method.

func (*MockIClient) GetLastBlockTime

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

GetLastBlockTime 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) Target

func (m *MockIClient) Target() string

Target 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) GetFee

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

GetFee indicates an expected call of GetFee.

func (*MockIClientMockRecorder) GetLastBlockTime

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

GetLastBlockTime indicates an expected call of GetLastBlockTime.

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) Target

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

Target indicates an expected call of Target.

type MockIManager

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

MockIManager is a mock of IManager interface.

func NewMockIManager

func NewMockIManager(ctrl *gomock.Controller) *MockIManager

NewMockIManager creates a new mock instance.

func (*MockIManager) AddClient

func (m *MockIManager) AddClient(c IClient)

AddClient mocks base method.

func (*MockIManager) EXPECT

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

func (*MockIManager) FindPublicKey

func (m *MockIManager) FindPublicKey(address string, firstVal bool) (string, error)

FindPublicKey mocks base method.

func (*MockIManager) GetBalance

func (m *MockIManager) GetBalance(addr string) (int64, error)

GetBalance mocks base method.

func (*MockIManager) GetBlockchainHeight

func (m *MockIManager) GetBlockchainHeight() (uint32, error)

GetBlockchainHeight mocks base method.

func (*MockIManager) GetBlockchainInfo

func (m *MockIManager) GetBlockchainInfo() (*pactus.GetBlockchainInfoResponse, error)

GetBlockchainInfo mocks base method.

func (*MockIManager) GetCirculatingSupply

func (m *MockIManager) GetCirculatingSupply() int64

GetCirculatingSupply mocks base method.

func (*MockIManager) GetFee

func (m *MockIManager) GetFee(amt int64) (int64, error)

GetFee mocks base method.

func (*MockIManager) GetLastBlockTime

func (m *MockIManager) GetLastBlockTime() (uint32, uint32)

GetLastBlockTime mocks base method.

func (*MockIManager) GetLocalClient

func (m *MockIManager) GetLocalClient() IClient

GetLocalClient mocks base method.

func (*MockIManager) GetNetworkInfo

func (m *MockIManager) GetNetworkInfo() (*pactus.GetNetworkInfoResponse, error)

GetNetworkInfo mocks base method.

func (*MockIManager) GetPeerInfo

func (m *MockIManager) GetPeerInfo(address string) (*pactus.PeerInfo, error)

GetPeerInfo mocks base method.

func (*MockIManager) GetRandomClient

func (m *MockIManager) GetRandomClient() IClient

GetRandomClient mocks base method.

func (*MockIManager) GetTransactionData

func (m *MockIManager) GetTransactionData(txID string) (*pactus.GetTransactionResponse, error)

GetTransactionData mocks base method.

func (*MockIManager) GetValidatorInfo

func (m *MockIManager) GetValidatorInfo(address string) (*pactus.GetValidatorResponse, error)

GetValidatorInfo mocks base method.

func (*MockIManager) GetValidatorInfoByNumber

func (m *MockIManager) GetValidatorInfoByNumber(num int32) (*pactus.GetValidatorResponse, error)

GetValidatorInfoByNumber mocks base method.

func (*MockIManager) Start

func (m *MockIManager) Start()

Start mocks base method.

func (*MockIManager) Stop

func (m *MockIManager) Stop()

Stop mocks base method.

type MockIManagerMockRecorder

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

MockIManagerMockRecorder is the mock recorder for MockIManager.

func (*MockIManagerMockRecorder) AddClient

func (mr *MockIManagerMockRecorder) AddClient(c any) *gomock.Call

AddClient indicates an expected call of AddClient.

func (*MockIManagerMockRecorder) FindPublicKey

func (mr *MockIManagerMockRecorder) FindPublicKey(address, firstVal any) *gomock.Call

FindPublicKey indicates an expected call of FindPublicKey.

func (*MockIManagerMockRecorder) GetBalance

func (mr *MockIManagerMockRecorder) GetBalance(addr any) *gomock.Call

GetBalance indicates an expected call of GetBalance.

func (*MockIManagerMockRecorder) GetBlockchainHeight

func (mr *MockIManagerMockRecorder) GetBlockchainHeight() *gomock.Call

GetBlockchainHeight indicates an expected call of GetBlockchainHeight.

func (*MockIManagerMockRecorder) GetBlockchainInfo

func (mr *MockIManagerMockRecorder) GetBlockchainInfo() *gomock.Call

GetBlockchainInfo indicates an expected call of GetBlockchainInfo.

func (*MockIManagerMockRecorder) GetCirculatingSupply

func (mr *MockIManagerMockRecorder) GetCirculatingSupply() *gomock.Call

GetCirculatingSupply indicates an expected call of GetCirculatingSupply.

func (*MockIManagerMockRecorder) GetFee

func (mr *MockIManagerMockRecorder) GetFee(amt any) *gomock.Call

GetFee indicates an expected call of GetFee.

func (*MockIManagerMockRecorder) GetLastBlockTime

func (mr *MockIManagerMockRecorder) GetLastBlockTime() *gomock.Call

GetLastBlockTime indicates an expected call of GetLastBlockTime.

func (*MockIManagerMockRecorder) GetLocalClient

func (mr *MockIManagerMockRecorder) GetLocalClient() *gomock.Call

GetLocalClient indicates an expected call of GetLocalClient.

func (*MockIManagerMockRecorder) GetNetworkInfo

func (mr *MockIManagerMockRecorder) GetNetworkInfo() *gomock.Call

GetNetworkInfo indicates an expected call of GetNetworkInfo.

func (*MockIManagerMockRecorder) GetPeerInfo

func (mr *MockIManagerMockRecorder) GetPeerInfo(address any) *gomock.Call

GetPeerInfo indicates an expected call of GetPeerInfo.

func (*MockIManagerMockRecorder) GetRandomClient

func (mr *MockIManagerMockRecorder) GetRandomClient() *gomock.Call

GetRandomClient indicates an expected call of GetRandomClient.

func (*MockIManagerMockRecorder) GetTransactionData

func (mr *MockIManagerMockRecorder) GetTransactionData(txID any) *gomock.Call

GetTransactionData indicates an expected call of GetTransactionData.

func (*MockIManagerMockRecorder) GetValidatorInfo

func (mr *MockIManagerMockRecorder) GetValidatorInfo(address any) *gomock.Call

GetValidatorInfo indicates an expected call of GetValidatorInfo.

func (*MockIManagerMockRecorder) GetValidatorInfoByNumber

func (mr *MockIManagerMockRecorder) GetValidatorInfoByNumber(num any) *gomock.Call

GetValidatorInfoByNumber indicates an expected call of GetValidatorInfoByNumber.

func (*MockIManagerMockRecorder) Start

func (mr *MockIManagerMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start.

func (*MockIManagerMockRecorder) Stop

func (mr *MockIManagerMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop.

type NetworkInfoError

type NetworkInfoError struct {
	Reason string
}

func (NetworkInfoError) Error

func (e NetworkInfoError) Error() string

type NotFoundError

type NotFoundError struct {
	Search  string
	Address string
}

func (NotFoundError) Error

func (e NotFoundError) Error() string

Jump to

Keyboard shortcuts

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