mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Rename block interfaces (#11975)
This commit is contained in:
@@ -298,9 +298,9 @@ func TestBlocksFetcher_RoundRobin(t *testing.T) {
|
||||
fetcher.stop()
|
||||
}()
|
||||
|
||||
processFetchedBlocks := func() ([]interfaces.SignedBeaconBlock, error) {
|
||||
processFetchedBlocks := func() ([]interfaces.ReadOnlySignedBeaconBlock, error) {
|
||||
defer cancel()
|
||||
var unionRespBlocks []interfaces.SignedBeaconBlock
|
||||
var unionRespBlocks []interfaces.ReadOnlySignedBeaconBlock
|
||||
|
||||
for {
|
||||
select {
|
||||
@@ -446,7 +446,7 @@ func TestBlocksFetcher_handleRequest(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
|
||||
var blocks []interfaces.SignedBeaconBlock
|
||||
var blocks []interfaces.ReadOnlySignedBeaconBlock
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
t.Error(ctx.Err())
|
||||
@@ -633,7 +633,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 []interfaces.SignedBeaconBlock)
|
||||
validate func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.ReadOnlySignedBeaconBlock)
|
||||
}{
|
||||
{
|
||||
name: "no error",
|
||||
@@ -655,7 +655,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
|
||||
assert.NoError(t, stream.Close())
|
||||
}
|
||||
},
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.ReadOnlySignedBeaconBlock) {
|
||||
assert.Equal(t, req.Count, uint64(len(blocks)))
|
||||
},
|
||||
},
|
||||
@@ -679,7 +679,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
|
||||
assert.NoError(t, stream.Close())
|
||||
}
|
||||
},
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.ReadOnlySignedBeaconBlock) {
|
||||
assert.Equal(t, 0, len(blocks))
|
||||
},
|
||||
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),
|
||||
@@ -708,7 +708,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
|
||||
assert.NoError(t, stream.Close())
|
||||
}
|
||||
},
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.ReadOnlySignedBeaconBlock) {
|
||||
assert.Equal(t, 0, len(blocks))
|
||||
},
|
||||
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),
|
||||
@@ -738,7 +738,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
|
||||
assert.NoError(t, stream.Close())
|
||||
}
|
||||
},
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.ReadOnlySignedBeaconBlock) {
|
||||
assert.Equal(t, 0, len(blocks))
|
||||
},
|
||||
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),
|
||||
@@ -774,7 +774,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
|
||||
}
|
||||
},
|
||||
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.ReadOnlySignedBeaconBlock) {
|
||||
assert.Equal(t, 0, len(blocks))
|
||||
},
|
||||
},
|
||||
@@ -809,7 +809,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
|
||||
}
|
||||
},
|
||||
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.ReadOnlySignedBeaconBlock) {
|
||||
assert.Equal(t, 0, len(blocks))
|
||||
},
|
||||
},
|
||||
@@ -837,7 +837,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
|
||||
assert.NoError(t, stream.Close())
|
||||
}
|
||||
},
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.ReadOnlySignedBeaconBlock) {
|
||||
assert.Equal(t, 2, len(blocks))
|
||||
},
|
||||
},
|
||||
@@ -865,7 +865,7 @@ func TestBlocksFetcher_requestBlocksFromPeerReturningInvalidBlocks(t *testing.T)
|
||||
assert.NoError(t, stream.Close())
|
||||
}
|
||||
},
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.SignedBeaconBlock) {
|
||||
validate: func(req *ethpb.BeaconBlocksByRangeRequest, blocks []interfaces.ReadOnlySignedBeaconBlock) {
|
||||
assert.Equal(t, 0, len(blocks))
|
||||
},
|
||||
wantedErr: beaconsync.ErrInvalidFetchedData.Error(),
|
||||
|
||||
Reference in New Issue
Block a user