Fix mock reporter interface (#4081)

+ MockReporeter.Report should return an error to adhere to the
    `behaviour.Reporter` interface
This commit is contained in:
Sean Braithwaite
2019-10-25 20:08:08 +02:00
committed by Marko
parent 65e08a7afd
commit 6dd1718311

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.