mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-15 14:38:20 +00:00
237807b248
* Only update forkchoice checkpoints at epoch transition * gazelle * blockchain package changes * fix node * spectest package * rpc package * fix spec test * Fix spectests * fix new_slot.test * gaz * fix spectests * fix conflicts * Update beacon-chain/blockchain/process_block.go * regression do not update on newSlot * revert bd64cab * terence's review * fix conflicts * fix latest conflicts * gaz * go mod tidy Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
22 lines
785 B
Go
22 lines
785 B
Go
package debug
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/golang/protobuf/ptypes/empty"
|
|
mock "github.com/prysmaticlabs/prysm/beacon-chain/blockchain/testing"
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/forkchoice/protoarray"
|
|
"github.com/prysmaticlabs/prysm/testing/assert"
|
|
"github.com/prysmaticlabs/prysm/testing/require"
|
|
)
|
|
|
|
func TestServer_GetForkChoice_ProtoArray(t *testing.T) {
|
|
store := protoarray.New(0, 0)
|
|
bs := &Server{ForkFetcher: &mock.ChainService{ForkChoiceStore: store}}
|
|
res, err := bs.GetForkChoice(context.Background(), &empty.Empty{})
|
|
require.NoError(t, err)
|
|
assert.Equal(t, store.JustifiedEpoch(), res.JustifiedEpoch, "Did not get wanted justified epoch")
|
|
assert.Equal(t, store.FinalizedEpoch(), res.FinalizedEpoch, "Did not get wanted finalized epoch")
|
|
}
|