Skip to content

Commit

Permalink
fix e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
gitferry committed Oct 8, 2024
1 parent 5fc6da8 commit 8088f44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
6 changes: 3 additions & 3 deletions finality-provider/service/fp_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,16 @@ func (fpm *FinalityProviderManager) Stop() error {
return fmt.Errorf("the finality-provider manager has already stopped")
}

close(fpm.quit)
fpm.wg.Wait()

if fpm.fpIns == nil {
return nil
}
if !fpm.fpIns.IsRunning() {
return nil
}

close(fpm.quit)
fpm.wg.Wait()

return fpm.fpIns.Stop()
}

Expand Down
10 changes: 2 additions & 8 deletions itest/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/btcsuite/btcd/btcec/v2"
"github.com/stretchr/testify/require"

"github.com/babylonlabs-io/finality-provider/finality-provider/proto"
"github.com/babylonlabs-io/finality-provider/types"
)

Expand Down Expand Up @@ -100,14 +99,9 @@ func TestDoubleSigning(t *testing.T) {

tm.WaitForFpShutDown(t)

// try to start all the finality providers and the slashed one should not be restarted
// try to start the finality providers and the slashed one should expect err
err = tm.Fpa.StartHandlingFinalityProvider(fpIns.GetBtcPkBIP340(), "")
require.NoError(t, err)
fps, err := tm.Fpa.ListAllFinalityProvidersInfo()
require.NoError(t, err)
require.Equal(t, 1, len(fps))
require.Equal(t, proto.FinalityProviderStatus_name[4], fps[0].Status)
require.Equal(t, false, fps[0].IsRunning)
require.Error(t, err)
}

// TestFastSync tests the fast sync process where the finality-provider is terminated and restarted with fast sync
Expand Down

0 comments on commit 8088f44

Please sign in to comment.