Documentation
¶
Index ¶
- Variables
- type AttestationsReceivedEvent
- type AttestationsRequestReceivedEvent
- type BlockReceivedEvent
- type BlockRequestReceivedEvent
- type Endpoint
- type ErrorEvent
- type Events
- type MockedEndpoint
- type MockedNetwork
- type Protocol
- func (p *Protocol) RequestAttestations(cm *commitment.Commitment, endIndex slot.Index, to ...identity.ID)
- func (p *Protocol) RequestBlock(id models.BlockID, to ...identity.ID)
- func (p *Protocol) RequestCommitment(id commitment.ID, to ...identity.ID)
- func (p *Protocol) SendAttestations(cm *commitment.Commitment, blockIDs models.BlockIDs, ...)
- func (p *Protocol) SendBlock(block *models.Block, to ...identity.ID)
- func (p *Protocol) SendSlotCommitment(cm *commitment.Commitment, to ...identity.ID)
- func (p *Protocol) Unregister()
- type SlotCommitmentReceivedEvent
- type SlotCommitmentRequestReceivedEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) { return &Events{ BlockReceived: event.New1[*BlockReceivedEvent](), BlockRequestReceived: event.New1[*BlockRequestReceivedEvent](), SlotCommitmentReceived: event.New1[*SlotCommitmentReceivedEvent](), SlotCommitmentRequestReceived: event.New1[*SlotCommitmentRequestReceivedEvent](), AttestationsReceived: event.New1[*AttestationsReceivedEvent](), AttestationsRequestReceived: event.New1[*AttestationsRequestReceivedEvent](), Error: event.New1[*ErrorEvent](), } })
NewEvents contains the constructor of the Events object (it is generated by a generic factory).
Functions ¶
This section is empty.
Types ¶
type AttestationsReceivedEvent ¶
type AttestationsReceivedEvent struct {
Commitment *commitment.Commitment
BlockIDs models.BlockIDs
Attestations *orderedmap.OrderedMap[slot.Index, *advancedset.AdvancedSet[*notarization.Attestation]]
Source identity.ID
}
type AttestationsRequestReceivedEvent ¶
type AttestationsRequestReceivedEvent struct {
Commitment *commitment.Commitment
EndIndex slot.Index
Source identity.ID
}
type ErrorEvent ¶
type Events ¶
type Events struct {
BlockReceived *event.Event1[*BlockReceivedEvent]
BlockRequestReceived *event.Event1[*BlockRequestReceivedEvent]
SlotCommitmentReceived *event.Event1[*SlotCommitmentReceivedEvent]
SlotCommitmentRequestReceived *event.Event1[*SlotCommitmentRequestReceivedEvent]
AttestationsReceived *event.Event1[*AttestationsReceivedEvent]
AttestationsRequestReceived *event.Event1[*AttestationsRequestReceivedEvent]
Error *event.Event1[*ErrorEvent]
event.Group[Events, *Events]
}
type MockedEndpoint ¶
type MockedEndpoint struct {
// contains filtered or unexported fields
}
func NewMockedEndpoint ¶
func NewMockedEndpoint(id identity.ID, network *MockedNetwork, partition string) (newMockedNetwork *MockedEndpoint)
func (*MockedEndpoint) RegisterProtocol ¶
func (*MockedEndpoint) UnregisterProtocol ¶
func (m *MockedEndpoint) UnregisterProtocol(protocolID string)
type MockedNetwork ¶
type MockedNetwork struct {
// contains filtered or unexported fields
}
func NewMockedNetwork ¶
func NewMockedNetwork() (mockedNetwork *MockedNetwork)
func (*MockedNetwork) Join ¶
func (m *MockedNetwork) Join(endpointID identity.ID, partition ...string) (endpoint *MockedEndpoint)
func (*MockedNetwork) MergePartitionsToMain ¶
func (m *MockedNetwork) MergePartitionsToMain(partitions ...string)
type Protocol ¶
type Protocol struct {
Events *Events
// contains filtered or unexported fields
}
func NewProtocol ¶
func NewProtocol(network Endpoint, workerPool *workerpool.WorkerPool, slotTimeProvider *slot.TimeProvider, opts ...options.Option[Protocol]) (protocol *Protocol)
func (*Protocol) RequestAttestations ¶
func (p *Protocol) RequestAttestations(cm *commitment.Commitment, endIndex slot.Index, to ...identity.ID)
func (*Protocol) RequestBlock ¶
func (*Protocol) RequestCommitment ¶
func (p *Protocol) RequestCommitment(id commitment.ID, to ...identity.ID)
func (*Protocol) SendAttestations ¶
func (p *Protocol) SendAttestations(cm *commitment.Commitment, blockIDs models.BlockIDs, attestations *orderedmap.OrderedMap[slot.Index, *advancedset.AdvancedSet[*notarization.Attestation]], to ...identity.ID)
func (*Protocol) SendSlotCommitment ¶
func (p *Protocol) SendSlotCommitment(cm *commitment.Commitment, to ...identity.ID)
func (*Protocol) Unregister ¶
func (p *Protocol) Unregister()
type SlotCommitmentReceivedEvent ¶
type SlotCommitmentReceivedEvent struct {
Commitment *commitment.Commitment
Source identity.ID
}
type SlotCommitmentRequestReceivedEvent ¶
type SlotCommitmentRequestReceivedEvent struct {
CommitmentID commitment.ID
Source identity.ID
}
Click to show internal directories.
Click to hide internal directories.