From 5aa0ac880a06ff9527a16d80bec01834aece4dff Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 25 May 2023 14:48:55 +0300 Subject: [PATCH] lightclient: Ignore validated events Signed-off-by: Alexandru Vasile --- subxt/src/rpc/lightclient/background.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/subxt/src/rpc/lightclient/background.rs b/subxt/src/rpc/lightclient/background.rs index 322c2098d4..bce41ca66e 100644 --- a/subxt/src/rpc/lightclient/background.rs +++ b/subxt/src/rpc/lightclient/background.rs @@ -126,10 +126,11 @@ impl BackgroundTask { } Ok(RpcResponse::Subscription { method, id, result }) => { // Subxt calls into `author_submitAndWatchExtrinsic`, however the smoldot produces - // `{"event":"broadcasted","numPeers":1}` which is part of the RPC V2 API. Ignore - // this spurious event. + // `{"event":"broadcasted","numPeers":1}` and `{"event":"validated"}` which are part + // of the RPC V2 API. Ignore those events. if method == "transaction_unstable_watchEvent" - && result.to_string().contains("broadcasted") + && (result.to_string().contains("broadcasted") + || result.to_string().contains("validated")) { tracing::debug!(target: LOG_TARGET, "Ignoring notification {:?}", result); return;