mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 16:37:39 +00:00
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)
|
||
|
}
|