Browse Source

Fix mock reporter interface (#4081)

+ MockReporeter.Report should return an error to adhere to the
    `behaviour.Reporter` interface
pull/4082/head
Sean Braithwaite 5 years ago
committed by Marko
parent
commit
6dd1718311
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      behaviour/reporter.go

+ 3
- 1
behaviour/reporter.go View File

@ -63,10 +63,12 @@ func NewMockReporter() *MockReporter {
}
// Report stores the PeerBehaviour produced by the peer identified by peerID.
func (mpbr *MockReporter) Report(behaviour PeerBehaviour) {
func (mpbr *MockReporter) Report(behaviour PeerBehaviour) error {
mpbr.mtx.Lock()
defer mpbr.mtx.Unlock()
mpbr.pb[behaviour.peerID] = append(mpbr.pb[behaviour.peerID], behaviour)
return nil
}
// GetBehaviours returns all behaviours reported on the peer identified by peerID.


Loading…
Cancel
Save