forked from TrueCloudLab/neoneo-go
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.
|
// Notification represents a server-generated notification for client subscriptions.
|
||||||
// Value can be one of block.Block, state.AppExecResult, state.ContainedNotificationEvent
|
// Value can be one of *block.Block, *state.AppExecResult, *state.ContainedNotificationEvent
|
||||||
// transaction.Transaction or subscriptions.NotaryRequestEvent based on Type.
|
// *transaction.Transaction or *subscriptions.NotaryRequestEvent based on Type.
|
||||||
type Notification struct {
|
type Notification struct {
|
||||||
Type neorpc.EventID
|
Type neorpc.EventID
|
||||||
Value interface{}
|
Value interface{}
|
||||||
|
@ -205,7 +205,7 @@ readloop:
|
||||||
break 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) {
|
} else if rr.ID != nil && (rr.Error != nil || rr.Result != nil) {
|
||||||
id, err := strconv.ParseUint(string(rr.ID), 10, 64)
|
id, err := strconv.ParseUint(string(rr.ID), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue