From c5edd2ae42b2f55dabb245af9cdb4980184f2185 Mon Sep 17 00:00:00 2001 From: Piotr Macek <4007944+piotrm50@users.noreply.github.com> Date: Wed, 17 Jan 2024 15:19:50 +0100 Subject: [PATCH] Fix some comments. --- pkg/protocol/engine/mempool/v1/inclusion_flags.go | 8 ++++---- pkg/protocol/sybilprotection/seatmanager/seatmanager.go | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/protocol/engine/mempool/v1/inclusion_flags.go b/pkg/protocol/engine/mempool/v1/inclusion_flags.go index a52a6f0a6..6e4b465ff 100644 --- a/pkg/protocol/engine/mempool/v1/inclusion_flags.go +++ b/pkg/protocol/engine/mempool/v1/inclusion_flags.go @@ -75,24 +75,24 @@ func (s *inclusionFlags) OnRejected(callback func()) { s.rejected.OnTrigger(callback) } -// IsCommitted returns true if the entity was committed. +// CommittedSlot returns the slot in which the entity is committed and a bool value indicating if the entity was committed. func (s *inclusionFlags) CommittedSlot() (slot iotago.SlotIndex, isCommitted bool) { return s.committedSlot.Get(), s.committedSlot.Get() != 0 } -// OnCommitted registers a callback that gets triggered when the entity gets committed. +// OnCommittedSlotUpdated registers a callback that gets triggered when the slot in which the entity is committed gets updated.. func (s *inclusionFlags) OnCommittedSlotUpdated(callback func(slot iotago.SlotIndex)) { s.committedSlot.OnUpdate(func(_ iotago.SlotIndex, newValue iotago.SlotIndex) { callback(newValue) }) } -// IsOrphaned returns true if the entity was orphaned. +// OrphanedSlot returns a slot in which the entity has been orphaned and a bool flag indicating whether it was orphaned. func (s *inclusionFlags) OrphanedSlot() (slot iotago.SlotIndex, isOrphaned bool) { return s.orphanedSlot.Get(), s.orphanedSlot.Get() != 0 } -// OnOrphaned registers a callback that gets triggered when the entity gets orphaned. +// OnOrphanedSlotUpdated registers a callback that gets triggered when the orphaned slot is updated. func (s *inclusionFlags) OnOrphanedSlotUpdated(callback func(slot iotago.SlotIndex)) { s.orphanedSlot.OnUpdate(func(_ iotago.SlotIndex, newValue iotago.SlotIndex) { callback(newValue) diff --git a/pkg/protocol/sybilprotection/seatmanager/seatmanager.go b/pkg/protocol/sybilprotection/seatmanager/seatmanager.go index 656076a8c..85e87ffd6 100644 --- a/pkg/protocol/sybilprotection/seatmanager/seatmanager.go +++ b/pkg/protocol/sybilprotection/seatmanager/seatmanager.go @@ -31,9 +31,10 @@ type SeatManager interface { // OnlineCommittee returns the set of online validators that is used to track acceptance. OnlineCommittee() ds.Set[account.SeatIndex] - // SeatCount returns the number of seats in the SeatManager. + // SeatCountInSlot returns the number of seats in the SeatManager for the given slot's epoch. SeatCountInSlot(slot iotago.SlotIndex) int + // SeatCountInEpoch returns the number of seats in the SeatManager for the given epoch. SeatCountInEpoch(epoch iotago.EpochIndex) int // Interface embeds the required methods of the module.Interface.