mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 11:38:01 +00:00
Fix the metered unbounded sender/recievers (#6246)
* Fix the metered unbounded sender/recievers * Use a counter instead * Update client/rpc/src/system/tests.rs * Add an is_terminated check * Add FusedStream impl Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -22,7 +22,8 @@ use sc_network::{self, PeerId};
|
||||
use sc_network::config::Role;
|
||||
use substrate_test_runtime_client::runtime::Block;
|
||||
use assert_matches::assert_matches;
|
||||
use futures::{prelude::*, channel::mpsc};
|
||||
use futures::prelude::*;
|
||||
use sp_utils::mpsc::tracing_unbounded;
|
||||
use std::thread;
|
||||
|
||||
struct Status {
|
||||
@@ -46,7 +47,7 @@ impl Default for Status {
|
||||
fn api<T: Into<Option<Status>>>(sync: T) -> System<Block> {
|
||||
let status = sync.into().unwrap_or_default();
|
||||
let should_have_peers = !status.is_dev;
|
||||
let (tx, rx) = mpsc::unbounded();
|
||||
let (tx, rx) = tracing_unbounded("rpc_system_tests");
|
||||
thread::spawn(move || {
|
||||
futures::executor::block_on(rx.for_each(move |request| {
|
||||
match request {
|
||||
|
||||
Reference in New Issue
Block a user