mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 04:07:57 +00:00
Make wildcard storage change subscriptions RPC-unsafe (#11259)
* When an RPC is rejected because it's RPC-unsafe say why in the error message * Make wildcard storage change subscriptions RPC-unsafe * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Fix typo * Fix tests Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -144,7 +144,18 @@ pub trait StateApi<Hash> {
|
||||
id: SubscriptionId,
|
||||
) -> RpcResult<bool>;
|
||||
|
||||
/// New storage subscription
|
||||
/// Subscribe to the changes in the storage.
|
||||
///
|
||||
/// This RPC endpoint has two modes of operation:
|
||||
/// 1) When `keys` is not `None` you'll only be informed about the changes
|
||||
/// done to the specified keys; this is RPC-safe.
|
||||
/// 2) When `keys` is `None` you'll be informed of *all* of the changes;
|
||||
/// **this is RPC-unsafe**.
|
||||
///
|
||||
/// When subscribed to all of the changes this API will emit every storage
|
||||
/// change for every block that is imported. These changes will only be sent
|
||||
/// after a block is imported. If you require a consistent view across all changes
|
||||
/// of every block, you need to take this into account.
|
||||
#[pubsub(subscription = "state_storage", subscribe, name = "state_subscribeStorage")]
|
||||
fn subscribe_storage(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user