From ea165a298da26d16c5288938f0e9156360363ca3 Mon Sep 17 00:00:00 2001 From: dhrubabasu <7675102+dhrubabasu@users.noreply.github.com> Date: Tue, 19 Dec 2023 11:15:40 -0500 Subject: [PATCH] Remove unused `AcceptorTracker` struct --- snow/acceptor.go | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/snow/acceptor.go b/snow/acceptor.go index f1a92e2f0303..c4ed74519e14 100644 --- a/snow/acceptor.go +++ b/snow/acceptor.go @@ -15,7 +15,6 @@ import ( var ( _ Acceptor = noOpAcceptor{} - _ Acceptor = (*AcceptorTracker)(nil) _ Acceptor = acceptorWrapper{} _ AcceptorGroup = (*acceptorGroup)(nil) @@ -38,33 +37,6 @@ func (noOpAcceptor) Accept(*ConsensusContext, ids.ID, []byte) error { return nil } -// AcceptorTracker tracks the dispatched accept events by its ID and counts. -// Useful for testing. -type AcceptorTracker struct { - lock sync.RWMutex - accepted map[ids.ID]int -} - -func NewAcceptorTracker() *AcceptorTracker { - return &AcceptorTracker{ - accepted: make(map[ids.ID]int), - } -} - -func (a *AcceptorTracker) Accept(_ *ConsensusContext, containerID ids.ID, _ []byte) error { - a.lock.Lock() - a.accepted[containerID]++ - a.lock.Unlock() - return nil -} - -func (a *AcceptorTracker) IsAccepted(containerID ids.ID) (int, bool) { - a.lock.RLock() - count, ok := a.accepted[containerID] - a.lock.RUnlock() - return count, ok -} - type acceptorWrapper struct { Acceptor