mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 22:21:07 +00:00
Switch offchain workers to new futures (#3285)
* Switch offchain workers to new futures * Fix tests
This commit is contained in:
committed by
Gavin Wood
parent
b29277239a
commit
3d65753d48
@@ -23,7 +23,7 @@ use std::{
|
||||
};
|
||||
|
||||
use client::backend::OffchainStorage;
|
||||
use futures::{Stream, Future, sync::mpsc};
|
||||
use futures::{StreamExt as _, Future, future, channel::mpsc};
|
||||
use log::{info, debug, warn, error};
|
||||
use network::{PeerId, Multiaddr, NetworkStateInfo};
|
||||
use codec::{Encode, Decode};
|
||||
@@ -297,14 +297,14 @@ impl<A: ChainApi> AsyncApi<A> {
|
||||
}
|
||||
|
||||
/// Run a processing task for the API
|
||||
pub fn process(mut self) -> impl Future<Item=(), Error=()> {
|
||||
pub fn process(mut self) -> impl Future<Output = ()> {
|
||||
let receiver = self.receiver.take().expect("Take invoked only once.");
|
||||
|
||||
receiver.for_each(move |msg| {
|
||||
match msg {
|
||||
ExtMessage::SubmitExtrinsic(ext) => self.submit_extrinsic(ext),
|
||||
}
|
||||
Ok(())
|
||||
future::ready(())
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user