mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
use 1 constant in tests to configure initialCycle variable (#7720)
This commit is contained in:
parent
cefbf18088
commit
ae1b193d6f
@ -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)
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user