Skip to content

Commit acd92c4

Browse files
committed
Simplify some changes
1 parent dc3d1f3 commit acd92c4

File tree

1 file changed

+5
-7
lines changed
  • crates/anvil-polkadot/src/substrate_node/lazy_loading

1 file changed

+5
-7
lines changed

crates/anvil-polkadot/src/substrate_node/lazy_loading/rpc_client.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,8 @@ impl<Block: BlockT + DeserializeOwned> Rpc<Block> {
125125

126126
// Use the global RPC runtime to avoid Tokio context conflicts
127127
// The runtime is spawned on a separate thread to completely isolate from the main runtime
128-
let (tx, rx) = std::sync::mpsc::channel();
129128
std::thread::spawn(move || {
130-
let result = get_rpc_runtime().block_on(async move {
129+
get_rpc_runtime().block_on(async move {
131130
let start_req = std::time::Instant::now();
132131
tracing::debug!(
133132
target: super::LAZY_LOADING_LOG_TARGET,
@@ -151,11 +150,10 @@ impl<Block: BlockT + DeserializeOwned> Rpc<Block> {
151150
);
152151

153152
result
154-
});
155-
let _ = tx.send(result);
156-
});
157-
158-
rx.recv().expect("RPC thread terminated unexpectedly")
153+
})
154+
})
155+
.join()
156+
.expect("RPC thread panicked")
159157
}
160158
}
161159

0 commit comments

Comments
 (0)