func WALEntry(persistedEvent *eventpb.Event, retentionIndex t.WALRetIndex) *eventpb.Event {
	return &eventpb.Event{Type: &eventpb.Event_WalEntry{WalEntry: &eventpb.WALEntry{
		Event: persistedEvent,
	}}}
}
WALEntry returns an event of reading an entry from the WAL.
Those events are used at system initialization.
package events
import (
	"github.com/hyperledger-labs/mirbft/pkg/pb/eventpb"
	"github.com/hyperledger-labs/mirbft/pkg/pb/messagepb"
	"github.com/hyperledger-labs/mirbft/pkg/pb/requestpb"
	t "github.com/hyperledger-labs/mirbft/pkg/types"
)
func Strip(event *eventpb.Event) *EventList {
	nextList := &EventList{}
	for _, e := range event.Next {
		nextList.PushBack(e)
	}
	event.Next = nil
	return nextList
}
func Tick() *eventpb.Event {
	return &eventpb.Event{Type: &eventpb.Event_Tick{Tick: &eventpb.Tick{}}}
}
func SendMessage(message *messagepb.Message, destinations []t.NodeID) *eventpb.Event {
	return &eventpb.Event{Type: &eventpb.Event_SendMessage{SendMessage: &eventpb.SendMessage{
		Destinations: t.NodeIDSlicePb(destinations),
		Msg:          message,
	}}}
}
func MessageReceived(from t.NodeID, message *messagepb.Message) *eventpb.Event {
	return &eventpb.Event{Type: &eventpb.Event_MessageReceived{MessageReceived: &eventpb.MessageReceived{
		From: from.Pb(),
		Msg:  message,
	}}}
}
func ClientRequest(clientID t.ClientID, reqNo t.ReqNo, data []byte) *eventpb.Event {
	return &eventpb.Event{Type: &eventpb.Event_Request{Request: &requestpb.Request{
		ClientId: clientID.Pb(),
		ReqNo:    reqNo.Pb(),
		Data:     data,
	}}}
}
func HashRequest(data [][]byte, origin *eventpb.HashOrigin) *eventpb.Event {
	return &eventpb.Event{Type: &eventpb.Event_HashRequest{HashRequest: &eventpb.HashRequest{
		Data:   data,
		Origin: origin,
	}}}
}
func HashResult(digest []byte, origin *eventpb.HashOrigin) *eventpb.Event {
	return &eventpb.Event{Type: &eventpb.Event_HashResult{HashResult: &eventpb.HashResult{
		Digest: digest,
		Origin: origin,
	}}}
}
func RequestReady(requestRef *requestpb.RequestRef) *eventpb.Event {
	return &eventpb.Event{Type: &eventpb.Event_RequestReady{RequestReady: &eventpb.RequestReady{
		RequestRef: requestRef,
	}}}
}
func WALAppend(event *eventpb.Event, retentionIndex t.WALRetIndex) *eventpb.Event {
	return &eventpb.Event{Type: &eventpb.Event_WalAppend{WalAppend: &eventpb.WALAppend{
		Event:          event,
		RetentionIndex: retentionIndex.Pb(),
	}}}
}