use 1 constant in tests to configure initialCycle variable (#7720)

This commit is contained in:
Alex Sharov 2023-06-13 10:55:59 +07:00 committed by GitHub
parent cefbf18088
commit ae1b193d6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -50,7 +50,7 @@ func TestEthSubscribe(t *testing.T) {
newHeads, id := ff.SubscribeNewHeads(16) newHeads, id := ff.SubscribeNewHeads(16)
defer ff.UnsubscribeHeads(id) defer ff.UnsubscribeHeads(id)
initialCycle := true initialCycle := stages.MockInsertAsInitialCycle
highestSeenHeader := chain.TopBlock.NumberU64() highestSeenHeader := chain.TopBlock.NumberU64()
hook := stages.NewHook(m.Ctx, m.Notifications, m.Sync, br, m.ChainConfig, m.Log, m.UpdateHead) hook := stages.NewHook(m.Ctx, m.Notifications, m.Sync, br, m.ChainConfig, m.Log, m.UpdateHead)

View File

@ -60,7 +60,7 @@ func TestSendRawTransaction(t *testing.T) {
} }
m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed
initialCycle := true initialCycle := stages.MockInsertAsInitialCycle
if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, logger, nil, nil); err != nil { if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, logger, nil, nil); err != nil {
t.Fatal(err) t.Fatal(err)
} }

View File

@ -608,7 +608,7 @@ func (ms *MockSentry) insertPoSBlocks(chain *core.ChainPack) error {
ms.SendPayloadRequest(chain.Blocks[i]) ms.SendPayloadRequest(chain.Blocks[i])
} }
initialCycle := false initialCycle := MockInsertAsInitialCycle
blockReader, _ := ms.NewBlocksIO() blockReader, _ := ms.NewBlocksIO()
hook := NewHook(ms.Ctx, ms.Notifications, ms.Sync, blockReader, ms.ChainConfig, ms.Log, ms.UpdateHead) hook := NewHook(ms.Ctx, ms.Notifications, ms.Sync, blockReader, ms.ChainConfig, ms.Log, ms.UpdateHead)
headBlockHash, err := StageLoopStep(ms.Ctx, ms.DB, ms.Sync, initialCycle, ms.Log, blockReader.Snapshots().(*snapshotsync.RoSnapshots), hook) headBlockHash, err := StageLoopStep(ms.Ctx, ms.DB, ms.Sync, initialCycle, ms.Log, blockReader.Snapshots().(*snapshotsync.RoSnapshots), hook)

View File

@ -163,7 +163,7 @@ func TestReorg(t *testing.T) {
} }
m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed
initialCycle := true initialCycle := stages.MockInsertAsInitialCycle
if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, m.Log, m.BlockSnapshots, nil); err != nil { if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, m.Log, m.BlockSnapshots, nil); err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -392,7 +392,7 @@ func TestAnchorReplace(t *testing.T) {
m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed
initialCycle := true initialCycle := stages.MockInsertAsInitialCycle
if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, m.Log, m.BlockSnapshots, nil); err != nil { if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, m.Log, m.BlockSnapshots, nil); err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -497,7 +497,7 @@ func TestAnchorReplace2(t *testing.T) {
m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed
br, _ := m.NewBlocksIO() br, _ := m.NewBlocksIO()
initialCycle := true initialCycle := stages.MockInsertAsInitialCycle
hook := stages.NewHook(m.Ctx, m.Notifications, m.Sync, br, m.ChainConfig, m.Log, m.UpdateHead) hook := stages.NewHook(m.Ctx, m.Notifications, m.Sync, br, m.ChainConfig, m.Log, m.UpdateHead)
if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, m.Log, m.BlockSnapshots, hook); err != nil { if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, m.Log, m.BlockSnapshots, hook); err != nil {
t.Fatal(err) t.Fatal(err)