Skip to content

Commit

Permalink
chore(dot/sync): narrow the type of syncTask.request
Browse files Browse the repository at this point in the history
  • Loading branch information
haikoschol committed Oct 22, 2024
1 parent 3da46d9 commit 0588ed0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dot/sync/fullsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type importer interface {
type syncTask struct {
id TaskID
requestMaker network.RequestMaker
request messages.P2PMessage
request *messages.BlockRequestMessage
}

func (s *syncTask) ID() TaskID {
Expand Down Expand Up @@ -446,7 +446,7 @@ func validateResult(result TaskResult, badBlocks []string) (repChange *Change,
return
}

request := task.request.(*messages.BlockRequestMessage)
request := task.request
response := result.Result.(*messages.BlockResponseMessage)
if request.Direction == messages.Descending {
// reverse blocks before pre-validating and placing in ready queue
Expand Down
2 changes: 1 addition & 1 deletion dot/sync/fullsync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestFullSyncNextActions(t *testing.T) {
task, err := fs.NextActions()
require.NoError(t, err)

request := task[0].(*syncTask).request.(*messages.BlockRequestMessage)
request := task[0].(*syncTask).request
require.Equal(t, uint(1), request.StartingBlock.RawValue())
require.Equal(t, uint32(128), *request.Max)
})
Expand Down

0 comments on commit 0588ed0

Please sign in to comment.