fix: debug updates on node-sequencer synchronization

This commit is contained in:
Oleksandr Pravdyvyi
2024-12-29 14:11:47 +02:00
parent 1ce6141cc1
commit 90da8b45f4
19 changed files with 158 additions and 30 deletions
+8
View File
@@ -67,3 +67,11 @@ impl SequencerRpcRequest {
}
}
}
#[derive(Debug, Clone, Deserialize)]
pub struct SequencerRpcResponse {
pub jsonrpc: String,
pub result: serde_json::Value,
pub id: u64,
}
+6 -6
View File
@@ -3,7 +3,7 @@ use anyhow::Result;
use json::{
GetBlockDataRequest, GetBlockDataResponse, GetGenesisIdRequest, GetGenesisIdResponse,
RegisterAccountRequest, RegisterAccountResponse, SendTxRequest, SendTxResponse,
SequencerRpcRequest,
SequencerRpcRequest, SequencerRpcResponse,
};
use k256::elliptic_curve::group::GroupEncoding;
use reqwest::Client;
@@ -62,9 +62,9 @@ impl SequencerClient {
let call_res = call_builder.json(&request).send().await?;
let response = call_res.json::<Value>().await?;
let response = call_res.json::<SequencerRpcResponse>().await?;
Ok(response)
Ok(response.result)
}
pub async fn get_block(
@@ -121,11 +121,11 @@ impl SequencerClient {
pub async fn get_genesis_id(&self) -> Result<GetGenesisIdResponse, SequencerClientError> {
let genesis_req = GetGenesisIdRequest {};
let req = serde_json::to_value(genesis_req)?;
let req = serde_json::to_value(genesis_req).unwrap();
let resp = self.call_method_with_payload("get_genesis", req).await?;
let resp = self.call_method_with_payload("get_genesis", req).await.unwrap();
let resp_deser = serde_json::from_value(resp)?;
let resp_deser = serde_json::from_value(resp).unwrap();
Ok(resp_deser)
}