mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 19:40:37 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
28 lines
625 B
Go
28 lines
625 B
Go
package mock
|
|
|
|
import "github.com/prysmaticlabs/prysm/v5/async/event"
|
|
|
|
type MockStreamer struct {
|
|
logs [][]byte
|
|
feed *event.Feed
|
|
}
|
|
|
|
// NewMockStreamer creates a new instance of MockStreamer.
|
|
// It's useful to set up the default state for the mock, like initializing the feed.
|
|
func NewMockStreamer(logs [][]byte) *MockStreamer {
|
|
return &MockStreamer{
|
|
logs: logs,
|
|
feed: new(event.Feed),
|
|
}
|
|
}
|
|
|
|
// GetLastFewLogs returns the predefined logs.
|
|
func (m *MockStreamer) GetLastFewLogs() [][]byte {
|
|
return m.logs
|
|
}
|
|
|
|
// LogsFeed returns the predefined event feed.
|
|
func (m *MockStreamer) LogsFeed() *event.Feed {
|
|
return m.feed
|
|
}
|