Rename Block Package in Consensus-Types to Interfaces (#10605)

* interfaces package

* builds

* gaz
This commit is contained in:
Raul Jordan
2022-05-02 18:32:37 +00:00
committed by GitHub
parent 16bbf5602f
commit 20ab988a4a
162 changed files with 658 additions and 660 deletions

View File

@@ -10,7 +10,7 @@ import (
p2pTypes "github.com/prysmaticlabs/prysm/beacon-chain/p2p/types"
"github.com/prysmaticlabs/prysm/cmd/beacon-chain/flags"
"github.com/prysmaticlabs/prysm/config/params"
"github.com/prysmaticlabs/prysm/consensus-types/block"
"github.com/prysmaticlabs/prysm/consensus-types/interfaces"
types "github.com/prysmaticlabs/prysm/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/encoding/bytesutil"
p2ppb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
@@ -24,7 +24,7 @@ import (
// either in DB or initial sync cache.
type forkData struct {
peer peer.ID
blocks []block.SignedBeaconBlock
blocks []interfaces.SignedBeaconBlock
}
// nonSkippedSlotAfter checks slots after the given one in an attempt to find a non-empty future slot.
@@ -257,8 +257,8 @@ func (f *blocksFetcher) findForkWithPeer(ctx context.Context, pid peer.ID, slot
}
// findAncestor tries to figure out common ancestor slot that connects a given root to known block.
func (f *blocksFetcher) findAncestor(ctx context.Context, pid peer.ID, b block.SignedBeaconBlock) (*forkData, error) {
outBlocks := []block.SignedBeaconBlock{b}
func (f *blocksFetcher) findAncestor(ctx context.Context, pid peer.ID, b interfaces.SignedBeaconBlock) (*forkData, error) {
outBlocks := []interfaces.SignedBeaconBlock{b}
for i := uint64(0); i < backtrackingMaxHops; i++ {
parentRoot := bytesutil.ToBytes32(outBlocks[len(outBlocks)-1].Block().ParentRoot())
if f.db.HasBlock(ctx, parentRoot) || f.chain.HasInitSyncBlock(parentRoot) {