mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 17:17:56 +00:00
Update smoldot to 0.12 (#1212)
* Update lightclient Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * testing: Fix typo Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * testing: Update cargo.toml Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Add tracing logs to improve debugging Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Add socket buffers module for `PlatformRef` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Update `SubxtPlatform` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cargo: Add lightclient dependencies Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update cargo.lock of wasm tests Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Add constant for with-buffer module Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Replace rand crate with getrandom Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * example: Update cargo lock file Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Update deps Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Tadeo Hepperle <62739623+tadeohepperle@users.noreply.github.com>
This commit is contained in:
@@ -114,6 +114,8 @@ impl BackgroundTask {
|
||||
|
||||
self.requests.insert(id, sender);
|
||||
|
||||
tracing::trace!(target: LOG_TARGET, "Generated unique id={id} for request={request}");
|
||||
|
||||
let result = self.client.json_rpc_request(request, self.chain_id);
|
||||
if let Err(err) = result {
|
||||
tracing::warn!(
|
||||
@@ -136,6 +138,8 @@ impl BackgroundTask {
|
||||
"Cannot send RPC request error to id={id}",
|
||||
);
|
||||
}
|
||||
} else {
|
||||
tracing::trace!(target: LOG_TARGET, "Submitted to smoldot request with id={id}");
|
||||
}
|
||||
}
|
||||
FromSubxt::Subscription {
|
||||
@@ -154,6 +158,8 @@ impl BackgroundTask {
|
||||
|
||||
self.id_to_subscription.insert(id, (sub_id, sender));
|
||||
|
||||
tracing::trace!(target: LOG_TARGET, "Generated unique id={id} for subscription request={request}");
|
||||
|
||||
let result = self.client.json_rpc_request(request, self.chain_id);
|
||||
if let Err(err) = result {
|
||||
tracing::warn!(
|
||||
@@ -176,6 +182,8 @@ impl BackgroundTask {
|
||||
"Cannot send RPC request error to id={id}",
|
||||
);
|
||||
}
|
||||
} else {
|
||||
tracing::trace!(target: LOG_TARGET, "Submitted to smoldot subscription request with id={id}");
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -183,6 +191,8 @@ impl BackgroundTask {
|
||||
|
||||
/// Parse the response received from the light client and sent it to the appropriate user.
|
||||
fn handle_rpc_response(&mut self, response: String) {
|
||||
tracing::trace!(target: LOG_TARGET, "Received from smoldot response={:?}", response);
|
||||
|
||||
match RpcResponse::from_str(&response) {
|
||||
Ok(RpcResponse::Error { id, error }) => {
|
||||
let Ok(id) = id.parse::<usize>() else {
|
||||
|
||||
Reference in New Issue
Block a user