Documentation ¶
Index ¶
- Variables
- type Events
- type SequenceTracker
- func (s *SequenceTracker[VotePowerType]) EvictSequence(sequenceID markers.SequenceID)
- func (s *SequenceTracker[VotePowerType]) TrackVotes(pastMarkers *markers.Markers, voterID identity.ID, power VotePowerType)
- func (s *SequenceTracker[VotePowerType]) Voters(marker markers.Marker) (voters *advancedset.AdvancedSet[identity.ID])
- func (s *SequenceTracker[VotePowerType]) VotersWithPower(marker markers.Marker) (voters map[identity.ID]VotePowerType)
- type TestFramework
- type VoterUpdatedEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) { return &Events{ VotersUpdated: event.New1[*VoterUpdatedEvent](), } })
NewEvents contains the constructor of the Events object (it is generated by a generic factory).
Functions ¶
This section is empty.
Types ¶
type SequenceTracker ¶
type SequenceTracker[VotePowerType constraints.Comparable[VotePowerType]] struct { Events *Events // contains filtered or unexported fields }
func NewSequenceTracker ¶
func NewSequenceTracker[VotePowerType constraints.Comparable[VotePowerType]](validators *sybilprotection.WeightedSet, sequenceCallback func(id markers.SequenceID) (sequence *markers.Sequence, exists bool), cutoffIndexCallback func(sequenceID markers.SequenceID) markers.Index) *SequenceTracker[VotePowerType]
func (*SequenceTracker[VotePowerType]) EvictSequence ¶
func (s *SequenceTracker[VotePowerType]) EvictSequence(sequenceID markers.SequenceID)
func (*SequenceTracker[VotePowerType]) TrackVotes ¶
func (s *SequenceTracker[VotePowerType]) TrackVotes(pastMarkers *markers.Markers, voterID identity.ID, power VotePowerType)
func (*SequenceTracker[VotePowerType]) Voters ¶
func (s *SequenceTracker[VotePowerType]) Voters(marker markers.Marker) (voters *advancedset.AdvancedSet[identity.ID])
func (*SequenceTracker[VotePowerType]) VotersWithPower ¶
func (s *SequenceTracker[VotePowerType]) VotersWithPower(marker markers.Marker) (voters map[identity.ID]VotePowerType)
type TestFramework ¶
type TestFramework[VotePowerType constraints.Comparable[VotePowerType]] struct { Instance *SequenceTracker[VotePowerType] Votes *votes.TestFramework Markers *markers.TestFramework // contains filtered or unexported fields }
func NewTestFramework ¶
func NewTestFramework[VotePowerType constraints.Comparable[VotePowerType]](test *testing.T, votesTF *votes.TestFramework, sequenceTracker *SequenceTracker[VotePowerType], sequenceManager *markers.SequenceManager) *TestFramework[VotePowerType]
NewTestFramework is the constructor of the TestFramework.
func (*TestFramework[VotePowerType]) ValidateStructureDetailsVoters ¶
func (t *TestFramework[VotePowerType]) ValidateStructureDetailsVoters(expectedVoters map[string]*advancedset.AdvancedSet[identity.ID])
type VoterUpdatedEvent ¶
Click to show internal directories.
Click to hide internal directories.