Documentation ¶
Overview ¶
Package client is a generated GoMock package.
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) GetBalance(ctx context.Context, address string) (int64, error)
- func (c *Client) GetBlockchainHeight(ctx context.Context) (uint32, error)
- func (c *Client) GetBlockchainInfo(ctx context.Context) (*pactus.GetBlockchainInfoResponse, error)
- func (c *Client) GetClientInfo() string
- func (c *Client) GetFee(ctx context.Context, amt int64) (int64, error)
- func (c *Client) GetLastBlockTime(ctx context.Context) (lastBlockTime, lastBlockHeight uint32)
- func (c *Client) GetNetworkInfo(ctx context.Context) (*pactus.GetNetworkInfoResponse, error)
- func (c *Client) GetNodeInfo(ctx context.Context) (*pactus.GetNodeInfoResponse, error)
- func (c *Client) GetPeerInfo(ctx context.Context, address string) (*pactus.PeerInfo, error)
- func (c *Client) GetTransactionData(ctx context.Context, hash string) (*pactus.GetTransactionResponse, error)
- func (c *Client) GetValidatorInfo(ctx context.Context, address string) (*pactus.GetValidatorResponse, error)
- func (c *Client) GetValidatorInfoByNumber(ctx context.Context, num int32) (*pactus.GetValidatorResponse, error)
- func (c *Client) Target() string
- type IClient
- type IManager
- type Manager
- func (cm *Manager) AddClient(c IClient)
- func (cm *Manager) FindPublicKey(address string, firstVal bool) (string, error)
- func (cm *Manager) GetBalance(addr string) (int64, error)
- func (cm *Manager) GetBlockchainHeight() (uint32, error)
- func (cm *Manager) GetBlockchainInfo() (*pactus.GetBlockchainInfoResponse, error)
- func (cm *Manager) GetCirculatingSupply() int64
- func (cm *Manager) GetFee(amt int64) (int64, error)
- func (cm *Manager) GetLastBlockTime() (lastBlockTime, lastBlockHeight uint32)
- func (cm *Manager) GetLocalClient() IClient
- func (cm *Manager) GetNetworkInfo() (*pactus.GetNetworkInfoResponse, error)
- func (cm *Manager) GetPeerInfo(address string) (*pactus.PeerInfo, error)
- func (cm *Manager) GetRandomClient() IClient
- func (cm *Manager) GetTransactionData(txID string) (*pactus.GetTransactionResponse, error)
- func (cm *Manager) GetValidatorInfo(address string) (*pactus.GetValidatorResponse, error)
- func (cm *Manager) GetValidatorInfoByNumber(num int32) (*pactus.GetValidatorResponse, error)
- func (cm *Manager) Start()
- func (cm *Manager) Stop()
- type MockIClient
- func (m *MockIClient) Close() error
- func (m *MockIClient) EXPECT() *MockIClientMockRecorder
- func (m *MockIClient) GetBalance(arg0 context.Context, arg1 string) (int64, error)
- func (m *MockIClient) GetBlockchainHeight(arg0 context.Context) (uint32, error)
- func (m *MockIClient) GetBlockchainInfo(arg0 context.Context) (*pactus.GetBlockchainInfoResponse, error)
- func (m *MockIClient) GetFee(arg0 context.Context, arg1 int64) (int64, error)
- func (m *MockIClient) GetLastBlockTime(arg0 context.Context) (uint32, uint32)
- func (m *MockIClient) GetNetworkInfo(arg0 context.Context) (*pactus.GetNetworkInfoResponse, error)
- func (m *MockIClient) GetTransactionData(arg0 context.Context, arg1 string) (*pactus.GetTransactionResponse, error)
- func (m *MockIClient) GetValidatorInfo(arg0 context.Context, arg1 string) (*pactus.GetValidatorResponse, error)
- func (m *MockIClient) GetValidatorInfoByNumber(arg0 context.Context, arg1 int32) (*pactus.GetValidatorResponse, error)
- func (m *MockIClient) Target() string
- type MockIClientMockRecorder
- func (mr *MockIClientMockRecorder) Close() *gomock.Call
- func (mr *MockIClientMockRecorder) GetBalance(arg0, arg1 any) *gomock.Call
- func (mr *MockIClientMockRecorder) GetBlockchainHeight(arg0 any) *gomock.Call
- func (mr *MockIClientMockRecorder) GetBlockchainInfo(arg0 any) *gomock.Call
- func (mr *MockIClientMockRecorder) GetFee(arg0, arg1 any) *gomock.Call
- func (mr *MockIClientMockRecorder) GetLastBlockTime(arg0 any) *gomock.Call
- func (mr *MockIClientMockRecorder) GetNetworkInfo(arg0 any) *gomock.Call
- func (mr *MockIClientMockRecorder) GetTransactionData(arg0, arg1 any) *gomock.Call
- func (mr *MockIClientMockRecorder) GetValidatorInfo(arg0, arg1 any) *gomock.Call
- func (mr *MockIClientMockRecorder) GetValidatorInfoByNumber(arg0, arg1 any) *gomock.Call
- func (mr *MockIClientMockRecorder) Target() *gomock.Call
- type MockIManager
- func (m *MockIManager) AddClient(c IClient)
- func (m *MockIManager) EXPECT() *MockIManagerMockRecorder
- func (m *MockIManager) FindPublicKey(address string, firstVal bool) (string, error)
- func (m *MockIManager) GetBalance(addr string) (int64, error)
- func (m *MockIManager) GetBlockchainHeight() (uint32, error)
- func (m *MockIManager) GetBlockchainInfo() (*pactus.GetBlockchainInfoResponse, error)
- func (m *MockIManager) GetCirculatingSupply() int64
- func (m *MockIManager) GetFee(amt int64) (int64, error)
- func (m *MockIManager) GetLastBlockTime() (uint32, uint32)
- func (m *MockIManager) GetLocalClient() IClient
- func (m *MockIManager) GetNetworkInfo() (*pactus.GetNetworkInfoResponse, error)
- func (m *MockIManager) GetPeerInfo(address string) (*pactus.PeerInfo, error)
- func (m *MockIManager) GetRandomClient() IClient
- func (m *MockIManager) GetTransactionData(txID string) (*pactus.GetTransactionResponse, error)
- func (m *MockIManager) GetValidatorInfo(address string) (*pactus.GetValidatorResponse, error)
- func (m *MockIManager) GetValidatorInfoByNumber(num int32) (*pactus.GetValidatorResponse, error)
- func (m *MockIManager) Start()
- func (m *MockIManager) Stop()
- type MockIManagerMockRecorder
- func (mr *MockIManagerMockRecorder) AddClient(c any) *gomock.Call
- func (mr *MockIManagerMockRecorder) FindPublicKey(address, firstVal any) *gomock.Call
- func (mr *MockIManagerMockRecorder) GetBalance(addr any) *gomock.Call
- func (mr *MockIManagerMockRecorder) GetBlockchainHeight() *gomock.Call
- func (mr *MockIManagerMockRecorder) GetBlockchainInfo() *gomock.Call
- func (mr *MockIManagerMockRecorder) GetCirculatingSupply() *gomock.Call
- func (mr *MockIManagerMockRecorder) GetFee(amt any) *gomock.Call
- func (mr *MockIManagerMockRecorder) GetLastBlockTime() *gomock.Call
- func (mr *MockIManagerMockRecorder) GetLocalClient() *gomock.Call
- func (mr *MockIManagerMockRecorder) GetNetworkInfo() *gomock.Call
- func (mr *MockIManagerMockRecorder) GetPeerInfo(address any) *gomock.Call
- func (mr *MockIManagerMockRecorder) GetRandomClient() *gomock.Call
- func (mr *MockIManagerMockRecorder) GetTransactionData(txID any) *gomock.Call
- func (mr *MockIManagerMockRecorder) GetValidatorInfo(address any) *gomock.Call
- func (mr *MockIManagerMockRecorder) GetValidatorInfoByNumber(num any) *gomock.Call
- func (mr *MockIManagerMockRecorder) Start() *gomock.Call
- func (mr *MockIManagerMockRecorder) Stop() *gomock.Call
- type NetworkInfoError
- type NotFoundError
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 (*Client) GetBalance ¶
func (*Client) GetBlockchainHeight ¶
func (*Client) GetBlockchainInfo ¶
func (*Client) GetClientInfo ¶
func (*Client) GetLastBlockTime ¶
func (*Client) GetNetworkInfo ¶
func (*Client) GetNodeInfo ¶
func (*Client) GetPeerInfo ¶
func (*Client) GetTransactionData ¶
func (*Client) GetValidatorInfo ¶
func (*Client) GetValidatorInfoByNumber ¶
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 (*Manager) FindPublicKey ¶
func (*Manager) GetBlockchainHeight ¶
func (*Manager) GetBlockchainInfo ¶
func (cm *Manager) GetBlockchainInfo() (*pactus.GetBlockchainInfoResponse, error)
func (*Manager) GetCirculatingSupply ¶
func (*Manager) GetLastBlockTime ¶
func (*Manager) GetLocalClient ¶
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 (*Manager) GetRandomClient ¶
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)
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) EXPECT ¶
func (m *MockIClient) EXPECT() *MockIClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockIClient) GetBalance ¶
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) 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.
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 ¶
func (m *MockIManager) EXPECT() *MockIManagerMockRecorder
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.
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 ¶
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string