Debug smoldot raw legacy RPC

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2024-02-27 15:45:50 +02:00
parent 63306d95d3
commit 3ab2ae52dc
4 changed files with 100 additions and 17 deletions
+2 -2
View File
@@ -233,7 +233,7 @@ impl<TPlatform: PlatformRef, TChain> BackgroundTask<TPlatform, TChain> {
/// Parse the response received from the light client and sent it to the appropriate user.
fn handle_rpc_response(&mut self, chain_id: smoldot_light::ChainId, response: String) {
tracing::trace!(target: LOG_TARGET, "Received from smoldot response={response} chain={chain_id:?}");
tracing::trace!(target: LOG_TARGET, "Received from smoldot response={} chain={:?}", if response.len() > 200 { &response[..200] } else { &response }, chain_id);
match RpcResponse::from_str(&response) {
Ok(RpcResponse::Error { id, error }) => {
@@ -420,7 +420,7 @@ impl<TPlatform: PlatformRef, TChain> BackgroundTask<TPlatform, TChain> {
tracing::trace!(
target: LOG_TARGET,
"Received smoldot RPC chain {:?} result {:?}",
chain, response
chain, if response.len() > 200 { &response[..200] } else { &response }
);
self.handle_rpc_response(chain, response);