prysm-pulse/beacon-chain/operations/exit_test.go
terence tsao 97905c3e79
Refactor operation service.go into smaller files (#3808)
* Different files

* Preston's feedback
2019-10-21 09:37:50 -07:00

27 lines
717 B
Go

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 := &ethpb.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)
}