Skip to content

Commit c642442

Browse files
committed
Address feedback from review
1 parent d8b0130 commit c642442

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

engine/access/state_stream/backend/backend.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,9 @@ func (b *StateStreamBackend) getExecutionData(ctx context.Context, height uint64
159159

160160
// the spork root block will never have execution data available. If requested, return an empty result.
161161
if height == b.sporkRootBlockHeight {
162-
sporkRootBlockID, err := b.headers.BlockIDByHeight(b.sporkRootBlockHeight)
163-
if err != nil {
164-
// the spork root block will not exist locally if the node was bootstrapped with a newer
165-
// root block. However, the logic that calls this method should have already checked that
166-
// the height is within the range of available data. Reaching this point means there is a
167-
// bug in the logic or the node is in an inconsistent state.
168-
return nil, fmt.Errorf("could not get block ID for root block height %d: %w", b.sporkRootBlockHeight, err)
169-
}
170-
171162
return &execution_data.BlockExecutionDataEntity{
172163
BlockExecutionData: &execution_data.BlockExecutionData{
173-
BlockID: sporkRootBlockID,
164+
BlockID: b.state.Params().SporkRootBlock().ID(),
174165
},
175166
}, nil
176167
}

engine/access/state_stream/backend/backend_account_statuses_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,12 @@ func (s *BackendExecutionDataSuite) TestSubscribeAccountStatusesHandlesErrors()
529529
})
530530
}
531531

532-
func (s *BackendAccountStatusesSuite) expectedAccountStatuses(blockID flow.Identifier, filter state_stream.AccountStatusFilter) map[string]flow.EventsList {
532+
// expectedAccountStatuses returns the account status events from the mock block events that match
533+
// the provided filter.
534+
func (s *BackendAccountStatusesSuite) expectedAccountStatuses(
535+
blockID flow.Identifier,
536+
filter state_stream.AccountStatusFilter,
537+
) map[string]flow.EventsList {
533538
expectedEvents := map[string]flow.EventsList{}
534539
for _, event := range s.blockEvents[blockID] {
535540
if filter.Match(event) {

0 commit comments

Comments
 (0)