@@ -18,7 +18,7 @@ object RaftSpec extends ZIOSpecDefault:
1818 // )) ++ testEnvironment
1919
2020
21- def makeRaft (memberId : MemberId , peers : Peers , enableSnapshot : Boolean ): ZIO [Any , Nothing , (Raft [Any , Int , TestCommands ], MockRpc [TestCommands ])] =
21+ def makeRaft (memberId : MemberId , peers : Peers , enableSnapshot : Boolean ): ZIO [Any , Nothing , (Raft [Int , TestCommands ], MockRpc [TestCommands ])] =
2222 (for
2323 stable <- Stable .makeInMemory
2424 logStore <- LogStore .makeInMemory[TestCommands ]
@@ -37,20 +37,20 @@ object RaftSpec extends ZIOSpecDefault:
3737 )
3838 yield (raft, rpc))
3939
40- def isCandidate (raft : Raft [Any , Int , TestCommands ]) =
40+ def isCandidate (raft : Raft [Int , TestCommands ]) =
4141 for s <- raft.raftState.get
4242 yield if s.isInstanceOf [State .Candidate [Int ]] then true else false
4343
44- def isFollower (raft : Raft [Any , Int , TestCommands ]) =
44+ def isFollower (raft : Raft [Int , TestCommands ]) =
4545 for s <- raft.raftState.get
4646 yield if s.isInstanceOf [State .Follower [Int ]] then true else false
4747
48- def expectFollower (raft : Raft [Any , Int , TestCommands ]) =
48+ def expectFollower (raft : Raft [Int , TestCommands ]) =
4949 raft.raftState.get.flatMap:
5050 case f : State .Follower [Int ] => ZIO .succeed(f)
5151 case _ => ZIO .die(new Exception (" Expected follower" ))
5252
53- def getLeader (raft : Raft [Any , Int , TestCommands ]) =
53+ def getLeader (raft : Raft [Int , TestCommands ]) =
5454 for s <- raft.raftState.get
5555 yield s match
5656 case State .Follower (commitIndex, lastApplied, electionTimeout, leaderId) =>
@@ -69,7 +69,7 @@ object RaftSpec extends ZIOSpecDefault:
6969 Some (raft.memberId)
7070
7171 def handleHeartbeat (
72- raft : Raft [Any , Int , TestCommands ],
72+ raft : Raft [Int , TestCommands ],
7373 term : Term ,
7474 leaderId : MemberId ,
7575 commitIndex : Index
@@ -81,7 +81,7 @@ object RaftSpec extends ZIOSpecDefault:
8181 )
8282
8383 def handleVoteGranted (
84- raft : Raft [Any , Int , TestCommands ],
84+ raft : Raft [Int , TestCommands ],
8585 term : Term ,
8686 memberId : MemberId
8787 ) =
@@ -92,7 +92,7 @@ object RaftSpec extends ZIOSpecDefault:
9292 )
9393
9494 def handelAppendEntries (
95- raft : Raft [Any , Int , TestCommands ],
95+ raft : Raft [Int , TestCommands ],
9696 term : Term ,
9797 leaderId : MemberId ,
9898 previousIndex : Index ,
@@ -113,13 +113,13 @@ object RaftSpec extends ZIOSpecDefault:
113113 )
114114 )
115115
116- def handleBootstrap (raft : Raft [Any , Int , TestCommands ]) =
116+ def handleBootstrap (raft : Raft [Int , TestCommands ]) =
117117 raft.handleStreamItem(StreamItem .Bootstrap [TestCommands , Int ]())
118118
119- def handleTick (raft : Raft [Any , Int , TestCommands ]) =
119+ def handleTick (raft : Raft [Int , TestCommands ]) =
120120 raft.handleStreamItem(StreamItem .Tick [TestCommands , Int ]())
121121
122- def sendCommand (raft : Raft [Any , Int , TestCommands ], commandArg : TestCommands ) =
122+ def sendCommand (raft : Raft [Int , TestCommands ], commandArg : TestCommands ) =
123123 for
124124 promiseArg <- zio.Promise .make[NotALeaderError , Int ]
125125 _ <- raft.handleStreamItem(new CommandMessage [TestCommands , Int ] {
@@ -128,7 +128,7 @@ object RaftSpec extends ZIOSpecDefault:
128128 })
129129 yield ()
130130
131- def bootstrap (raft : Raft [Any , Int , TestCommands ]) =
131+ def bootstrap (raft : Raft [Int , TestCommands ]) =
132132 for
133133 _ <- handleBootstrap(raft)
134134 _ <- handleVoteGranted(raft, Term (1 ), MemberId (" peer2" ))
0 commit comments