Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions simulators/ethereum/engine/clmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ type BlockProcessCallbacks struct {
OnForkchoiceBroadcast func()
OnSafeBlockChange func()
OnFinalizedBlockChange func()
OnBlockProductionEnd func()
}

func (cl *CLMocker) produceSingleBlock(callbacks BlockProcessCallbacks) {
Expand Down Expand Up @@ -451,6 +452,9 @@ func (cl *CLMocker) produceSingleBlock(callbacks BlockProcessCallbacks) {
cl.Fatalf("CLMocker: None of the clients accepted the newly constructed payload")
}

if callbacks.OnBlockProductionEnd != nil {
callbacks.OnBlockProductionEnd()
}
}

// Loop produce PoS blocks by using the Engine API
Expand Down
2 changes: 1 addition & 1 deletion simulators/ethereum/engine/enginetests.go
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ func reorgBack(t *TestEnv) {

// Produce blocks before starting the test (So we don't try to reorg back to the genesis block)
t.CLMock.produceBlocks(5, BlockProcessCallbacks{
OnForkchoiceBroadcast: func() {
OnBlockProductionEnd: func() {
// Send a fcU with the HeadBlockHash pointing back to the previous block
forkchoiceUpdatedBack := ForkchoiceStateV1{
HeadBlockHash: previousHash,
Expand Down