From a65d62d71beb1275d0f369694fac1423db1fe302 Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Krieger Date: Fri, 31 May 2024 14:29:38 -0300 Subject: [PATCH] feat(validator): update mock to remove init --- internal/validator/validator.go | 21 --------------------- internal/validator/validator_test.go | 1 - 2 files changed, 22 deletions(-) diff --git a/internal/validator/validator.go b/internal/validator/validator.go index 4fbd0af97..926352deb 100644 --- a/internal/validator/validator.go +++ b/internal/validator/validator.go @@ -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: // @@ -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) diff --git a/internal/validator/validator_test.go b/internal/validator/validator_test.go index 79ec321b5..7e09a5686 100644 --- a/internal/validator/validator_test.go +++ b/internal/validator/validator_test.go @@ -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) }