package operations import ( "context" "testing" dbutil "github.com/prysmaticlabs/prysm/beacon-chain/db/testing" ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1" "github.com/prysmaticlabs/prysm/shared/testutil" logTest "github.com/sirupsen/logrus/hooks/test" ) func TestIncomingExits_Ok(t *testing.T) { hook := logTest.NewGlobal() beaconDB := dbutil.SetupDB(t) defer dbutil.TeardownDB(t, beaconDB) service := NewService(context.Background(), &Config{BeaconDB: beaconDB}) exit := ðpb.VoluntaryExit{Epoch: 100} if err := service.HandleValidatorExits(context.Background(), exit); err != nil { t.Error(err) } want := "Exit request saved in DB" testutil.AssertLogsContain(t, hook, want) }