Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.33 enable get block fix #5896

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions fvm/environment/block_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ func (info *blockInfo) GetBlockAtHeight(
// Check if the requested block height is within the range of the current
// block height and the extra blocks in the root sealing segment.
if height+uint64(flow.ExtraBlocksInRootSealingSegment) < info.blockHeader.Height {
// TODO replace with:
// return runtime.Block{}, false, nil
return runtime.Block{}, false, errors.NewBlockHeightOutOfRangeError(height)
return runtime.Block{}, false, nil
}

header, err := info.blocks.ByHeightFrom(height, info.blockHeader)
Expand Down
7 changes: 3 additions & 4 deletions fvm/environment/block_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ func TestBlockInfo(t *testing.T) {
require.Equal(t, lowestHeader.Height, b.Height)

// verify that the block at the height before the lowest accepted height does not exist
// TODO: enable the test case
// _, exists, err = bi.GetBlockAtHeight(lowestAcceptedHeight - 1)
// require.NoError(t, err)
// require.False(t, exists)
_, exists, err = bi.GetBlockAtHeight(lowestAcceptedHeight - 1)
require.NoError(t, err)
require.False(t, exists)
}

type mockBlocks struct {
Expand Down
Loading