prysm-pulse/beacon-chain/rpc/prysm/v1alpha1/debug/forkchoice.go
Radosław Kapka 2060f876b1
Code cleanup in blockchain module (#10566)
* Code cleanup in `blockchain` module

* revert comment fix

* remove test

* forkchoice test fix

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-04-28 11:34:25 +00:00

20 lines
508 B
Go

package debug
import (
"context"
"github.com/golang/protobuf/ptypes/empty"
pbrpc "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
)
// GetForkChoice returns a fork choice store.
func (ds *Server) GetForkChoice(_ context.Context, _ *empty.Empty) (*pbrpc.ForkChoiceResponse, error) {
store := ds.ForkFetcher.ForkChoicer()
return &pbrpc.ForkChoiceResponse{
JustifiedEpoch: store.JustifiedEpoch(),
FinalizedEpoch: store.FinalizedEpoch(),
ForkchoiceNodes: store.ForkChoiceNodes(),
}, nil
}