mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 00:28:01 +00:00
Make chain && state RPCs async (#3480)
* chain+state RPCs are async now * wrapped too long lines * create full/light RPC impls from service * use ordering * post-merge fix
This commit is contained in:
committed by
Gavin Wood
parent
816e132cd7
commit
607ee0a4e4
@@ -22,7 +22,7 @@ use std::{
|
||||
};
|
||||
|
||||
use fnv::{FnvHashSet, FnvHashMap};
|
||||
use futures::channel::mpsc;
|
||||
use futures03::channel::mpsc;
|
||||
use primitives::storage::{StorageKey, StorageData};
|
||||
use sr_primitives::traits::Block as BlockT;
|
||||
|
||||
@@ -347,7 +347,7 @@ mod tests {
|
||||
// given
|
||||
let mut notifications = StorageNotifications::<Block>::default();
|
||||
let child_filter = [(StorageKey(vec![4]), None)];
|
||||
let mut recv = futures::executor::block_on_stream(
|
||||
let mut recv = futures03::executor::block_on_stream(
|
||||
notifications.listen(None, Some(&child_filter[..]))
|
||||
);
|
||||
|
||||
@@ -382,13 +382,13 @@ mod tests {
|
||||
// given
|
||||
let mut notifications = StorageNotifications::<Block>::default();
|
||||
let child_filter = [(StorageKey(vec![4]), Some(vec![StorageKey(vec![5])]))];
|
||||
let mut recv1 = futures::executor::block_on_stream(
|
||||
let mut recv1 = futures03::executor::block_on_stream(
|
||||
notifications.listen(Some(&[StorageKey(vec![1])]), None)
|
||||
);
|
||||
let mut recv2 = futures::executor::block_on_stream(
|
||||
let mut recv2 = futures03::executor::block_on_stream(
|
||||
notifications.listen(Some(&[StorageKey(vec![2])]), None)
|
||||
);
|
||||
let mut recv3 = futures::executor::block_on_stream(
|
||||
let mut recv3 = futures03::executor::block_on_stream(
|
||||
notifications.listen(Some(&[]), Some(&child_filter))
|
||||
);
|
||||
|
||||
@@ -429,16 +429,16 @@ mod tests {
|
||||
let mut notifications = StorageNotifications::<Block>::default();
|
||||
{
|
||||
let child_filter = [(StorageKey(vec![4]), Some(vec![StorageKey(vec![5])]))];
|
||||
let _recv1 = futures::executor::block_on_stream(
|
||||
let _recv1 = futures03::executor::block_on_stream(
|
||||
notifications.listen(Some(&[StorageKey(vec![1])]), None)
|
||||
);
|
||||
let _recv2 = futures::executor::block_on_stream(
|
||||
let _recv2 = futures03::executor::block_on_stream(
|
||||
notifications.listen(Some(&[StorageKey(vec![2])]), None)
|
||||
);
|
||||
let _recv3 = futures::executor::block_on_stream(
|
||||
let _recv3 = futures03::executor::block_on_stream(
|
||||
notifications.listen(None, None)
|
||||
);
|
||||
let _recv4 = futures::executor::block_on_stream(
|
||||
let _recv4 = futures03::executor::block_on_stream(
|
||||
notifications.listen(None, Some(&child_filter))
|
||||
);
|
||||
assert_eq!(notifications.listeners.len(), 2);
|
||||
@@ -465,7 +465,7 @@ mod tests {
|
||||
// given
|
||||
let mut recv = {
|
||||
let mut notifications = StorageNotifications::<Block>::default();
|
||||
let recv = futures::executor::block_on_stream(notifications.listen(None, None));
|
||||
let recv = futures03::executor::block_on_stream(notifications.listen(None, None));
|
||||
|
||||
// when
|
||||
let changeset = vec![];
|
||||
|
||||
Reference in New Issue
Block a user