github.com/prysmaticlabs/prysm@v1.4.4/shared/slotutil/testing/mock.go (about) 1 // Package testing includes useful mocks for slot tickers in unit tests. 2 package testing 3 4 import types "github.com/prysmaticlabs/eth2-types" 5 6 // MockTicker defines a useful struct for mocking the Ticker interface 7 // from the slotutil package. 8 type MockTicker struct { 9 Channel chan types.Slot 10 } 11 12 // C -- 13 func (m *MockTicker) C() <-chan types.Slot { 14 return m.Channel 15 } 16 17 // Done -- 18 func (m *MockTicker) Done() {}