Skip to content

Commit

Permalink
Merge branch 'main' into PRT-solana-tokens-owner-verification
Browse files Browse the repository at this point in the history
  • Loading branch information
shleikes committed Sep 26, 2024
2 parents c642cb2 + 85e4f5d commit c63fe99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions protocol/chainlib/consumer_websocket_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ func (cwm *ConsumerWebsocketManager) ListenToMessages() {
if err != nil {
continue
}

websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: msgData}
}
}
Expand All @@ -241,17 +240,18 @@ func (cwm *ConsumerWebsocketManager) ListenToMessages() {
formatterMsg := logger.AnalyzeWebSocketErrorAndGetFormattedMessage(websocketConn.LocalAddr().String(), utils.LavaFormatError("could not send parsed relay", err), msgSeed, msg, cwm.apiInterface, time.Since(startTime))
if formatterMsg != nil {
websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: formatterMsg}
continue
}
continue
}

relayResultReply := relayResult.GetReply()
if relayResultReply != nil {
// No need to verify signature since this is already happening inside the SendParsedRelay flow
websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: relayResult.GetReply().Data}
continue
} else {
utils.LavaFormatError("Relay result is nil over websocket normal request flow, should not happen", err, utils.LogAttr("messageType", messageType))
}
utils.LavaFormatError("Relay result is nil over websocket normal request flow, should not happen", err, utils.LogAttr("messageType", messageType))
continue
}
}

Expand Down
7 changes: 4 additions & 3 deletions protocol/metrics/rpcconsumerlogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,14 @@ func (rpccl *RPCConsumerLogs) AnalyzeWebSocketErrorAndGetFormattedMessage(webSoc
}
rpccl.LogRequestAndResponse(rpcType+" ws msg", true, "ws", webSocketAddr, string(msg), "", msgSeed, timeTaken, err)

jsonResponse, _ := json.Marshal(fiber.Map{
jsonResponse, err := json.Marshal(fiber.Map{
"Error_Received": rpccl.GetUniqueGuidResponseForError(err, msgSeed),
})

if err != nil {
utils.LavaFormatError("AnalyzeWebSocketErrorAndGetFormattedMessage unexpected behavior, failed marshalling json response", err, utils.LogAttr("seed", msgSeed))
}
return jsonResponse
}

return nil
}

Expand Down

0 comments on commit c63fe99

Please sign in to comment.