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

@@ -18,7 +18,7 @@ import (
beaconsync "github.com/prysmaticlabs/prysm/beacon-chain/sync"
"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/consensus-types/wrapper"
"github.com/prysmaticlabs/prysm/container/slice"
@@ -301,9 +301,9 @@ func TestBlocksFetcher_RoundRobin(t *testing.T) {
fetcher.stop()
}()
processFetchedBlocks := func() ([]block.SignedBeaconBlock, error) {
processFetchedBlocks := func() ([]interfaces.SignedBeaconBlock, error) {
defer cancel()
var unionRespBlocks []block.SignedBeaconBlock
var unionRespBlocks []interfaces.SignedBeaconBlock
for {
select {
@@ -449,7 +449,7 @@ func TestBlocksFetcher_handleRequest(t *testing.T) {
}
}()
var blocks []block.SignedBeaconBlock
var blocks []interfaces.SignedBeaconBlock
select {
case <-ctx.Done():
t.Error(ctx.Err())
@@ -600,7 +600,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
req *ethpb.BeaconBlocksByRangeRequest
handlerGenFn func(req *ethpb.BeaconBlocksByRangeRequest) func(stream network.Stream)
wantedErr string
validate func(req *ethpb.BeaconBlocksByRangeRequest, blocks []block.SignedBeaconBlock)
validate func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock)
}{
{
name: "no error",
@@ -622,7 +622,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
assert.NoError(t, stream.Close())
}
},
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []block.SignedBeaconBlock) {
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
assert.Equal(t, req.Count, uint64(len(blocks)))
},
},
@@ -646,7 +646,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
assert.NoError(t, stream.Close())
}
},
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []block.SignedBeaconBlock) {
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
assert.Equal(t, 0, len(blocks))
},
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),
@@ -675,7 +675,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
assert.NoError(t, stream.Close())
}
},
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []block.SignedBeaconBlock) {
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
assert.Equal(t, 0, len(blocks))
},
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),
@@ -705,7 +705,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
assert.NoError(t, stream.Close())
}
},
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []block.SignedBeaconBlock) {
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
assert.Equal(t, 0, len(blocks))
},
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),
@@ -741,7 +741,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
}
},
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []block.SignedBeaconBlock) {
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
assert.Equal(t, 0, len(blocks))
},
},
@@ -776,7 +776,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
}
},
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []block.SignedBeaconBlock) {
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
assert.Equal(t, 0, len(blocks))
},
},
@@ -804,7 +804,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
assert.NoError(t, stream.Close())
}
},
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []block.SignedBeaconBlock) {
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
assert.Equal(t, 2, len(blocks))
},
},
@@ -832,7 +832,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
assert.NoError(t, stream.Close())
}
},
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []block.SignedBeaconBlock) {
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
assert.Equal(t, 0, len(blocks))
},
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),