Skip to content

Commit 2f1b2c6

Browse files
committed
minor renaming
1 parent c726a5a commit 2f1b2c6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

hydra-node/src/Hydra/Events/Rotation.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ type EventStore e m = (EventSource e m, EventSink e m)
1717
type Checkpointer e = [e] -> e
1818

1919
-- | Creates an event store that rotates according to given config and 'Checkpointer'.
20-
newRotatedEventStore ::
20+
mkRotatedEventStore ::
2121
(HasEventId e, MonadSTM m, MonadUnliftIO m) =>
2222
RotationConfig ->
2323
Checkpointer e ->
2424
LogId ->
2525
EventStore e m ->
2626
m (EventStore e m)
27-
newRotatedEventStore config checkpointer logId eventStore = do
27+
mkRotatedEventStore config checkpointer logId eventStore = do
2828
logIdV <- newTVarIO logId
2929
-- Rules for any event store:
3030
-- - sourceEvents will be called in the beginning of the application and whenever the api server wans to load history
@@ -86,13 +86,13 @@ prepareRotatedEventStore ::
8686
m (EventStore (StateEvent tx) m)
8787
prepareRotatedEventStore rotationConfig initialChainState eventStore = do
8888
now <- getCurrentTime
89-
let checkpointer = newChechpointer initialChainState now
89+
let checkpointer = mkChechpointer initialChainState now
9090
-- FIXME!
9191
let logId = 0
92-
newRotatedEventStore rotationConfig checkpointer logId eventStore
92+
mkRotatedEventStore rotationConfig checkpointer logId eventStore
9393

94-
newChechpointer :: IsChainState tx => ChainStateType tx -> UTCTime -> Checkpointer (StateEvent tx)
95-
newChechpointer initialChainState time events =
94+
mkChechpointer :: IsChainState tx => ChainStateType tx -> UTCTime -> Checkpointer (StateEvent tx)
95+
mkChechpointer initialChainState time events =
9696
StateEvent
9797
{ eventId = maybe 0 (succ . last) (nonEmpty $ (\StateEvent{eventId} -> eventId) <$> events)
9898
, stateChanged =

hydra-node/test/Hydra/Events/RotationSpec.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ spec = parallel $ do
2828
failAfter 1 $ do
2929
now <- getCurrentTime
3030
let initialChainState = SimpleChainState{slot = ChainSlot 0}
31-
let checkpointer = newChechpointer initialChainState now
31+
let checkpointer = mkChechpointer initialChainState now
3232
let logId = 0
3333
let rotationConfig = RotateAfter 4
3434
eventStore <- createMockSourceSink
35-
rotatingEventStore <- newRotatedEventStore rotationConfig checkpointer logId eventStore
35+
rotatingEventStore <- mkRotatedEventStore rotationConfig checkpointer logId eventStore
3636
testHydrate rotatingEventStore []
3737
>>= notConnect
3838
>>= primeWith inputsToOpenHead
@@ -55,7 +55,7 @@ spec = parallel $ do
5555
toInteger (length unrotatedHistory) `shouldBe` totalEvents
5656
let logId = 0
5757
let rotationConfig = RotateAfter x
58-
(rotatedEventSource, _) <- newRotatedEventStore rotationConfig trivialCheckpoint logId eventStore
58+
(rotatedEventSource, _) <- mkRotatedEventStore rotationConfig trivialCheckpoint logId eventStore
5959
rotatedHistory <- getEvents rotatedEventSource
6060
length rotatedHistory `shouldBe` 1
6161

@@ -68,7 +68,7 @@ spec = parallel $ do
6868
let rotationConfig = RotateAfter x
6969
mockEventStore <- createMockSourceSink
7070
let logId = 0
71-
rotatingEventStore <- newRotatedEventStore rotationConfig trivialCheckpoint logId mockEventStore
71+
rotatingEventStore <- mkRotatedEventStore rotationConfig trivialCheckpoint logId mockEventStore
7272
let (eventSource, EventSink{putEvent}) = rotatingEventStore
7373
let totalEvents = toInteger x * y
7474
let events = TrivialEvent . fromInteger <$> [1 .. totalEvents]
@@ -88,7 +88,7 @@ spec = parallel $ do
8888
let rotationConfig = RotateAfter x
8989
mockEventStore <- createMockSourceSink
9090
let logId = 0
91-
rotatingEventStore <- newRotatedEventStore rotationConfig trivialCheckpoint logId mockEventStore
91+
rotatingEventStore <- mkRotatedEventStore rotationConfig trivialCheckpoint logId mockEventStore
9292
let (eventSource, EventSink{putEvent}) = rotatingEventStore
9393
let totalEvents = toInteger x + toInteger y
9494
let events = TrivialEvent . fromInteger <$> [1 .. totalEvents]

0 commit comments

Comments
 (0)