types: rename and extend the EventData interface (#7687)

This is the interface shared by types that can be used as event data in, for
example, subscriptions via the RPC.

To be compatible with the RPC service, data need to support JSON encoding.
Require this as part of the interface.
This commit is contained in:
M. J. Fromberger
2022-01-26 07:01:55 -08:00
committed by GitHub
parent fcfe157f6b
commit 441ecbaeec
9 changed files with 70 additions and 63 deletions

View File

@@ -88,8 +88,10 @@ var (
// ENCODING / DECODING
// TMEventData implements events.EventData.
type TMEventData interface{}
// EventData is satisfied by types that can be published as event data.
type EventData interface {
jsontypes.Tagged
}
func init() {
jsontypes.MustRegister(EventDataBlockSyncStatus{})