Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
Fix some comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrm50 committed Jan 17, 2024
1 parent 874e1ef commit c5edd2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/protocol/engine/mempool/v1/inclusion_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion pkg/protocol/sybilprotection/seatmanager/seatmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c5edd2a

Please sign in to comment.