mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-31 23:41:22 +00:00
97905c3e79
* Different files * Preston's feedback
27 lines
717 B
Go
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 := ð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)
|
|
}
|