@@ -255,11 +255,12 @@ func Test_ForkDetectionPersisted(t *testing.T) {
255255
256256 // This function stores conflicting seals to the underlying database.
257257 func (t * testing.T , db storage.DB ) {
258+ lockManager := storage .NewTestingLockManager ()
258259
259260 // initialize ExecForkSuppressor
260261 wrappedMempool := & poolmock.IncorporatedResultSeals {}
261262 execForkActor := & actormock.ExecForkActor {}
262- wrapper , _ := NewExecStateForkSuppressor (wrappedMempool , execForkActor .OnExecFork , db , zerolog .New (os .Stderr ))
263+ wrapper , _ := NewExecStateForkSuppressor (wrappedMempool , execForkActor .OnExecFork , db , lockManager , zerolog .New (os .Stderr ))
263264
264265 // add seal
265266 wrappedMempool .On ("Add" , sealA ).Return (true , nil ).Once ()
@@ -285,14 +286,16 @@ func Test_ForkDetectionPersisted(t *testing.T) {
285286
286287 // This function retrieves conflicting seals from the same underlying database with a new instance of storage.DB.
287288 func (t * testing.T , db storage.DB ) {
289+ lockManager := storage .NewTestingLockManager ()
290+
288291 wrappedMempool2 := & poolmock.IncorporatedResultSeals {}
289292 execForkActor2 := & actormock.ExecForkActor {}
290293 execForkActor2 .On ("OnExecFork" , mock .Anything ).
291294 Run (func (args mock.Arguments ) {
292295 conflictingSeals := args .Get (0 ).([]* flow.IncorporatedResultSeal )
293296 require .ElementsMatch (t , []* flow.IncorporatedResultSeal {sealA , sealB }, conflictingSeals )
294297 }).Return ().Once ()
295- wrapper2 , _ := NewExecStateForkSuppressor (wrappedMempool2 , execForkActor2 .OnExecFork , db , zerolog .New (os .Stderr ))
298+ wrapper2 , _ := NewExecStateForkSuppressor (wrappedMempool2 , execForkActor2 .OnExecFork , db , lockManager , zerolog .New (os .Stderr ))
296299
297300 // add another (non-conflicting) seal to ExecForkSuppressor
298301 // fail test if seal is added to wrapped mempool
@@ -318,8 +321,10 @@ func Test_AddRemove_SmokeTest(t *testing.T) {
318321 require .Fail (t , "no call to onExecFork expected " )
319322 }
320323 dbtest .RunWithDB (t , func (t * testing.T , db storage.DB ) {
324+ lockManager := storage .NewTestingLockManager ()
325+
321326 wrappedMempool := stdmap .NewIncorporatedResultSeals (100 )
322- wrapper , err := NewExecStateForkSuppressor (wrappedMempool , onExecFork , db , zerolog .New (os .Stderr ))
327+ wrapper , err := NewExecStateForkSuppressor (wrappedMempool , onExecFork , db , lockManager , zerolog .New (os .Stderr ))
323328 require .NoError (t , err )
324329 require .NotNil (t , wrapper )
325330
@@ -355,6 +360,8 @@ func Test_AddRemove_SmokeTest(t *testing.T) {
355360// Test adding conflicting seals with different number of matching receipts.
356361func Test_ConflictingSeal_SmokeTest (t * testing.T ) {
357362 dbtest .RunWithDB (t , func (t * testing.T , db storage.DB ) {
363+ lockManager := storage .NewTestingLockManager ()
364+
358365 executingForkDetected := atomic .NewBool (false )
359366 onExecFork := func ([]* flow.IncorporatedResultSeal ) {
360367 executingForkDetected .Store (true )
@@ -363,7 +370,7 @@ func Test_ConflictingSeal_SmokeTest(t *testing.T) {
363370 rawMempool := stdmap .NewIncorporatedResultSeals (100 )
364371 receiptsDB := mockstorage .NewExecutionReceipts (t )
365372 wrappedMempool := NewIncorporatedResultSeals (rawMempool , receiptsDB )
366- wrapper , err := NewExecStateForkSuppressor (wrappedMempool , onExecFork , db , zerolog .New (os .Stderr ))
373+ wrapper , err := NewExecStateForkSuppressor (wrappedMempool , onExecFork , db , lockManager , zerolog .New (os .Stderr ))
367374 require .NoError (t , err )
368375 require .NotNil (t , wrapper )
369376
@@ -426,9 +433,11 @@ func Test_ConflictingSeal_SmokeTest(t *testing.T) {
426433// 4. executes the `testLogic`
427434func WithExecStateForkSuppressor (t * testing.T , testLogic func (wrapper * ExecForkSuppressor , wrappedMempool * poolmock.IncorporatedResultSeals , execForkActor * actormock.ExecForkActor )) {
428435 dbtest .RunWithDB (t , func (t * testing.T , db storage.DB ) {
436+ lockManager := storage .NewTestingLockManager ()
437+
429438 wrappedMempool := & poolmock.IncorporatedResultSeals {}
430439 execForkActor := & actormock.ExecForkActor {}
431- wrapper , err := NewExecStateForkSuppressor (wrappedMempool , execForkActor .OnExecFork , db , zerolog .New (os .Stderr ))
440+ wrapper , err := NewExecStateForkSuppressor (wrappedMempool , execForkActor .OnExecFork , db , lockManager , zerolog .New (os .Stderr ))
432441 require .NoError (t , err )
433442 require .NotNil (t , wrapper )
434443 testLogic (wrapper , wrappedMempool , execForkActor )
0 commit comments