mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-12 12:15:40 +00:00
Remove more instances of futures01 (#4633)
* Start removing last few instances of futures01 * Use to_poll on wasm * Revert "Use to_poll on wasm" This reverts commit 1c61728f10d520df5f9b28c415a0db68e478b9c7. * Fix fg test * Upgrade network test futures * Update offchain hyper version * Update service test * bump tokio to 0.2.10 * Removed some unneeded tokios * fixes * fix run_until_all_full * Make service test debuggable * Update client/offchain/src/api/http.rs Co-Authored-By: Demi Obenour <48690212+DemiMarie-parity@users.noreply.github.com> * Add service_test to test-int output * nitpicking * Finally fix test * Give up and revert client/serviec/test * Revert gitlab ci too Co-authored-by: Demi Obenour <demi@parity.io>
This commit is contained in:
@@ -122,28 +122,17 @@ mod tests {
|
||||
let (tx, rx) = mpsc::unbounded();
|
||||
status_sinks.push(Duration::from_millis(100), tx);
|
||||
|
||||
let mut runtime = tokio::runtime::Runtime::new().unwrap();
|
||||
|
||||
let mut val_order = 5;
|
||||
runtime.spawn(futures::future::poll_fn(move |cx| {
|
||||
status_sinks.poll(cx, || { val_order += 1; val_order });
|
||||
Poll::<()>::Pending
|
||||
}));
|
||||
|
||||
let done = rx
|
||||
.into_future()
|
||||
.then(|(item, rest)| {
|
||||
assert_eq!(item, Some(6));
|
||||
rest.into_future()
|
||||
futures::executor::block_on(futures::future::select(
|
||||
futures::future::poll_fn(move |cx| {
|
||||
status_sinks.poll(cx, || { val_order += 1; val_order });
|
||||
Poll::<()>::Pending
|
||||
}),
|
||||
Box::pin(async {
|
||||
let items: Vec<i32> = rx.take(3).collect().await;
|
||||
assert_eq!(items, [6, 7, 8]);
|
||||
})
|
||||
.then(|(item, rest)| {
|
||||
assert_eq!(item, Some(7));
|
||||
rest.into_future()
|
||||
})
|
||||
.map(|(item, _)| {
|
||||
assert_eq!(item, Some(8));
|
||||
});
|
||||
|
||||
runtime.block_on(done);
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user