@@ -213,17 +213,16 @@ func TestReactor_RejectsInvalidCommitFromPeer(t *testing.T) {
213213 invalidCommitID , syncID := nodeIDs [0 ], nodeIDs [1 ]
214214 syncNode := network .Node (syncID )
215215
216- invalidCommitStore , correctStore := newMemBlockStore (), newMemBlockStore ()
217- invalidCommitReactor , _ := makeReactor (ctx , t , genDoc , network .Node (invalidCommitID ).Router , invalidCommitStore , false , func () {}, config .DefaultSelfRemediationConfig ())
218- syncReactor , syncBus := makeReactor (ctx , t , genDoc , syncNode .Router , newMemBlockStore (), true , func () {}, config .DefaultSelfRemediationConfig ())
216+ invalidCommitReactor , _ := makeReactor (ctx , t , genDoc , network .Node (invalidCommitID ).Router , false , func () {}, config .DefaultSelfRemediationConfig ())
217+ syncReactor , syncBus := makeReactor (ctx , t , genDoc , syncNode .Router , true , func () {}, config .DefaultSelfRemediationConfig ())
219218
220219 // Connect the invalid-commit node and the syncing node.
221220 network .Start (t )
222221 invalidCommitConn := syncNode .WaitForConnAndGet (ctx , invalidCommitID )
223222
224223 // The correct node is not connected to anyone yet.
225224 correctNode := network .MakeNode (t , p2p.TestNodeOptions {})
226- correctReactor , _ := makeReactor (ctx , t , genDoc , correctNode .Router , correctStore , false , func () {}, config .DefaultSelfRemediationConfig ())
225+ correctReactor , _ := makeReactor (ctx , t , genDoc , correctNode .Router , false , func () {}, config .DefaultSelfRemediationConfig ())
227226
228227 // The correct node applies and stores correct blocks 1 to 4.
229228 correctExec := correctReactor .syncer .OrPanic ("syncer should be configured in tests" ).blockExec
@@ -235,7 +234,7 @@ func TestReactor_RejectsInvalidCommitFromPeer(t *testing.T) {
235234 b := makeCommittedBlock (ctx , t , state , privVals , height , lastCommit )
236235 state , err = correctExec .ApplyBlock (ctx , state , b .id , b .block , nil )
237236 require .NoError (t , err )
238- correctStore .SaveBlock (b .block , b .parts , b .commit )
237+ correctReactor . store .SaveBlock (b .block , b .parts , b .commit )
239238 correct = append (correct , b )
240239 lastCommit = b .commit
241240 }
@@ -244,12 +243,12 @@ func TestReactor_RejectsInvalidCommitFromPeer(t *testing.T) {
244243 // whose commit for block 3 is invalid.
245244 require .NoError (t , invalidCommitReactor .stateStore .Save (state ))
246245 for _ , b := range correct [:3 ] {
247- invalidCommitStore .SaveBlock (b .block , b .parts , b .commit )
246+ invalidCommitReactor . store .SaveBlock (b .block , b .parts , b .commit )
248247 }
249248 invalidCommitBlock4 := withInvalidLastSignature (t , correct [3 ].block , tc .flag )
250249 invalidCommitParts4 , err := invalidCommitBlock4 .MakePartSet (types .BlockPartSizeBytes )
251250 require .NoError (t , err )
252- invalidCommitStore .SaveBlock (invalidCommitBlock4 , invalidCommitParts4 , correct [3 ].commit )
251+ invalidCommitReactor . store .SaveBlock (invalidCommitBlock4 , invalidCommitParts4 , correct [3 ].commit )
253252
254253 // The block executor of the syncing node publishes a new block event after it
255254 // applies each saved block. The subscription has room for blocks 1 to 3.
0 commit comments