mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-31 23:41:22 +00:00
8c04ced1a6
* fixed epoch_processing * penalize->slash * exit -> voluntary_exit * SEED_LOOKAHEAD -> MIN_SEED_LOOKAHED * ENTRY_EXIT_DELAY -> ACTIVATION_EXIT_DELAY * `INCLUDER_REWARD_QUOTIENT` -> `ATTESTATION_INCLUSION_REWARD_QUOTIEN` * LatestIndexRoots -> LatestActiveIndexRoots * `MIN_VALIDATOR_WITHDRAWAL_EPOCHS` -> `MIN_VALIDATOR_WITHDRAWAL_DELAY` * MAX_WITHDRAWALS_PER_EPOCH -> MAX_EXIT_DEQUEUES_PER_EPOCH * ETH1_DATA_VOTING_PERIOD -> EPOCHS_PER_ETH1_VOTING_PERIOD * SLOT_DURATION -> SECONDS_PER_SLOT * EPOCH_LENGTH -> SLOTS_PER_EPOCH * SLOT_DURATION -> SECONDS_PER_SLOT take 2 * rest of the misc fixes for config name changes * remove tools/bootnode/.!74296!bootnode.go * `current_epoch_start_shard` -> `current_shuffling_start_shard`, `current_shuffling_epoch`, `current_shuffling_see` * go fmt * fixed comment * updated pseudocode comments * merged master
33 lines
620 B
Go
33 lines
620 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.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(d); err != nil {
|
|
t.Fatalf("Failed to save exit request: %v", err)
|
|
}
|
|
if !db.HasExit(hash) {
|
|
t.Fatal("Expected HasExit to return true")
|
|
}
|
|
}
|