prysm-pulse/beacon-chain/p2p/testing/mock_broadcaster.go

19 lines
348 B
Go
Raw Normal View History

package testing
import (
"context"
"github.com/gogo/protobuf/proto"
)
// MockBroadcaster implements p2p.Broadcaster for testing.
type MockBroadcaster struct {
BroadcastCalled bool
}
// Broadcast records a broadcast occurred.
func (m *MockBroadcaster) Broadcast(context.Context, proto.Message) error {
m.BroadcastCalled = true
return nil
}