From 4ce6bc6a668cdef8e326079bf9735fab1a66cac9 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 17 Oct 2022 09:12:33 +0300 Subject: [PATCH] rpc: adjust comment to Notification value cast And explicitly specify field names on Notification creation. --- pkg/rpcclient/wsclient.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/rpcclient/wsclient.go b/pkg/rpcclient/wsclient.go index 3a71d8bb9..33de3826d 100644 --- a/pkg/rpcclient/wsclient.go +++ b/pkg/rpcclient/wsclient.go @@ -52,8 +52,8 @@ type WSClient struct { } // Notification represents a server-generated notification for client subscriptions. -// Value can be one of block.Block, state.AppExecResult, state.ContainedNotificationEvent -// transaction.Transaction or subscriptions.NotaryRequestEvent based on Type. +// Value can be one of *block.Block, *state.AppExecResult, *state.ContainedNotificationEvent +// *transaction.Transaction or *subscriptions.NotaryRequestEvent based on Type. type Notification struct { Type neorpc.EventID Value interface{} @@ -205,7 +205,7 @@ readloop: break readloop } } - c.Notifications <- Notification{event, val} + c.Notifications <- Notification{Type: event, Value: val} } else if rr.ID != nil && (rr.Error != nil || rr.Result != nil) { id, err := strconv.ParseUint(string(rr.ID), 10, 64) if err != nil {