From 4c0ac5611807c8b79f1e2513673d1bc0b8a2362d Mon Sep 17 00:00:00 2001 From: Piotr Macek <4007944+piotrm50@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:13:03 +0100 Subject: [PATCH] Fix tracking filtered blocks. --- pkg/testsuite/mock/node.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/testsuite/mock/node.go b/pkg/testsuite/mock/node.go index d144adf69..fa52001ea 100644 --- a/pkg/testsuite/mock/node.go +++ b/pkg/testsuite/mock/node.go @@ -150,6 +150,13 @@ func (n *Node) hookEvents() { events.CandidateEngineActivated.Hook(func(e *engine.Engine) { n.candidateEngineActivatedCount.Add(1) }) events.MainEngineSwitched.Hook(func(e *engine.Engine) { n.mainEngineSwitchedCount.Add(1) }) + + n.Protocol.Events.Engine.CommitmentFilter.BlockFiltered.Hook(func(event *commitmentfilter.BlockFilteredEvent) { + n.mutex.Lock() + defer n.mutex.Unlock() + + n.filteredBlockEvents = append(n.filteredBlockEvents, event) + }) } func (n *Node) hookLogging(failOnBlockFiltered bool) {