Documentation
¶
Index ¶
- func Retry(timeout time.Duration, f func() error) error
- func RetryCtx(ctx context.Context, timeout time.Duration, f func() error) error
- type GRPCClient
- func (c *GRPCClient) Close(t testing.TB)
- func (c *GRPCClient) GetAddressByAlias(t *testing.T, alias string) []byte
- func (c *GRPCClient) GetAssetBalance(t *testing.T, address proto.WavesAddress, id []byte) *waves.Amount
- func (c *GRPCClient) GetAssetsInfo(t *testing.T, id []byte) *g.AssetInfoResponse
- func (c *GRPCClient) GetBlock(t *testing.T, height uint64) *g.BlockWithHeight
- func (c *GRPCClient) GetDataEntries(t *testing.T, address proto.WavesAddress) []*waves.DataEntry
- func (c *GRPCClient) GetDataEntryByKey(t *testing.T, address proto.WavesAddress, key string) *waves.DataEntry
- func (c *GRPCClient) GetFeatureActivationStatusInfo(t *testing.T, h int32) *g.ActivationStatusResponse
- func (c *GRPCClient) GetHeight(t *testing.T) *client.BlocksHeight
- func (c *GRPCClient) GetTransactionsStatuses(t *testing.T, txIDs []crypto.Digest) []*g.TransactionStatus
- func (c *GRPCClient) GetWavesBalance(t *testing.T, address proto.WavesAddress) *g.BalanceResponse_WavesBalances
- type HTTPClient
- func (c *HTTPClient) AssetBalance(t testing.TB, address proto.WavesAddress, assetID crypto.Digest) *client.AssetsBalanceAndAsset
- func (c *HTTPClient) BlockFinalized(t testing.TB) *proto.BlockHeader
- func (c *HTTPClient) BlockHeader(t testing.TB, height proto.Height) *client.Headers
- func (c *HTTPClient) CommitmentGeneratorsAt(t testing.TB, height proto.Height) []client.GeneratorInfoResponse
- func (c *HTTPClient) ConnectedPeers() ([]*client.PeersConnectedRow, *client.Response, error)
- func (c *HTTPClient) ConnectedPeersCtx(ctx context.Context) ([]*client.PeersConnectedRow, *client.Response, error)
- func (c *HTTPClient) GetAssetDetails(assetID crypto.Digest) (*client.AssetsDetail, error)
- func (c *HTTPClient) GetHeight(t testing.TB, opts ...config.WaitOption) *client.BlocksHeight
- func (c *HTTPClient) HeightFinalized(t testing.TB) proto.Height
- func (c *HTTPClient) PrintMsg(t testing.TB, msg string)
- func (c *HTTPClient) Rewards(t testing.TB) *client.RewardInfo
- func (c *HTTPClient) RewardsAtHeight(t testing.TB, height proto.Height) *client.RewardInfo
- func (c *HTTPClient) RollbackToHeight(t testing.TB, height uint64, returnTxToUtx bool) *proto.BlockID
- func (c *HTTPClient) SignCommit(t testing.TB, req *client.SignCommitRequest) *proto.CommitToGenerationWithProofs
- func (c *HTTPClient) StateHash(t testing.TB, height uint64, opts ...config.WaitOption) proto.StateHash
- func (c *HTTPClient) TransactionBroadcast(transaction proto.Transaction) (*client.Response, error)
- func (c *HTTPClient) TransactionInfo(t testing.TB, id crypto.Digest) proto.Transaction
- func (c *HTTPClient) TransactionInfoRaw(id crypto.Digest) (proto.Transaction, *client.Response, error)
- func (c *HTTPClient) WavesBalance(t testing.TB, address proto.WavesAddress) *client.AddressesBalance
- type Implementation
- type NetClient
- func (c *NetClient) AwaitGetBlockMessage(timeout time.Duration) (proto.BlockID, error)
- func (c *NetClient) AwaitMessage(messageType reflect.Type, timeout time.Duration) (proto.Message, error)
- func (c *NetClient) AwaitMicroblockRequest(timeout time.Duration) (proto.BlockID, error)
- func (c *NetClient) AwaitScoreMessage(timeout time.Duration) (*big.Int, error)
- func (c *NetClient) Close()
- func (c *NetClient) SendHandshake()
- func (c *NetClient) SendMessage(m proto.Message)
- func (c *NetClient) SubscribeForMessages(messageType ...reflect.Type) error
- type NodeUniversalClient
- func (c *NodeUniversalClient) Close(t testing.TB)
- func (c *NodeUniversalClient) Handshake()
- func (c *NodeUniversalClient) SendEndMessage(t *testing.T)
- func (c *NodeUniversalClient) SendStartMessage(t *testing.T)
- func (c *NodeUniversalClient) WaitForHeight(t testing.TB, height uint64, opts ...config.WaitOption) uint64
- func (c *NodeUniversalClient) WaitForTransaction(t testing.TB, id crypto.Digest, opts ...config.WaitOption)
- type NodesClients
- func (c *NodesClients) BroadcastToGoNode(t *testing.T, tx proto.Transaction) (*client.Response, error)
- func (c *NodesClients) BroadcastToNodes(t *testing.T, tx proto.Transaction, nodes []Implementation) (*client.Response, error, *client.Response, error)
- func (c *NodesClients) BroadcastToScalaNode(t *testing.T, tx proto.Transaction) (*client.Response, error)
- func (c *NodesClients) Close(t *testing.T)
- func (c *NodesClients) GetMinNodesHeight(t *testing.T) uint64
- func (c *NodesClients) Handshake()
- func (c *NodesClients) SendEndMessage(t *testing.T)
- func (c *NodesClients) SendStartMessage(t *testing.T)
- func (c *NodesClients) SendToGoNode(t *testing.T, m proto.Message)
- func (c *NodesClients) SendToNodes(t *testing.T, m proto.Message, nodes []Implementation)
- func (c *NodesClients) SendToScalaNode(t *testing.T, m proto.Message)
- func (c *NodesClients) StateHashCmp(t *testing.T, height uint64) (proto.StateHash, proto.StateHash, bool)
- func (c *NodesClients) SynchronizedWavesBalances(t *testing.T, addresses ...proto.WavesAddress) SynchronisedBalances
- func (c *NodesClients) WaitForConnectedPeers(ctx context.Context, timeout time.Duration) error
- func (c *NodesClients) WaitForHeight(t *testing.T, height uint64, opts ...config.WaitOption) uint64
- func (c *NodesClients) WaitForNewHeight(t *testing.T) uint64
- func (c *NodesClients) WaitForStateHashEquality(t *testing.T)
- func (c *NodesClients) WaitForTransaction(id crypto.Digest, timeout time.Duration) (error, error)
- type NodesWavesBalance
- type NodesWavesBalanceAtHeight
- type SynchronisedBalances
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
func NewGRPCClient ¶
func NewGRPCClient(t *testing.T, impl Implementation, port string) *GRPCClient
func (*GRPCClient) Close ¶
func (c *GRPCClient) Close(t testing.TB)
func (*GRPCClient) GetAddressByAlias ¶
func (c *GRPCClient) GetAddressByAlias(t *testing.T, alias string) []byte
func (*GRPCClient) GetAssetBalance ¶
func (c *GRPCClient) GetAssetBalance(t *testing.T, address proto.WavesAddress, id []byte) *waves.Amount
func (*GRPCClient) GetAssetsInfo ¶
func (c *GRPCClient) GetAssetsInfo(t *testing.T, id []byte) *g.AssetInfoResponse
func (*GRPCClient) GetBlock ¶
func (c *GRPCClient) GetBlock(t *testing.T, height uint64) *g.BlockWithHeight
func (*GRPCClient) GetDataEntries ¶
func (c *GRPCClient) GetDataEntries(t *testing.T, address proto.WavesAddress) []*waves.DataEntry
GetDataEntries returns all data entries for account.
func (*GRPCClient) GetDataEntryByKey ¶
func (c *GRPCClient) GetDataEntryByKey(t *testing.T, address proto.WavesAddress, key string) *waves.DataEntry
GetDataEntryByKey return data entries for account by key.
func (*GRPCClient) GetFeatureActivationStatusInfo ¶
func (c *GRPCClient) GetFeatureActivationStatusInfo(t *testing.T, h int32) *g.ActivationStatusResponse
func (*GRPCClient) GetHeight ¶
func (c *GRPCClient) GetHeight(t *testing.T) *client.BlocksHeight
func (*GRPCClient) GetTransactionsStatuses ¶
func (c *GRPCClient) GetTransactionsStatuses(t *testing.T, txIDs []crypto.Digest) []*g.TransactionStatus
func (*GRPCClient) GetWavesBalance ¶
func (c *GRPCClient) GetWavesBalance(t *testing.T, address proto.WavesAddress) *g.BalanceResponse_WavesBalances
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient(t testing.TB, impl Implementation, port string) *HTTPClient
func (*HTTPClient) AssetBalance ¶
func (c *HTTPClient) AssetBalance( t testing.TB, address proto.WavesAddress, assetID crypto.Digest, ) *client.AssetsBalanceAndAsset
func (*HTTPClient) BlockFinalized ¶
func (c *HTTPClient) BlockFinalized(t testing.TB) *proto.BlockHeader
func (*HTTPClient) BlockHeader ¶
func (*HTTPClient) CommitmentGeneratorsAt ¶
func (c *HTTPClient) CommitmentGeneratorsAt(t testing.TB, height proto.Height) []client.GeneratorInfoResponse
func (*HTTPClient) ConnectedPeers ¶
func (c *HTTPClient) ConnectedPeers() ([]*client.PeersConnectedRow, *client.Response, error)
func (*HTTPClient) ConnectedPeersCtx ¶
func (c *HTTPClient) ConnectedPeersCtx(ctx context.Context) ([]*client.PeersConnectedRow, *client.Response, error)
func (*HTTPClient) GetAssetDetails ¶
func (c *HTTPClient) GetAssetDetails(assetID crypto.Digest) (*client.AssetsDetail, error)
func (*HTTPClient) GetHeight ¶
func (c *HTTPClient) GetHeight(t testing.TB, opts ...config.WaitOption) *client.BlocksHeight
func (*HTTPClient) HeightFinalized ¶
func (c *HTTPClient) HeightFinalized(t testing.TB) proto.Height
func (*HTTPClient) Rewards ¶
func (c *HTTPClient) Rewards(t testing.TB) *client.RewardInfo
func (*HTTPClient) RewardsAtHeight ¶
func (c *HTTPClient) RewardsAtHeight(t testing.TB, height proto.Height) *client.RewardInfo
func (*HTTPClient) RollbackToHeight ¶
func (*HTTPClient) SignCommit ¶
func (c *HTTPClient) SignCommit( t testing.TB, req *client.SignCommitRequest, ) *proto.CommitToGenerationWithProofs
func (*HTTPClient) StateHash ¶
func (c *HTTPClient) StateHash(t testing.TB, height uint64, opts ...config.WaitOption) proto.StateHash
func (*HTTPClient) TransactionBroadcast ¶
func (c *HTTPClient) TransactionBroadcast(transaction proto.Transaction) (*client.Response, error)
func (*HTTPClient) TransactionInfo ¶
func (c *HTTPClient) TransactionInfo(t testing.TB, id crypto.Digest) proto.Transaction
func (*HTTPClient) TransactionInfoRaw ¶
func (c *HTTPClient) TransactionInfoRaw(id crypto.Digest) (proto.Transaction, *client.Response, error)
func (*HTTPClient) WavesBalance ¶
func (c *HTTPClient) WavesBalance(t testing.TB, address proto.WavesAddress) *client.AddressesBalance
type Implementation ¶
type Implementation byte
const ( NodeGo Implementation = iota NodeScala )
func (Implementation) String ¶
func (i Implementation) String() string
type NetClient ¶
type NetClient struct {
// contains filtered or unexported fields
}
func NewNetClient ¶
func NewNetClient( ctx context.Context, t testing.TB, impl Implementation, address string, peers []proto.PeerInfo, ) *NetClient
NewNetClient creates a new NetClient instance that connects to the specified Waves node. It establishes a TCP connection to given address. Parameter peers is a list of peer information that the client will use to respond to GetPeersMessage requests.
func (*NetClient) AwaitGetBlockMessage ¶
AwaitGetBlockMessage waits for a GetBlockMessage from the node for the specified timeout and returns the requested block ID.
func (*NetClient) AwaitMessage ¶
func (c *NetClient) AwaitMessage(messageType reflect.Type, timeout time.Duration) (proto.Message, error)
AwaitMessage waits for a message from the node for the specified timeout.
func (*NetClient) AwaitMicroblockRequest ¶
AwaitMicroblockRequest waits for a MicroBlockRequestMessage from the node for the specified timeout and returns the received block ID.
func (*NetClient) AwaitScoreMessage ¶
AwaitScoreMessage waits for a ScoreMessage from the node for the specified timeout and returns the received score.
func (*NetClient) SendHandshake ¶
func (c *NetClient) SendHandshake()
func (*NetClient) SendMessage ¶
type NodeUniversalClient ¶
type NodeUniversalClient struct {
Implementation Implementation
HTTPClient *HTTPClient
GRPCClient *GRPCClient
Connection *NetClient
}
func NewNodeUniversalClient ¶
func NewNodeUniversalClient( ctx context.Context, t *testing.T, impl Implementation, httpPort, grpcPort, netAddress string, peers []proto.PeerInfo, ) *NodeUniversalClient
func (*NodeUniversalClient) Close ¶
func (c *NodeUniversalClient) Close(t testing.TB)
func (*NodeUniversalClient) Handshake ¶
func (c *NodeUniversalClient) Handshake()
func (*NodeUniversalClient) SendEndMessage ¶
func (c *NodeUniversalClient) SendEndMessage(t *testing.T)
func (*NodeUniversalClient) SendStartMessage ¶
func (c *NodeUniversalClient) SendStartMessage(t *testing.T)
func (*NodeUniversalClient) WaitForHeight ¶
func (c *NodeUniversalClient) WaitForHeight(t testing.TB, height uint64, opts ...config.WaitOption) uint64
func (*NodeUniversalClient) WaitForTransaction ¶
func (c *NodeUniversalClient) WaitForTransaction(t testing.TB, id crypto.Digest, opts ...config.WaitOption)
type NodesClients ¶
type NodesClients struct {
GoClient *NodeUniversalClient
ScalaClient *NodeUniversalClient
}
func NewNodesClients ¶
func NewNodesClients( ctx context.Context, t *testing.T, goIP, scalaIP string, goPorts, scalaPorts *d.PortConfig, ) *NodesClients
func (*NodesClients) BroadcastToGoNode ¶
func (c *NodesClients) BroadcastToGoNode(t *testing.T, tx proto.Transaction) (*client.Response, error)
func (*NodesClients) BroadcastToNodes ¶
func (c *NodesClients) BroadcastToNodes(t *testing.T, tx proto.Transaction, nodes []Implementation) (*client.Response, error, *client.Response, error)
func (*NodesClients) BroadcastToScalaNode ¶
func (c *NodesClients) BroadcastToScalaNode(t *testing.T, tx proto.Transaction) (*client.Response, error)
func (*NodesClients) Close ¶
func (c *NodesClients) Close(t *testing.T)
func (*NodesClients) GetMinNodesHeight ¶
func (c *NodesClients) GetMinNodesHeight(t *testing.T) uint64
func (*NodesClients) Handshake ¶
func (c *NodesClients) Handshake()
func (*NodesClients) SendEndMessage ¶
func (c *NodesClients) SendEndMessage(t *testing.T)
func (*NodesClients) SendStartMessage ¶
func (c *NodesClients) SendStartMessage(t *testing.T)
func (*NodesClients) SendToGoNode ¶
func (c *NodesClients) SendToGoNode(t *testing.T, m proto.Message)
func (*NodesClients) SendToNodes ¶
func (c *NodesClients) SendToNodes(t *testing.T, m proto.Message, nodes []Implementation)
func (*NodesClients) SendToScalaNode ¶
func (c *NodesClients) SendToScalaNode(t *testing.T, m proto.Message)
func (*NodesClients) StateHashCmp ¶
func (*NodesClients) SynchronizedWavesBalances ¶
func (c *NodesClients) SynchronizedWavesBalances( t *testing.T, addresses ...proto.WavesAddress, ) SynchronisedBalances
func (*NodesClients) WaitForConnectedPeers ¶
func (*NodesClients) WaitForHeight ¶
func (c *NodesClients) WaitForHeight(t *testing.T, height uint64, opts ...config.WaitOption) uint64
WaitForHeight waits for nodes to get on given height. Exits if nodes' height already equal or greater than requested. Function returns actual nodes' height.
func (*NodesClients) WaitForNewHeight ¶
func (c *NodesClients) WaitForNewHeight(t *testing.T) uint64
WaitForNewHeight waits for nodes to generate new block. Returns the height that was *before* generation of new block.
func (*NodesClients) WaitForStateHashEquality ¶
func (c *NodesClients) WaitForStateHashEquality(t *testing.T)
func (*NodesClients) WaitForTransaction ¶
type NodesWavesBalance ¶
func (*NodesWavesBalance) Add ¶
func (b *NodesWavesBalance) Add(other NodesWavesBalance) NodesWavesBalance
type NodesWavesBalanceAtHeight ¶
type NodesWavesBalanceAtHeight struct {
Balance NodesWavesBalance
Height proto.Height
}
type SynchronisedBalances ¶
SynchronisedBalances is a struct that contains BalanceInWaves of addresses and the height at which they were received.
func NewSynchronisedBalances ¶
func NewSynchronisedBalances() SynchronisedBalances
func (*SynchronisedBalances) GetByAccountInfo ¶
func (b *SynchronisedBalances) GetByAccountInfo(accountInfo *config.AccountInfo) NodesWavesBalance
func (*SynchronisedBalances) Put ¶
func (b *SynchronisedBalances) Put(address proto.WavesAddress, balance NodesWavesBalance)