update map_response to parse json string response with quotes#924
Conversation
|
Claude finished @noot's task in 58s —— View job Claude PR Review
ReviewThe fix correctly addresses the bug — bloxroute returns the body as a JSON string literal A few minor observations:
if status == StatusCode::OK {
let unquoted = serde_json::from_slice::<String>(bytes).ok();
let candidate = unquoted.as_deref().map(str::trim).unwrap_or(trimmed);
if candidate == "block received" {
return Ok(());
}
}That said, the current approach is simpler and matches the pragmatic "be liberal in what you accept" style already used here. Fine to leave as-is. Inner whitespace not handled — if a relay ever returned Body content unused on error — No bugs, security, or performance concerns. LGTM. |
📝 Summary
fix unnecessary warning log
{message":{"fields":{"err":"Relay error: Unknown relay response, status: 200 OK, body: \"block received\"\n",...}}}, previously theblock receivedresponse was being turned into aRelayError::UnknownRelayErrorsince thetrim()function just removed whitespace but didn't remove the quotes aroundblock received. this now changes it to beOk(()).💡 Motivation and Context
log clean up
✅ I have completed the following steps:
make lintmake test