Skip to content

Commit

Permalink
more smaller changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kishansagathiya committed Dec 14, 2023
1 parent 9150f0d commit ad4f350
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dot/parachain/collator-protocol/validator_side.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ func (cpvs CollatorProtocolValidatorSide) Run(
cpvs.fetchedCollations = append(cpvs.fetchedCollations, *collation)
}

case <-cpvs.ctx.Done():
if err := cpvs.ctx.Err(); err != nil {
logger.Errorf("ctx error: %v\n", err)
}
return nil
}
}
}
Expand All @@ -95,6 +100,10 @@ func (cpvs CollatorProtocolValidatorSide) ProcessOverseerSignals() {
// NOTE: nothing to do here
}

func (cpvs CollatorProtocolValidatorSide) Stop() {
cpvs.cancel()
}

// requestCollation requests a collation from the network.
// This function will
// - check for duplicate requests
Expand Down Expand Up @@ -295,6 +304,9 @@ type CollationEvent struct {
}

type CollatorProtocolValidatorSide struct {
ctx context.Context
cancel context.CancelFunc

net Network

SubSystemToOverseer chan<- any
Expand Down
2 changes: 2 additions & 0 deletions dot/parachain/overseer/overseer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func (s *TestSubsystem) String() parachaintypes.SubSystemName {
return parachaintypes.SubSystemName(s.name)
}

func (s *TestSubsystem) Stop() {}

func TestStart2SubsytemsActivate1(t *testing.T) {
ctrl := gomock.NewController(t)

Expand Down
1 change: 1 addition & 0 deletions dot/parachain/overseer/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ type Subsystem interface {
Run(ctx context.Context, OverseerToSubSystem chan any, SubSystemToOverseer chan any) error
Name() parachaintypes.SubSystemName
ProcessOverseerSignals()
Stop()
}

0 comments on commit ad4f350

Please sign in to comment.