mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-04 08:44:28 +00:00
7ae19ec370
* fix bug in eth1 data vote count increases * updating attester slashings * is double vote and attester pseudocode * attester slashing revamp complete * exits processing complete * all block operations aligned to spec * completed test revamp * builds properly * all done FINALLY * address comms * comment * no more confusing is double vote function * surround
33 lines
611 B
Go
33 lines
611 B
Go
package db
|
|
|
|
import (
|
|
"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.Exit{
|
|
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(d); err != nil {
|
|
t.Fatalf("Failed to save exit request: %v", err)
|
|
}
|
|
if !db.HasExit(hash) {
|
|
t.Fatal("Expected HasExit to return true")
|
|
}
|
|
}
|