mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 20:31:13 +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:
@@ -829,10 +829,10 @@ mod tests {
|
||||
use sp_runtime::traits::{Block as BlockT, DigestFor};
|
||||
use sc_network::config::ProtocolConfig;
|
||||
use parking_lot::Mutex;
|
||||
use tokio::runtime::current_thread;
|
||||
use sp_keyring::sr25519::Keyring;
|
||||
use sc_client::BlockchainEvents;
|
||||
use sp_consensus_aura::sr25519::AuthorityPair;
|
||||
use std::task::Poll;
|
||||
|
||||
type Error = sp_blockchain::Error;
|
||||
|
||||
@@ -950,8 +950,8 @@ mod tests {
|
||||
|
||||
let net = Arc::new(Mutex::new(net));
|
||||
let mut import_notifications = Vec::new();
|
||||
let mut aura_futures = Vec::new();
|
||||
|
||||
let mut runtime = current_thread::Runtime::new().unwrap();
|
||||
let mut keystore_paths = Vec::new();
|
||||
for (peer_id, key) in peers {
|
||||
let mut net = net.lock();
|
||||
@@ -979,7 +979,7 @@ mod tests {
|
||||
&inherent_data_providers, slot_duration.get()
|
||||
).expect("Registers aura inherent data provider");
|
||||
|
||||
let aura = start_aura::<_, _, _, _, _, AuthorityPair, _, _, _>(
|
||||
aura_futures.push(start_aura::<_, _, _, _, _, AuthorityPair, _, _, _>(
|
||||
slot_duration,
|
||||
client.clone(),
|
||||
select_chain,
|
||||
@@ -990,21 +990,19 @@ mod tests {
|
||||
false,
|
||||
keystore,
|
||||
sp_consensus::AlwaysCanAuthor,
|
||||
)
|
||||
.expect("Starts aura")
|
||||
.unit_error()
|
||||
.compat();
|
||||
|
||||
runtime.spawn(aura);
|
||||
).expect("Starts aura"));
|
||||
}
|
||||
|
||||
runtime.spawn(futures01::future::poll_fn(move || {
|
||||
net.lock().poll();
|
||||
Ok::<_, ()>(futures01::Async::NotReady::<()>)
|
||||
}));
|
||||
|
||||
runtime.block_on(future::join_all(import_notifications)
|
||||
.unit_error().compat()).unwrap();
|
||||
futures::executor::block_on(future::select(
|
||||
future::poll_fn(move |cx| {
|
||||
net.lock().poll(cx);
|
||||
Poll::<()>::Pending
|
||||
}),
|
||||
future::select(
|
||||
future::join_all(aura_futures),
|
||||
future::join_all(import_notifications)
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user