mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 08:27:55 +00:00
Upgrade jsonrpc to 0.18.0 (#9547)
* Upgrade jsonrpc to 0.18.0
I think this says all :P
* 🤦
* Fmt etc
* Fix tests
* Fix tests again...
* Better impl
* Revert "Tell dependabot to ignore jsonrpc-* updates (#9518)"
This reverts commit 6e0cd5587d.
This commit is contained in:
@@ -18,8 +18,10 @@
|
||||
|
||||
//! Testing utils used by the RPC tests.
|
||||
|
||||
use futures::{compat::Future01CompatExt, executor, FutureExt};
|
||||
use rpc::futures::future as future01;
|
||||
use futures::{
|
||||
executor,
|
||||
task::{FutureObj, Spawn, SpawnError},
|
||||
};
|
||||
|
||||
// Executor shared by all tests.
|
||||
//
|
||||
@@ -30,16 +32,15 @@ lazy_static::lazy_static! {
|
||||
.expect("Failed to create thread pool executor for tests");
|
||||
}
|
||||
|
||||
type Boxed01Future01 = Box<dyn future01::Future<Item = (), Error = ()> + Send + 'static>;
|
||||
|
||||
/// Executor for use in testing
|
||||
pub struct TaskExecutor;
|
||||
impl future01::Executor<Boxed01Future01> for TaskExecutor {
|
||||
fn execute(
|
||||
&self,
|
||||
future: Boxed01Future01,
|
||||
) -> std::result::Result<(), future01::ExecuteError<Boxed01Future01>> {
|
||||
EXECUTOR.spawn_ok(future.compat().map(drop));
|
||||
impl Spawn for TaskExecutor {
|
||||
fn spawn_obj(&self, future: FutureObj<'static, ()>) -> Result<(), SpawnError> {
|
||||
EXECUTOR.spawn_ok(future);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn status(&self) -> Result<(), SpawnError> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user