rpc: adjust comment to Notification value cast
And explicitly specify field names on Notification creation.
This commit is contained in:
parent
295add052b
commit
4ce6bc6a66
1 changed files with 3 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue