github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/rpc/prysm/v1alpha1/debug/forkchoice_test.go (about) 1 package debug 2 3 import ( 4 "context" 5 "testing" 6 7 "github.com/golang/protobuf/ptypes/empty" 8 mock "github.com/prysmaticlabs/prysm/beacon-chain/blockchain/testing" 9 "github.com/prysmaticlabs/prysm/beacon-chain/forkchoice/protoarray" 10 "github.com/prysmaticlabs/prysm/shared/testutil/assert" 11 "github.com/prysmaticlabs/prysm/shared/testutil/require" 12 ) 13 14 func TestServer_GetForkChoice(t *testing.T) { 15 store := &protoarray.Store{} 16 bs := &Server{HeadFetcher: &mock.ChainService{ForkChoiceStore: store}} 17 res, err := bs.GetProtoArrayForkChoice(context.Background(), &empty.Empty{}) 18 require.NoError(t, err) 19 assert.Equal(t, store.PruneThreshold(), res.PruneThreshold, "Did not get wanted prune threshold") 20 assert.Equal(t, store.JustifiedEpoch(), res.JustifiedEpoch, "Did not get wanted justified epoch") 21 assert.Equal(t, store.FinalizedEpoch(), res.FinalizedEpoch, "Did not get wanted finalized epoch") 22 }