@@ -218,7 +218,9 @@ where
218
218
}
219
219
} ) ) ;
220
220
221
- async fn block_on < I : Send + ' static , ER : Send + ' static > (
221
+ // This is a hack required because the json-rpc crate is not updated to tokio 0.2.
222
+ // We should watch the `jsonrpsee` crate and switch to that once it's ready.
223
+ async fn tokio02_spawn < I : Send + ' static , ER : Send + ' static > (
222
224
mut task_sink : mpsc:: Sender < Box < dyn std:: future:: Future < Output = ( ) > + Send + Unpin > > ,
223
225
future : impl std:: future:: Future < Output = Result < I , ER > > + Send + Unpin + ' static ,
224
226
) -> Result < I , ER >
@@ -240,7 +242,7 @@ where
240
242
let sender = task_sender. clone ( ) ;
241
243
handler. add_method ( "subgraph_create" , move |params : Params | {
242
244
let me = me. clone ( ) ;
243
- Box :: pin ( block_on (
245
+ Box :: pin ( tokio02_spawn (
244
246
sender. clone ( ) ,
245
247
params
246
248
. parse ( )
@@ -255,7 +257,7 @@ where
255
257
let sender = task_sender. clone ( ) ;
256
258
handler. add_method ( "subgraph_deploy" , move |params : Params | {
257
259
let me = me. clone ( ) ;
258
- Box :: pin ( block_on (
260
+ Box :: pin ( tokio02_spawn (
259
261
sender. clone ( ) ,
260
262
params
261
263
. parse ( )
@@ -270,7 +272,7 @@ where
270
272
let sender = task_sender. clone ( ) ;
271
273
handler. add_method ( "subgraph_remove" , move |params : Params | {
272
274
let me = me. clone ( ) ;
273
- Box :: pin ( block_on (
275
+ Box :: pin ( tokio02_spawn (
274
276
sender. clone ( ) ,
275
277
params
276
278
. parse ( )
@@ -285,7 +287,7 @@ where
285
287
let sender = task_sender. clone ( ) ;
286
288
handler. add_method ( "subgraph_reassign" , move |params : Params | {
287
289
let me = me. clone ( ) ;
288
- Box :: pin ( block_on (
290
+ Box :: pin ( tokio02_spawn (
289
291
sender. clone ( ) ,
290
292
params
291
293
. parse ( )
0 commit comments