@@ -166,7 +166,7 @@ func TestSubscriptions(t *testing.T) {
166166 runConsensusLoop := func (wantLogs ... types.Log ) {
167167 t .Helper ()
168168
169- b := sut .runConsensusLoop (t , sut . lastAcceptedBlock ( t ) )
169+ b := sut .runConsensusLoop (t )
170170 require .Equal (t , b .Hash (), (<- newHeads ).Hash (), "header hash from newHeads subscription" )
171171
172172 for _ , want := range wantLogs {
@@ -423,28 +423,23 @@ func TestEthGetters(t *testing.T) {
423423 blockingPrecompile := common.Address {'b' , 'l' , 'o' , 'c' , 'k' }
424424 registerBlockingPrecompile (t , blockingPrecompile )
425425
426- createTx := func (t * testing.T , to common.Address ) * types.Transaction {
427- t .Helper ()
428- return sut .wallet .SetNonceAndSign (t , 0 , & types.DynamicFeeTx {
429- To : & to ,
430- Gas : params .TxGas ,
431- GasFeeCap : big .NewInt (1 ),
432- })
433- }
434-
435426 genesis := sut .lastAcceptedBlock (t )
436427
437428 // Once a block is settled, its ancestors are only accessible from the
438429 // database.
439- onDisk := sut .runConsensusLoopFromLastAccepted ( t , createTx ( t , zeroAddr ) )
430+ onDisk := sut .runConsensusLoop ( t )
440431
441- settled := sut .runConsensusLoopFromLastAccepted ( t , createTx ( t , zeroAddr ) )
432+ settled := sut .runConsensusLoop ( t )
442433 vmTime .advanceToSettle (ctx , t , settled )
443434
444- executed := sut .runConsensusLoopFromLastAccepted ( t , createTx ( t , zeroAddr ) )
435+ executed := sut .runConsensusLoop ( t )
445436 require .NoErrorf (t , executed .WaitUntilExecuted (ctx ), "%T.WaitUntilExecuted()" , executed )
446437
447- pending := sut .runConsensusLoopFromLastAccepted (t , createTx (t , blockingPrecompile ))
438+ pending := sut .runConsensusLoop (t , sut .wallet .SetNonceAndSign (t , 0 , & types.DynamicFeeTx {
439+ To : & blockingPrecompile ,
440+ Gas : params .TxGas ,
441+ GasFeeCap : big .NewInt (1 ),
442+ }))
448443
449444 for _ , b := range []* blocks.Block {genesis , onDisk , settled , executed , pending } {
450445 t .Run (fmt .Sprintf ("block_num_%d" , b .Height ()), func (t * testing.T ) {
@@ -532,15 +527,15 @@ func TestGetLogs(t *testing.T) {
532527 // and therefore moved to disk.
533528 indexed := make ([]* blocks.Block , bloomSectionSize )
534529 for i := range indexed {
535- indexed [i ] = sut .runConsensusLoopFromLastAccepted (t , txWithLog (t ))
530+ indexed [i ] = sut .runConsensusLoop (t , txWithLog (t ))
536531 }
537532
538- settled := sut .runConsensusLoopFromLastAccepted (t , txWithLog (t ))
533+ settled := sut .runConsensusLoop (t , txWithLog (t ))
539534 vmTime .advanceToSettle (ctx , t , settled )
540535
541- noLogs := sut .runConsensusLoopFromLastAccepted (t , txWithoutLog (t ))
536+ noLogs := sut .runConsensusLoop (t , txWithoutLog (t ))
542537
543- executed := sut .runConsensusLoopFromLastAccepted (t , txWithLog (t ))
538+ executed := sut .runConsensusLoop (t , txWithLog (t ))
544539 require .NoErrorf (t , executed .WaitUntilExecuted (ctx ), "%T.WaitUntilExecuted()" , executed )
545540
546541 // Although the FiltersAPI will work without any blocks indexed, such a
@@ -698,7 +693,7 @@ func TestGetReceipts(t *testing.T) {
698693
699694 slice := func (t * testing.T , from , to int ) (* blocks.Block , []* types.Receipt ) {
700695 t .Helper ()
701- b := sut .runConsensusLoopFromLastAccepted (t , txs [from :to ]... )
696+ b := sut .runConsensusLoop (t , txs [from :to ]... )
702697 rs := want [from :to ]
703698
704699 var totalGas uint64
@@ -725,7 +720,7 @@ func TestGetReceipts(t *testing.T) {
725720 Gas : params .TxGas ,
726721 GasPrice : big .NewInt (1 ),
727722 })
728- pending := sut .runConsensusLoopFromLastAccepted (t , pendingTx )
723+ pending := sut .runConsensusLoop (t , pendingTx )
729724
730725 var tests []rpcTest
731726 for _ , tc := range []struct {
@@ -913,7 +908,7 @@ func TestDebugGetRawTransaction(t *testing.T) {
913908 Gas : params .TxGas ,
914909 GasFeeCap : big .NewInt (1 ),
915910 })
916- b := sut .runConsensusLoopFromLastAccepted (t , tx )
911+ b := sut .runConsensusLoop (t , tx )
917912 require .NoErrorf (t , b .WaitUntilExecuted (ctx ), "%T.WaitUntilExecuted()" , b )
918913
919914 marshaled , err := tx .MarshalBinary ()
@@ -1179,17 +1174,17 @@ func TestResolveBlockNumberOrHash(t *testing.T) {
11791174 opt , vmTime := withVMTime (t , time .Unix (saeparams .TauSeconds , 0 ))
11801175 ctx , sut := newSUT (t , 0 , opt )
11811176
1182- settled := sut .runConsensusLoop (t , sut . lastAcceptedBlock ( t ) )
1177+ settled := sut .runConsensusLoop (t )
11831178 vmTime .advanceToSettle (ctx , t , settled )
11841179
11851180 for range 2 {
1186- b := sut .runConsensusLoop (t , sut . lastAcceptedBlock ( t ) )
1181+ b := sut .runConsensusLoop (t )
11871182 vmTime .advanceToSettle (ctx , t , b )
11881183 }
11891184 _ , ok := sut .rawVM .blocks .Load (settled .Hash ())
11901185 require .False (t , ok , "settled block still in VM memory" )
11911186
1192- accepted := sut .runConsensusLoop (t , sut . lastAcceptedBlock ( t ) )
1187+ accepted := sut .runConsensusLoop (t )
11931188 require .NoError (t , sut .SetPreference (ctx , accepted .ID ()), "SetPreference()" )
11941189
11951190 b , err := sut .BuildBlock (ctx )
0 commit comments