Skip to content

Commit

Permalink
BeaconNodes -> BeaconNodeSet
Browse files Browse the repository at this point in the history
  • Loading branch information
farazdagi committed Mar 25, 2021
1 parent 497fa52 commit ec3fa52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
16 changes: 8 additions & 8 deletions endtoend/components/beacon_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,31 @@ import (
)

var _ e2etypes.ComponentRunner = (*BeaconNode)(nil)
var _ e2etypes.ComponentRunner = (*BeaconNodes)(nil)
var _ e2etypes.ComponentRunner = (*BeaconNodeSet)(nil)

// BeaconNodes represents set of beacon nodes.
type BeaconNodes struct {
// BeaconNodeSet represents set of beacon nodes.
type BeaconNodeSet struct {
e2etypes.ComponentRunner
config *e2etypes.E2EConfig
enr string
started chan struct{}
}

// SetENR assigns ENR to the set of beacon nodes.
func (s *BeaconNodes) SetENR(enr string) {
func (s *BeaconNodeSet) SetENR(enr string) {
s.enr = enr
}

// NewBeaconNodes creates and returns a set of beacon nodes.
func NewBeaconNodes(config *e2etypes.E2EConfig) *BeaconNodes {
return &BeaconNodes{
func NewBeaconNodes(config *e2etypes.E2EConfig) *BeaconNodeSet {
return &BeaconNodeSet{
config: config,
started: make(chan struct{}, 1),
}
}

// Start starts all the beacon nodes in set.
func (s *BeaconNodes) Start(ctx context.Context) error {
func (s *BeaconNodeSet) Start(ctx context.Context) error {
if s.enr == "" {
return errors.New("empty ENR")
}
Expand Down Expand Up @@ -82,7 +82,7 @@ func (s *BeaconNodes) Start(ctx context.Context) error {
}

// Started checks whether beacon node set is started and all nodes are ready to be queried.
func (s *BeaconNodes) Started() <-chan struct{} {
func (s *BeaconNodeSet) Started() <-chan struct{} {
return s.started
}

Expand Down
5 changes: 0 additions & 5 deletions endtoend/components/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ type ValidatorNodes struct {
started chan struct{}
}

// SetENR assigns ENR to the set of beacon nodes.
func (s *BeaconNodes) SetParams(enr string) {
s.enr = enr
}

// NewValidatorNodes creates and returns a set of validator nodes.
func NewValidatorNodes(config *e2etypes.E2EConfig) *ValidatorNodes {
return &ValidatorNodes{
Expand Down

0 comments on commit ec3fa52

Please sign in to comment.