Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
cihati committed Oct 2, 2023
1 parent 6aa422c commit 7f6575e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
5 changes: 2 additions & 3 deletions http/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"strings"

api "github.com/attestantio/go-eth2-client/api/v1"
v1 "github.com/attestantio/go-eth2-client/api/v1"
"github.com/attestantio/go-eth2-client/spec/phase0"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -72,7 +71,7 @@ func (s *Service) indexChunkSize(ctx context.Context) int {
// stateID can be a slot number or state root, or one of the special values "genesis", "head", "justified" or "finalized".
// validatorIndices is a list of validators to restrict the returned values. If no validators are supplied no filter will be applied.
// validatorStates is a list of validator states to restrict the returned values. If no states are supplied no filter will be applied.
func (s *Service) Validators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex, validatorStates []v1.ValidatorState) (map[phase0.ValidatorIndex]*api.Validator, error) {
func (s *Service) Validators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex, validatorStates []api.ValidatorState) (map[phase0.ValidatorIndex]*api.Validator, error) {
if stateID == "" {
return nil, errors.New("no state ID specified")
}
Expand Down Expand Up @@ -181,7 +180,7 @@ func (s *Service) validatorsFromState(ctx context.Context, stateID string) (map[
}

// chunkedValidators obtains the validators a chunk at a time.
func (s *Service) chunkedValidators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex, validatorStates []v1.ValidatorState) (map[phase0.ValidatorIndex]*api.Validator, error) {
func (s *Service) chunkedValidators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex, validatorStates []api.ValidatorState) (map[phase0.ValidatorIndex]*api.Validator, error) {
res := make(map[phase0.ValidatorIndex]*api.Validator)
indexChunkSize := s.indexChunkSize(ctx)
for i := 0; i < len(validatorIndices); i += indexChunkSize {
Expand Down
2 changes: 1 addition & 1 deletion mock/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ import (
// stateID can be a slot number or state root, or one of the special values "genesis", "head", "justified" or "finalized".
// validatorIndices is a list of validator indices to restrict the returned values. If no validators IDs are supplied no filter
// will be applied.
func (s *Service) Validators(_ context.Context, _ string, _ []phase0.ValidatorIndex) (map[phase0.ValidatorIndex]*api.Validator, error) {
func (s *Service) Validators(_ context.Context, _ string, _ []phase0.ValidatorIndex, _ []api.ValidatorState) (map[phase0.ValidatorIndex]*api.Validator, error) {
return map[phase0.ValidatorIndex]*api.Validator{}, nil
}
3 changes: 1 addition & 2 deletions multi/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (

consensusclient "github.com/attestantio/go-eth2-client"
api "github.com/attestantio/go-eth2-client/api/v1"
v1 "github.com/attestantio/go-eth2-client/api/v1"
"github.com/attestantio/go-eth2-client/spec/phase0"
)

Expand All @@ -30,7 +29,7 @@ import (
func (s *Service) Validators(ctx context.Context,
stateID string,
validatorIndices []phase0.ValidatorIndex,
validatorStates []v1.ValidatorState,
validatorStates []api.ValidatorState,
) (
map[phase0.ValidatorIndex]*api.Validator,
error,
Expand Down
3 changes: 1 addition & 2 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (

api "github.com/attestantio/go-eth2-client/api"
apiv1 "github.com/attestantio/go-eth2-client/api/v1"
v1 "github.com/attestantio/go-eth2-client/api/v1"
"github.com/attestantio/go-eth2-client/spec"
"github.com/attestantio/go-eth2-client/spec/altair"
"github.com/attestantio/go-eth2-client/spec/capella"
Expand Down Expand Up @@ -371,7 +370,7 @@ type ValidatorsProvider interface {
// will be applied.
// validatorStates is a list of validator states to restrict the returned values. If no validators states are supplied no filter
// will be applied.
Validators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex, validatorStates []v1.ValidatorState) (map[phase0.ValidatorIndex]*apiv1.Validator, error)
Validators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex, validatorStates []apiv1.ValidatorState) (map[phase0.ValidatorIndex]*apiv1.Validator, error)

// ValidatorsByPubKey provides the validators, with their balance and status, for a given state.
// stateID can be a slot number or state root, or one of the special values "genesis", "head", "justified" or "finalized".
Expand Down
3 changes: 1 addition & 2 deletions testclients/erroring.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
consensusclient "github.com/attestantio/go-eth2-client"
"github.com/attestantio/go-eth2-client/api"
apiv1 "github.com/attestantio/go-eth2-client/api/v1"
v1 "github.com/attestantio/go-eth2-client/api/v1"
"github.com/attestantio/go-eth2-client/spec"
"github.com/attestantio/go-eth2-client/spec/altair"
"github.com/attestantio/go-eth2-client/spec/deneb"
Expand Down Expand Up @@ -583,7 +582,7 @@ func (s *Erroring) ValidatorBalances(ctx context.Context, stateID string, valida
// will be applied.
// validatorStates is a list of validator states to restrict the returned values. If no validators states are supplied no filter
// will be applied.
func (s *Erroring) Validators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex, validatorStates []v1.ValidatorState) (map[phase0.ValidatorIndex]*apiv1.Validator, error) {
func (s *Erroring) Validators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex, validatorStates []apiv1.ValidatorState) (map[phase0.ValidatorIndex]*apiv1.Validator, error) {
if err := s.maybeError(ctx); err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions testclients/sleepy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
consensusclient "github.com/attestantio/go-eth2-client"
"github.com/attestantio/go-eth2-client/api"
apiv1 "github.com/attestantio/go-eth2-client/api/v1"
v1 "github.com/attestantio/go-eth2-client/api/v1"
"github.com/attestantio/go-eth2-client/spec"
"github.com/attestantio/go-eth2-client/spec/deneb"
"github.com/attestantio/go-eth2-client/spec/phase0"
Expand Down Expand Up @@ -398,7 +397,7 @@ func (s *Sleepy) ValidatorBalances(ctx context.Context, stateID string, validato
// will be applied.
// validatorStates is a list of validator states to restrict the returned values. If no validators states are supplied no filter
// will be applied.
func (s *Sleepy) Validators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex, validatorStates []v1.ValidatorState) (map[phase0.ValidatorIndex]*apiv1.Validator, error) {
func (s *Sleepy) Validators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex, validatorStates []apiv1.ValidatorState) (map[phase0.ValidatorIndex]*apiv1.Validator, error) {
s.sleep(ctx)
next, isNext := s.next.(consensusclient.ValidatorsProvider)
if !isNext {
Expand Down

0 comments on commit 7f6575e

Please sign in to comment.