mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
rpc: Expose the subscription ID for RpcClientT (#733)
* rpc: Extend `RpcClientT` to return the subscription ID Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * rpc: Return `RpcSubscriptionId` for jsonrpsee clients Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * rpc: Expose subscription ID via subxt subscription Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Adjust example to return subscription ID Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * rpc: Add structure for subscription stream and subscription id Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -68,7 +68,8 @@ impl RpcClientT for MyLoggingClient {
|
||||
let res = RawValue::from_string("[]".to_string()).unwrap();
|
||||
let stream = futures::stream::once(async move { Ok(res) });
|
||||
let stream: Pin<Box<dyn futures::Stream<Item = _> + Send>> = Box::pin(stream);
|
||||
Box::pin(std::future::ready(Ok(stream)))
|
||||
// This subscription does not provide an ID.
|
||||
Box::pin(std::future::ready(Ok(RpcSubscription { stream, id: None })))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user