refactor(core): remove consensus events (#19757)

This commit is contained in:
Marko 2024-03-15 10:40:23 +01:00 committed by GitHub
parent d54335e1f9
commit 0cdf3cf97c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 1 additions and 20 deletions

View File

@ -18,9 +18,7 @@ type Service interface {
type Manager interface {
// Emit emits events represented as a protobuf message (as described in ADR 032).
//
// Callers SHOULD assume that these events may be included in consensus. These events
// MUST be emitted deterministically and adding, removing or changing these events SHOULD
// be considered state-machine breaking.
// Callers SHOULD assume that these events will not be included in consensus.
Emit(event protoiface.MessageV1) error
// EmitKV emits an event based on an event and kv-pair attributes.
@ -28,11 +26,4 @@ type Manager interface {
// These events will not be part of consensus and adding, removing or changing these events is
// not a state-machine breaking change.
EmitKV(eventType string, attrs ...Attribute) error
// EmitNonConsensus emits events represented as a protobuf message (as described in ADR 032), without
// including it in blockchain consensus.
//
// These events will not be part of consensus and adding, removing or changing events is
// not a state-machine breaking change.
EmitNonConsensus(event protoiface.MessageV1) error
}

View File

@ -49,9 +49,3 @@ func (e Events) EmitKV(eventType string, attrs ...event.Attribute) error {
e.EventManagerI.EmitEvents(sdk.Events{sdk.NewEvent(eventType, attributes...)})
return nil
}
// EmitNonConsensus emits an typed event that is defined in the protobuf file.
// In the future these events will be added to consensus.
func (e Events) EmitNonConsensus(event protoiface.MessageV1) error {
return e.EventManagerI.EmitTypedEvent(event)
}

View File

@ -33,10 +33,6 @@ func (e eventService) EmitKV(eventType string, attrs ...event.Attribute) error {
return nil
}
func (e eventService) EmitNonConsensus(event protoiface.MessageV1) error {
return nil
}
func (e eventService) EventManager(ctx context.Context) event.Manager { return e }
var _ InterfaceRegistry = (*interfaceRegistry)(nil)