mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-26 05:17:22 +00:00
612bb38077
* Fix assignments bug where validators don't retry for assignments on failure * synch only please * trying to fix state issues * trying random stuff * do not explode * use ctx * working build, failing tests * broadcast local addrs as well as relay addrs * fixed p2p tests, more tests to fix still * another test fixed, log warning instead of throw error * Fix last tests * godoc * add test for broadcast in apply fork choiec * remove unneeded code * remove tracer adapter, not needed * remove extra stuff * remove any * revert addr_factory * revert addr_factory * Revert "revert addr_factory" This reverts commit e93fb706494a1070158b8db31e67146d6b0648ad. * Revert "revert addr_factory" This reverts commit dedaa405559cc818698870c4e4570953367f1e3c. * revert removal of this code * unused param
34 lines
653 B
Go
34 lines
653 B
Go
package db
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
|
"github.com/prysmaticlabs/prysm/shared/hashutil"
|
|
)
|
|
|
|
func TestBeaconDB_HasExit(t *testing.T) {
|
|
db := setupDB(t)
|
|
defer teardownDB(t, db)
|
|
|
|
d := &pb.VoluntaryExit{
|
|
Epoch: 100,
|
|
}
|
|
hash, err := hashutil.HashProto(d)
|
|
if err != nil {
|
|
t.Fatalf("could not hash exit request: %v", err)
|
|
}
|
|
|
|
if db.HasExit(hash) {
|
|
t.Fatal("Expected HasExit to return false")
|
|
}
|
|
|
|
if err := db.SaveExit(context.Background(), d); err != nil {
|
|
t.Fatalf("Failed to save exit request: %v", err)
|
|
}
|
|
if !db.HasExit(hash) {
|
|
t.Fatal("Expected HasExit to return true")
|
|
}
|
|
}
|