Documentation
¶
Index ¶
- type ClusterOption
- func WithBlockGasLimit(blockGasLimit uint64) ClusterOption
- func WithBootnodeCount(cnt int) ClusterOption
- func WithBridge() ClusterOption
- func WithEpochReward(epochReward int) ClusterOption
- func WithEpochSize(epochSize int) ClusterOption
- func WithNonValidators(num int) ClusterOption
- func WithPremine(addresses ...types.Address) ClusterOption
- func WithPremineValidators(premineBalance string) ClusterOption
- func WithPropertyBaseTests(propertyBaseTests bool) ClusterOption
- func WithSecretsCallback(fn func([]types.Address, *TestClusterConfig)) ClusterOption
- func WithValidatorSnapshot(validatorsLen uint64) ClusterOption
- type TestBridge
- type TestCluster
- func (c *TestCluster) EmitTransfer(contractAddress, walletAddresses, amounts string) error
- func (c *TestCluster) Fail(err error)
- func (c *TestCluster) InitSecrets(prefix string, count int) ([]types.Address, error)
- func (c *TestCluster) InitTestServer(t *testing.T, i int, isValidator bool, relayer bool)
- func (c *TestCluster) Stats(t *testing.T)
- func (c *TestCluster) Stop()
- func (c *TestCluster) WaitForBlock(n uint64, timeout time.Duration) error
- func (c *TestCluster) WaitForGeneric(dur time.Duration, fn func(*TestServer) bool) error
- func (c *TestCluster) WaitUntil(dur time.Duration, handler func() bool) error
- type TestClusterConfig
- type TestServer
- func (t *TestServer) Conn() proto.SystemClient
- func (t *TestServer) Delegate(amount uint64, secrets string, validatorAddr ethgo.Address) error
- func (t *TestServer) GrpcAddr() string
- func (t *TestServer) JSONRPC() *jsonrpc.Client
- func (t *TestServer) JSONRPCAddr() string
- func (t *TestServer) RegisterValidator(secrets string, balance string, stake string) error
- func (t *TestServer) Stake(amount uint64) error
- func (t *TestServer) Start()
- func (t *TestServer) Stop()
- func (t *TestServer) Undelegate(amount uint64, secrets string, validatorAddr ethgo.Address) error
- func (t *TestServer) Unstake(amount uint64) error
- func (t *TestServer) Withdraw(secrets string, recipient ethgo.Address) error
- type TestServerConfig
- type TestServerConfigCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterOption ¶
type ClusterOption func(*TestClusterConfig)
func WithBlockGasLimit ¶
func WithBlockGasLimit(blockGasLimit uint64) ClusterOption
func WithBootnodeCount ¶
func WithBootnodeCount(cnt int) ClusterOption
func WithBridge ¶
func WithBridge() ClusterOption
func WithEpochReward ¶
func WithEpochReward(epochReward int) ClusterOption
func WithEpochSize ¶
func WithEpochSize(epochSize int) ClusterOption
func WithNonValidators ¶
func WithNonValidators(num int) ClusterOption
func WithPremine ¶
func WithPremine(addresses ...types.Address) ClusterOption
func WithPremineValidators ¶
func WithPremineValidators(premineBalance string) ClusterOption
func WithPropertyBaseTests ¶
func WithPropertyBaseTests(propertyBaseTests bool) ClusterOption
func WithSecretsCallback ¶
func WithSecretsCallback(fn func([]types.Address, *TestClusterConfig)) ClusterOption
func WithValidatorSnapshot ¶
func WithValidatorSnapshot(validatorsLen uint64) ClusterOption
type TestBridge ¶
type TestBridge struct {
// contains filtered or unexported fields
}
func NewTestBridge ¶
func NewTestBridge(t *testing.T, clusterConfig *TestClusterConfig) (*TestBridge, error)
func (*TestBridge) JSONRPCAddr ¶
func (t *TestBridge) JSONRPCAddr() string
func (*TestBridge) Start ¶
func (t *TestBridge) Start() error
func (*TestBridge) Stop ¶
func (t *TestBridge) Stop()
type TestCluster ¶
type TestCluster struct { Config *TestClusterConfig Servers []*TestServer Bridge *TestBridge // contains filtered or unexported fields }
func NewTestCluster ¶
func NewTestCluster(t *testing.T, validatorsCount int, opts ...ClusterOption) *TestCluster
func (*TestCluster) EmitTransfer ¶
func (c *TestCluster) EmitTransfer(contractAddress, walletAddresses, amounts string) error
EmitTransfer function is used to invoke e2e rootchain emit command with appropriately created wallets and amounts for test transactions
func (*TestCluster) Fail ¶
func (c *TestCluster) Fail(err error)
func (*TestCluster) InitSecrets ¶
InitSecrets initializes account(s) secrets with given prefix. (secrets are being stored in the temp directory created by given e2e test execution)
func (*TestCluster) InitTestServer ¶
func (*TestCluster) Stats ¶
func (c *TestCluster) Stats(t *testing.T)
func (*TestCluster) Stop ¶
func (c *TestCluster) Stop()
func (*TestCluster) WaitForBlock ¶
func (c *TestCluster) WaitForBlock(n uint64, timeout time.Duration) error
func (*TestCluster) WaitForGeneric ¶
func (c *TestCluster) WaitForGeneric(dur time.Duration, fn func(*TestServer) bool) error
WaitForGeneric waits until all running servers returns true from fn callback or timeout defined by dur occurs
type TestClusterConfig ¶
type TestClusterConfig struct { Name string Premine []string // address[:amount] PremineValidators string HasBridge bool BootnodeCount int NonValidatorCount int WithLogs bool WithStdout bool LogsDir string TmpDir string BlockGasLimit uint64 ContractsDir string ValidatorPrefix string Binary string ValidatorSetSize uint64 EpochSize int EpochReward int PropertyBaseTests bool SecretsCallback func([]types.Address, *TestClusterConfig) // contains filtered or unexported fields }
func (*TestClusterConfig) Dir ¶
func (c *TestClusterConfig) Dir(name string) string
type TestServer ¶
type TestServer struct {
// contains filtered or unexported fields
}
func NewTestServer ¶
func NewTestServer(t *testing.T, clusterConfig *TestClusterConfig, callback TestServerConfigCallback) *TestServer
func (*TestServer) Conn ¶
func (t *TestServer) Conn() proto.SystemClient
func (*TestServer) Delegate ¶
Delegate delegates given amount by the account in secrets to validatorAddr validator
func (*TestServer) GrpcAddr ¶
func (t *TestServer) GrpcAddr() string
func (*TestServer) JSONRPC ¶
func (t *TestServer) JSONRPC() *jsonrpc.Client
func (*TestServer) JSONRPCAddr ¶
func (t *TestServer) JSONRPCAddr() string
func (*TestServer) RegisterValidator ¶
func (t *TestServer) RegisterValidator(secrets string, balance string, stake string) error
RegisterValidator is a wrapper function which registers new validator with given balance and stake
func (*TestServer) Stake ¶
func (t *TestServer) Stake(amount uint64) error
Stake stakes given amount to validator account encapsulated by given server instance
func (*TestServer) Start ¶
func (t *TestServer) Start()
func (*TestServer) Stop ¶
func (t *TestServer) Stop()
func (*TestServer) Undelegate ¶
Undelegate undelegates given amount by the account in secrets from validatorAddr validator
func (*TestServer) Unstake ¶
func (t *TestServer) Unstake(amount uint64) error
Unstake unstakes given amount from validator account encapsulated by given server instance
type TestServerConfig ¶
type TestServerConfigCallback ¶
type TestServerConfigCallback func(*TestServerConfig)