cosmos-sdk/server/v2/streaming/utils.go
Marko d7cc6de7cc
chore: upstream more changes from v2 (#20387)
Co-authored-by: Matt Kocubinski <mkocubinski@gmail.com>
2024-05-17 10:58:52 +00:00

24 lines
508 B
Go

package streaming
import "cosmossdk.io/core/event"
func IntoStreamingEvents(events []event.Event) []*Event {
streamingEvents := make([]*Event, len(events))
for _, event := range events {
strEvent := &Event{
Type: event.Type,
}
for _, eventValue := range event.Attributes {
strEvent.Attributes = append(strEvent.Attributes, &EventAttribute{
Key: eventValue.Key,
Value: eventValue.Value,
})
}
streamingEvents = append(streamingEvents, strEvent)
}
return streamingEvents
}