mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +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:
@@ -332,7 +332,15 @@ where
|
||||
subscriber: Subscriber<StorageChangeSet<Block::Hash>>,
|
||||
keys: Option<Vec<StorageKey>>,
|
||||
) {
|
||||
self.backend.subscribe_storage(meta, subscriber, keys);
|
||||
if keys.is_none() {
|
||||
if let Err(err) = self.deny_unsafe.check_if_safe() {
|
||||
subscriber.reject(err.into())
|
||||
.expect("subscription rejection can only fail if it's been already rejected, and we're rejecting it for the first time; qed");
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
self.backend.subscribe_storage(meta, subscriber, keys)
|
||||
}
|
||||
|
||||
fn unsubscribe_storage(
|
||||
|
||||
Reference in New Issue
Block a user