Skip to content

Commit

Permalink
Add deprecation notes to test clients.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdee committed Dec 4, 2023
1 parent 7b70672 commit cddc7a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions testclients/erroring.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ func (s *Erroring) maybeError(_ context.Context) error {
}

// EpochFromStateID converts a state ID to its epoch.
//
// Deprecated: use chaintime.
func (s *Erroring) EpochFromStateID(ctx context.Context, stateID string) (phase0.Epoch, error) {
if err := s.maybeError(ctx); err != nil {
return 0, err
Expand All @@ -95,6 +97,8 @@ func (s *Erroring) EpochFromStateID(ctx context.Context, stateID string) (phase0
}

// SlotFromStateID converts a state ID to its slot.
//
// Deprecated: use chaintime.
func (s *Erroring) SlotFromStateID(ctx context.Context, stateID string) (phase0.Slot, error) {
if err := s.maybeError(ctx); err != nil {
return 0, err
Expand Down
4 changes: 4 additions & 0 deletions testclients/sleepy.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ func (s *Sleepy) sleep(_ context.Context) {
}

// EpochFromStateID converts a state ID to its epoch.
//
// Deprecated: use chaintime.
func (s *Sleepy) EpochFromStateID(ctx context.Context, stateID string) (phase0.Epoch, error) {
s.sleep(ctx)
next, isNext := s.next.(consensusclient.EpochFromStateIDProvider)
Expand All @@ -90,6 +92,8 @@ func (s *Sleepy) EpochFromStateID(ctx context.Context, stateID string) (phase0.E
}

// SlotFromStateID converts a state ID to its slot.
//
// Deprecated: use chaintime.
func (s *Sleepy) SlotFromStateID(ctx context.Context, stateID string) (phase0.Slot, error) {
s.sleep(ctx)
next, isNext := s.next.(consensusclient.SlotFromStateIDProvider)
Expand Down

0 comments on commit cddc7a4

Please sign in to comment.