Skip to content

Commit

Permalink
feat(validator): update mock to remove init
Browse files Browse the repository at this point in the history
  • Loading branch information
GMKrieger authored and vfusco committed Jul 8, 2024
1 parent f17b8ab commit a65d62d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
21 changes: 0 additions & 21 deletions internal/validator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,6 @@ type ValidatorRepository interface {
endBlock uint64,
timeout *time.Duration,
) ([]Output, error)
// InsertFirstEpochTransaction performs a database transaction
// containing two operations:
//
// 1. Inserts a new Epoch
//
// 2. Updates the current Epoch to the newly created Epoch
//
// This should only be called once to set up the first Epoch in the database.
// If there's a current Epoch already, this call will have no effect
InsertFirstEpochTransaction(
ctx context.Context,
epoch Epoch,
) error
// FinishEmptyEpochTransaction performs a database transaction
// containing two operations:
//
Expand Down Expand Up @@ -89,14 +76,6 @@ func (v Validator) String() string {
}

func (v Validator) Start(ctx context.Context, ready chan<- struct{}) error {
// create and attempt to insert the first epoch
epoch := Epoch{
StartBlock: v.inputBoxDeploymentBlock,
EndBlock: v.inputBoxDeploymentBlock + v.epochDuration,
}
if err := v.repo.InsertFirstEpochTransaction(ctx, epoch); err != nil {
return err
}
ready <- struct{}{}

ticker := time.NewTicker(TICK_INTERVAL)
Expand Down
1 change: 0 additions & 1 deletion internal/validator/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func (s *ValidatorSuite) TestItEventuallyBecomesReady() {

select {
case <-ready:
s.repo.AssertNumberOfCalls(s.T(), "InsertFirstEpochTransaction", 1)
case err := <-errChannel:
s.FailNow("unexpected failure", err)
}
Expand Down

0 comments on commit a65d62d

Please sign in to comment.