Skip to content

Commit

Permalink
chore: addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed May 26, 2022
1 parent 4275e5b commit 226c7df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dot/rpc/subscription/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
type websocketMessage struct {
ID float64 `json:"id"`
Method string `json:"method"`
Params any
Params any `json:"params"`
}

type httpclient interface {
Expand Down Expand Up @@ -57,13 +57,13 @@ func (c *WSConn) readWebsocketMessage() (rawBytes []byte, wsMessage *websocketMe
return nil, nil, fmt.Errorf("%w: %s", errCannotReadFromWebsocket, err.Error())
}

msg := new(websocketMessage)
err = json.Unmarshal(rawBytes, &msg)
wsMessage = new(websocketMessage)
err = json.Unmarshal(rawBytes, wsMessage)
if err != nil {
return nil, nil, err
}

return rawBytes, msg, nil
return rawBytes, wsMessage, nil
}

// HandleConn handles messages received on websocket connections
Expand Down

0 comments on commit 226c7df

Please sign in to comment.