prysm-pulse/beacon-chain/operations/voluntaryexits/service_test.go

531 lines
13 KiB
Go
Raw Normal View History

2020-01-21 23:29:04 +00:00
package voluntaryexits
import (
"context"
"reflect"
"testing"
Remove proto state (#11445) * Remove native state flag and use native state in spectests * remove feature from tests * use e2e config in slasher simulator * use params.BeaconConfig in testutil * use correct function * use minimal config in go_test * fix TestListValidators * parameterize sync committee bits and aggregation bits * Fix TestServer_ListIndexedAttestations_GenesisEpoch (cherry picked from commit 254ab623dde08ae8886b152facdbbd8889ed79db) * fix more tests * fix even more * moreeee * aaaand more * one more fix * one more * simplify TestGetAltairDuties_UnknownPubkey * comment out problematic test * one more fix * one more * aaaand one more * another * use fieldparams in HydrateBlindedBeaconBlockBodyBellatrix * create new package for mainnet tests * TestServer_GetBellatrixBeaconBlock * change slashed validator index * clear cache in reward_test.go * deprecate flag * create bazel mainnet target * move attester mainnet test to mainnet target * "fix" proposer tests * use minimal config in TestServer_circuitBreakBuilder * fix TestProposer_ProposeBlock_OK * more fixes in validator package * more fixes * more fixes * test code * move TestProposer_GetBeaconBlock_BellatrixEpoch to minimal * finally * remove proposer_bellatrix_mainnet_test.go * fix TestServer_GetBellatrixBeaconBlock_HappyCase * fix TestServer_GetBellatrixBeaconBlock_BuilderCase * Preston needs to fix this! * Revert "Preston needs to fix this!" This reverts commit b03d97a16e3080e254c7b19d7f193d3c600ca869. * remove proto state tests * fix migration tests * static analysis fix * review * remove proto state * swap state in tests * fix BUILD file in /proto/testing * remove metrics test with nil state
2022-09-16 22:17:46 +00:00
state_native "github.com/prysmaticlabs/prysm/v3/beacon-chain/state/state-native"
"github.com/prysmaticlabs/prysm/v3/config/params"
types "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives"
ethpb "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v3/testing/require"
Change gogoproto compiler to protoc-gen-go-cast (#8697) * Remove gogoproto compiler * Remove more gogoproto * Improvements * Fix gengo * More scripts * Gazelle, fix deps * Fix version and errors * Fix gocast for arrays * Fix ethapis * Fixes * Fix compile errors * fix go.mod * //proto/... builds * Update for protov2 * temp fix compilation to move on * Change everything to emptypb.empty * Add grpc to proto/slashings * Fix almost all build failures * Oher build problems * FIX THIS FUCKING THING * gaz literally every .bazel * Final touches * Final final touches * Fix proto * Begin moving proto.Marshal to native * Fix site_data * Fixes * Fix duplicate gateway * Fix gateway target * Fix ethapis * Fixes from review * Update * Fix * Fix status test * Fix fuzz * Add isprotoslice to fun * Change DeepEqual to DeepSSZEqual for proto arrays * Fix build * Fix gaz * Update go * Fixes * Fixes * Add case for nil validators after copy * Fix cast * Fix test * Fix imports * Go mod * Only use extension where needed * Fixes * Split gateway from gengo * gaz * go mod * Add back hydrated state * fix hydrate * Fix proto.clone * Fies * Revert "Split gateway from gengo" This reverts commit 7298bb2054d446e427d9af97e13b8fabe8695085. * Revert "gaz" This reverts commit ca952565701a88727e22302d6c8d60ac48d97255. * Merge all gateway into one target * go mod * Gaz * Add generate v1_gateway files * run pb again * goimports * gaz * Fix comments * Fix protos * Fix PR * Fix protos * Update grpc-gateway and ethapis * Update ethapis and gen-go-cast * Go tidy * Reorder * Fix ethapis * fix spec tests * Fix script * Remove unused import * Fix fuzz * Fix gomod * Update version * Error if the cloned result is nil * Handle optional slots * ADd more empty checks to clone * Undo fuzz changes * Fix build.bazel * Gaz * Redo fuzz changes * Undo some eth1data changes * Update go.mod Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> * Undo clone beacon state * Remove gogo proto more and unused v1_gateway * Add manual fix for nil vals * Fix gaz * tidy * Tidy again * Add detailed error * Revert "Add detailed error" This reverts commit 59bc053dcd59569a54c95b07739d5a379665ec5d. * Undo varint changes * Fix nil validators in deposit test * Commit * Undo Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> Co-authored-by: Radosław Kapka <rkapka@wp.pl> Co-authored-by: Nishant Das <nishdas93@gmail.com> Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-05-17 18:32:04 +00:00
"google.golang.org/protobuf/proto"
2020-01-21 23:29:04 +00:00
)
func TestPool_InsertVoluntaryExit(t *testing.T) {
type fields struct {
pending []*ethpb.SignedVoluntaryExit
2020-01-21 23:29:04 +00:00
}
type args struct {
exit *ethpb.SignedVoluntaryExit
}
tests := []struct {
name string
fields fields
args args
want []*ethpb.SignedVoluntaryExit
}{
{
name: "Prevent inserting nil exit",
fields: fields{
pending: make([]*ethpb.SignedVoluntaryExit, 0),
},
args: args{
exit: nil,
},
want: []*ethpb.SignedVoluntaryExit{},
},
{
name: "Prevent inserting malformed exit",
fields: fields{
pending: make([]*ethpb.SignedVoluntaryExit, 0),
},
args: args{
exit: &ethpb.SignedVoluntaryExit{
Exit: nil,
},
},
want: []*ethpb.SignedVoluntaryExit{},
},
2020-01-21 23:29:04 +00:00
{
name: "Empty list",
fields: fields{
pending: make([]*ethpb.SignedVoluntaryExit, 0),
2020-01-21 23:29:04 +00:00
},
args: args{
exit: &ethpb.SignedVoluntaryExit{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 1,
},
},
},
want: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 1,
},
},
},
},
{
name: "Duplicate identical exit",
fields: fields{
pending: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 1,
},
},
},
},
args: args{
exit: &ethpb.SignedVoluntaryExit{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 1,
},
},
},
want: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 1,
},
},
},
},
{
name: "Duplicate exit in pending list",
2020-01-21 23:29:04 +00:00
fields: fields{
pending: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 1,
},
},
},
},
args: args{
exit: &ethpb.SignedVoluntaryExit{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
2020-01-21 23:29:04 +00:00
ValidatorIndex: 1,
},
},
},
want: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 1,
},
},
},
},
{
name: "Duplicate validator index",
fields: fields{
pending: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 1,
},
},
},
},
args: args{
exit: &ethpb.SignedVoluntaryExit{
Exit: &ethpb.VoluntaryExit{
Epoch: 20,
ValidatorIndex: 1,
},
},
},
want: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 1,
},
},
},
},
{
name: "Duplicate received with more favorable exit epoch",
fields: fields{
pending: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 1,
},
},
},
},
args: args{
exit: &ethpb.SignedVoluntaryExit{
Exit: &ethpb.VoluntaryExit{
Epoch: 4,
ValidatorIndex: 1,
},
},
},
want: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{
Epoch: 4,
2020-01-21 23:29:04 +00:00
ValidatorIndex: 1,
},
},
},
},
{
name: "Exit for already exited validator",
fields: fields{
pending: []*ethpb.SignedVoluntaryExit{},
2020-01-21 23:29:04 +00:00
},
args: args{
exit: &ethpb.SignedVoluntaryExit{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 2,
},
},
},
want: []*ethpb.SignedVoluntaryExit{},
},
{
name: "Maintains sorted order",
fields: fields{
pending: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 0,
},
},
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 2,
},
},
},
},
args: args{
exit: &ethpb.SignedVoluntaryExit{
Exit: &ethpb.VoluntaryExit{
Epoch: 10,
ValidatorIndex: 1,
},
},
},
want: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 0,
},
},
{
Exit: &ethpb.VoluntaryExit{
Epoch: 10,
ValidatorIndex: 1,
},
},
{
Exit: &ethpb.VoluntaryExit{
Epoch: 12,
ValidatorIndex: 2,
},
},
},
},
}
ctx := context.Background()
validators := []*ethpb.Validator{
{ // 0
ExitEpoch: params.BeaconConfig().FarFutureEpoch,
},
{ // 1
ExitEpoch: params.BeaconConfig().FarFutureEpoch,
},
{ // 2 - Already exited.
ExitEpoch: 15,
},
{ // 3
ExitEpoch: params.BeaconConfig().FarFutureEpoch,
2020-01-21 23:29:04 +00:00
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p := &Pool{
pending: tt.fields.pending,
2020-01-21 23:29:04 +00:00
}
Remove proto state (#11445) * Remove native state flag and use native state in spectests * remove feature from tests * use e2e config in slasher simulator * use params.BeaconConfig in testutil * use correct function * use minimal config in go_test * fix TestListValidators * parameterize sync committee bits and aggregation bits * Fix TestServer_ListIndexedAttestations_GenesisEpoch (cherry picked from commit 254ab623dde08ae8886b152facdbbd8889ed79db) * fix more tests * fix even more * moreeee * aaaand more * one more fix * one more * simplify TestGetAltairDuties_UnknownPubkey * comment out problematic test * one more fix * one more * aaaand one more * another * use fieldparams in HydrateBlindedBeaconBlockBodyBellatrix * create new package for mainnet tests * TestServer_GetBellatrixBeaconBlock * change slashed validator index * clear cache in reward_test.go * deprecate flag * create bazel mainnet target * move attester mainnet test to mainnet target * "fix" proposer tests * use minimal config in TestServer_circuitBreakBuilder * fix TestProposer_ProposeBlock_OK * more fixes in validator package * more fixes * more fixes * test code * move TestProposer_GetBeaconBlock_BellatrixEpoch to minimal * finally * remove proposer_bellatrix_mainnet_test.go * fix TestServer_GetBellatrixBeaconBlock_HappyCase * fix TestServer_GetBellatrixBeaconBlock_BuilderCase * Preston needs to fix this! * Revert "Preston needs to fix this!" This reverts commit b03d97a16e3080e254c7b19d7f193d3c600ca869. * remove proto state tests * fix migration tests * static analysis fix * review * remove proto state * swap state in tests * fix BUILD file in /proto/testing * remove metrics test with nil state
2022-09-16 22:17:46 +00:00
s, err := state_native.InitializeFromProtoUnsafePhase0(&ethpb.BeaconState{Validators: validators})
require.NoError(t, err)
p.InsertVoluntaryExit(ctx, s, tt.args.exit)
2020-01-21 23:29:04 +00:00
if len(p.pending) != len(tt.want) {
t.Fatalf("Mismatched lengths of pending list. Got %d, wanted %d.", len(p.pending), len(tt.want))
}
for i := range p.pending {
if !proto.Equal(p.pending[i], tt.want[i]) {
t.Errorf("Pending exit at index %d does not match expected. Got=%v wanted=%v", i, p.pending[i], tt.want[i])
}
}
})
}
}
func TestPool_MarkIncluded(t *testing.T) {
type fields struct {
pending []*ethpb.SignedVoluntaryExit
2020-01-21 23:29:04 +00:00
}
type args struct {
exit *ethpb.SignedVoluntaryExit
}
tests := []struct {
name string
fields fields
args args
want fields
}{
{
name: "Removes from pending list",
fields: fields{
pending: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{ValidatorIndex: 1},
},
{
Exit: &ethpb.VoluntaryExit{ValidatorIndex: 2},
},
{
Exit: &ethpb.VoluntaryExit{ValidatorIndex: 3},
},
},
},
args: args{
exit: &ethpb.SignedVoluntaryExit{
Exit: &ethpb.VoluntaryExit{ValidatorIndex: 2},
},
},
want: fields{
pending: []*ethpb.SignedVoluntaryExit{
{
Exit: &ethpb.VoluntaryExit{ValidatorIndex: 1},
},
{
Exit: &ethpb.VoluntaryExit{ValidatorIndex: 3},
},
},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p := &Pool{
pending: tt.fields.pending,
2020-01-21 23:29:04 +00:00
}
p.MarkIncluded(tt.args.exit)
if len(p.pending) != len(tt.want.pending) {
t.Fatalf("Mismatched lengths of pending list. Got %d, wanted %d.", len(p.pending), len(tt.want.pending))
}
for i := range p.pending {
if !proto.Equal(p.pending[i], tt.want.pending[i]) {
t.Errorf("Pending exit at index %d does not match expected. Got=%v wanted=%v", i, p.pending[i], tt.want.pending[i])
}
}
})
}
}
func TestPool_PendingExits(t *testing.T) {
type fields struct {
pending []*ethpb.SignedVoluntaryExit
noLimit bool
2020-01-21 23:29:04 +00:00
}
type args struct {
slot types.Slot
2020-01-21 23:29:04 +00:00
}
tests := []struct {
name string
fields fields
args args
want []*ethpb.SignedVoluntaryExit
}{
{
name: "Empty list",
fields: fields{
pending: []*ethpb.SignedVoluntaryExit{},
},
args: args{
slot: 100000,
},
want: []*ethpb.SignedVoluntaryExit{},
},
{
name: "All eligible",
fields: fields{
pending: []*ethpb.SignedVoluntaryExit{
{Exit: &ethpb.VoluntaryExit{Epoch: 0}},
{Exit: &ethpb.VoluntaryExit{Epoch: 1}},
{Exit: &ethpb.VoluntaryExit{Epoch: 2}},
{Exit: &ethpb.VoluntaryExit{Epoch: 3}},
{Exit: &ethpb.VoluntaryExit{Epoch: 4}},
},
},
args: args{
slot: 1000000,
},
want: []*ethpb.SignedVoluntaryExit{
{Exit: &ethpb.VoluntaryExit{Epoch: 0}},
{Exit: &ethpb.VoluntaryExit{Epoch: 1}},
{Exit: &ethpb.VoluntaryExit{Epoch: 2}},
{Exit: &ethpb.VoluntaryExit{Epoch: 3}},
{Exit: &ethpb.VoluntaryExit{Epoch: 4}},
},
},
{
name: "All eligible, above max",
fields: fields{
noLimit: true,
pending: []*ethpb.SignedVoluntaryExit{
{Exit: &ethpb.VoluntaryExit{Epoch: 0}},
{Exit: &ethpb.VoluntaryExit{Epoch: 1}},
{Exit: &ethpb.VoluntaryExit{Epoch: 2}},
{Exit: &ethpb.VoluntaryExit{Epoch: 3}},
{Exit: &ethpb.VoluntaryExit{Epoch: 4}},
{Exit: &ethpb.VoluntaryExit{Epoch: 5}},
{Exit: &ethpb.VoluntaryExit{Epoch: 6}},
{Exit: &ethpb.VoluntaryExit{Epoch: 7}},
{Exit: &ethpb.VoluntaryExit{Epoch: 8}},
{Exit: &ethpb.VoluntaryExit{Epoch: 9}},
{Exit: &ethpb.VoluntaryExit{Epoch: 10}},
{Exit: &ethpb.VoluntaryExit{Epoch: 11}},
{Exit: &ethpb.VoluntaryExit{Epoch: 12}},
{Exit: &ethpb.VoluntaryExit{Epoch: 13}},
{Exit: &ethpb.VoluntaryExit{Epoch: 14}},
{Exit: &ethpb.VoluntaryExit{Epoch: 15}},
{Exit: &ethpb.VoluntaryExit{Epoch: 16}},
{Exit: &ethpb.VoluntaryExit{Epoch: 17}},
{Exit: &ethpb.VoluntaryExit{Epoch: 18}},
{Exit: &ethpb.VoluntaryExit{Epoch: 19}},
},
},
args: args{
slot: 1000000,
},
want: []*ethpb.SignedVoluntaryExit{
{Exit: &ethpb.VoluntaryExit{Epoch: 0}},
{Exit: &ethpb.VoluntaryExit{Epoch: 1}},
{Exit: &ethpb.VoluntaryExit{Epoch: 2}},
{Exit: &ethpb.VoluntaryExit{Epoch: 3}},
{Exit: &ethpb.VoluntaryExit{Epoch: 4}},
{Exit: &ethpb.VoluntaryExit{Epoch: 5}},
{Exit: &ethpb.VoluntaryExit{Epoch: 6}},
{Exit: &ethpb.VoluntaryExit{Epoch: 7}},
{Exit: &ethpb.VoluntaryExit{Epoch: 8}},
{Exit: &ethpb.VoluntaryExit{Epoch: 9}},
{Exit: &ethpb.VoluntaryExit{Epoch: 10}},
{Exit: &ethpb.VoluntaryExit{Epoch: 11}},
{Exit: &ethpb.VoluntaryExit{Epoch: 12}},
{Exit: &ethpb.VoluntaryExit{Epoch: 13}},
{Exit: &ethpb.VoluntaryExit{Epoch: 14}},
{Exit: &ethpb.VoluntaryExit{Epoch: 15}},
{Exit: &ethpb.VoluntaryExit{Epoch: 16}},
{Exit: &ethpb.VoluntaryExit{Epoch: 17}},
{Exit: &ethpb.VoluntaryExit{Epoch: 18}},
{Exit: &ethpb.VoluntaryExit{Epoch: 19}},
},
},
{
name: "All eligible, block max",
fields: fields{
pending: []*ethpb.SignedVoluntaryExit{
{Exit: &ethpb.VoluntaryExit{Epoch: 0}},
{Exit: &ethpb.VoluntaryExit{Epoch: 1}},
{Exit: &ethpb.VoluntaryExit{Epoch: 2}},
{Exit: &ethpb.VoluntaryExit{Epoch: 3}},
{Exit: &ethpb.VoluntaryExit{Epoch: 4}},
{Exit: &ethpb.VoluntaryExit{Epoch: 5}},
{Exit: &ethpb.VoluntaryExit{Epoch: 6}},
{Exit: &ethpb.VoluntaryExit{Epoch: 7}},
{Exit: &ethpb.VoluntaryExit{Epoch: 8}},
{Exit: &ethpb.VoluntaryExit{Epoch: 9}},
{Exit: &ethpb.VoluntaryExit{Epoch: 10}},
{Exit: &ethpb.VoluntaryExit{Epoch: 11}},
{Exit: &ethpb.VoluntaryExit{Epoch: 12}},
{Exit: &ethpb.VoluntaryExit{Epoch: 13}},
{Exit: &ethpb.VoluntaryExit{Epoch: 14}},
{Exit: &ethpb.VoluntaryExit{Epoch: 15}},
{Exit: &ethpb.VoluntaryExit{Epoch: 16}},
{Exit: &ethpb.VoluntaryExit{Epoch: 17}},
{Exit: &ethpb.VoluntaryExit{Epoch: 18}},
{Exit: &ethpb.VoluntaryExit{Epoch: 19}},
},
},
args: args{
slot: 1000000,
},
want: []*ethpb.SignedVoluntaryExit{
{Exit: &ethpb.VoluntaryExit{Epoch: 0}},
{Exit: &ethpb.VoluntaryExit{Epoch: 1}},
{Exit: &ethpb.VoluntaryExit{Epoch: 2}},
{Exit: &ethpb.VoluntaryExit{Epoch: 3}},
{Exit: &ethpb.VoluntaryExit{Epoch: 4}},
{Exit: &ethpb.VoluntaryExit{Epoch: 5}},
{Exit: &ethpb.VoluntaryExit{Epoch: 6}},
{Exit: &ethpb.VoluntaryExit{Epoch: 7}},
{Exit: &ethpb.VoluntaryExit{Epoch: 8}},
{Exit: &ethpb.VoluntaryExit{Epoch: 9}},
{Exit: &ethpb.VoluntaryExit{Epoch: 10}},
{Exit: &ethpb.VoluntaryExit{Epoch: 11}},
{Exit: &ethpb.VoluntaryExit{Epoch: 12}},
{Exit: &ethpb.VoluntaryExit{Epoch: 13}},
{Exit: &ethpb.VoluntaryExit{Epoch: 14}},
{Exit: &ethpb.VoluntaryExit{Epoch: 15}},
},
},
2020-01-21 23:29:04 +00:00
{
name: "Some eligible",
fields: fields{
pending: []*ethpb.SignedVoluntaryExit{
{Exit: &ethpb.VoluntaryExit{Epoch: 0}},
{Exit: &ethpb.VoluntaryExit{Epoch: 3}},
{Exit: &ethpb.VoluntaryExit{Epoch: 4}},
{Exit: &ethpb.VoluntaryExit{Epoch: 2}},
{Exit: &ethpb.VoluntaryExit{Epoch: 1}},
},
},
args: args{
slot: 2 * params.BeaconConfig().SlotsPerEpoch,
},
want: []*ethpb.SignedVoluntaryExit{
{Exit: &ethpb.VoluntaryExit{Epoch: 0}},
{Exit: &ethpb.VoluntaryExit{Epoch: 2}},
{Exit: &ethpb.VoluntaryExit{Epoch: 1}},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p := &Pool{
pending: tt.fields.pending,
}
Remove proto state (#11445) * Remove native state flag and use native state in spectests * remove feature from tests * use e2e config in slasher simulator * use params.BeaconConfig in testutil * use correct function * use minimal config in go_test * fix TestListValidators * parameterize sync committee bits and aggregation bits * Fix TestServer_ListIndexedAttestations_GenesisEpoch (cherry picked from commit 254ab623dde08ae8886b152facdbbd8889ed79db) * fix more tests * fix even more * moreeee * aaaand more * one more fix * one more * simplify TestGetAltairDuties_UnknownPubkey * comment out problematic test * one more fix * one more * aaaand one more * another * use fieldparams in HydrateBlindedBeaconBlockBodyBellatrix * create new package for mainnet tests * TestServer_GetBellatrixBeaconBlock * change slashed validator index * clear cache in reward_test.go * deprecate flag * create bazel mainnet target * move attester mainnet test to mainnet target * "fix" proposer tests * use minimal config in TestServer_circuitBreakBuilder * fix TestProposer_ProposeBlock_OK * more fixes in validator package * more fixes * more fixes * test code * move TestProposer_GetBeaconBlock_BellatrixEpoch to minimal * finally * remove proposer_bellatrix_mainnet_test.go * fix TestServer_GetBellatrixBeaconBlock_HappyCase * fix TestServer_GetBellatrixBeaconBlock_BuilderCase * Preston needs to fix this! * Revert "Preston needs to fix this!" This reverts commit b03d97a16e3080e254c7b19d7f193d3c600ca869. * remove proto state tests * fix migration tests * static analysis fix * review * remove proto state * swap state in tests * fix BUILD file in /proto/testing * remove metrics test with nil state
2022-09-16 22:17:46 +00:00
s, err := state_native.InitializeFromProtoUnsafePhase0(&ethpb.BeaconState{Validators: []*ethpb.Validator{{ExitEpoch: params.BeaconConfig().FarFutureEpoch}}})
require.NoError(t, err)
if got := p.PendingExits(s, tt.args.slot, tt.fields.noLimit); !reflect.DeepEqual(got, tt.want) {
2020-01-21 23:29:04 +00:00
t.Errorf("PendingExits() = %v, want %v", got, tt.want)
}
})
}
}