mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 12:35:42 +00:00
chainHead: Sync events with spec (#14654)
* chainHead/events: Remove network config Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * chainHead/events: Add events for operations Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * chainHead/tests: Test chainHead events serialize/deserialize Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * chainHead/events: Remove generics from the storage event Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * chainHead/events: Rename kebab-case to camelCase Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * chainHead/events: Add methodResponse object Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -23,7 +23,7 @@ use crate::{
|
||||
api::ChainHeadApiServer,
|
||||
chain_head_follow::ChainHeadFollower,
|
||||
error::Error as ChainHeadRpcError,
|
||||
event::{ChainHeadEvent, ChainHeadResult, ErrorEvent, FollowEvent, NetworkConfig},
|
||||
event::{ChainHeadEvent, ChainHeadResult, ErrorEvent, FollowEvent},
|
||||
hex_string,
|
||||
subscription::{SubscriptionManagement, SubscriptionManagementError},
|
||||
},
|
||||
@@ -205,7 +205,6 @@ where
|
||||
mut sink: SubscriptionSink,
|
||||
follow_subscription: String,
|
||||
hash: Block::Hash,
|
||||
_network_config: Option<NetworkConfig>,
|
||||
) -> SubscriptionResult {
|
||||
let client = self.client.clone();
|
||||
let subscriptions = self.subscriptions.clone();
|
||||
@@ -294,7 +293,6 @@ where
|
||||
hash: Block::Hash,
|
||||
items: Vec<StorageQuery<String>>,
|
||||
child_trie: Option<String>,
|
||||
_network_config: Option<NetworkConfig>,
|
||||
) -> SubscriptionResult {
|
||||
// Gain control over parameter parsing and returned error.
|
||||
let items = items
|
||||
@@ -327,7 +325,7 @@ where
|
||||
Ok(block) => block,
|
||||
Err(SubscriptionManagementError::SubscriptionAbsent) => {
|
||||
// Invalid invalid subscription ID.
|
||||
let _ = sink.send(&ChainHeadStorageEvent::<String>::Disjoint);
|
||||
let _ = sink.send(&ChainHeadStorageEvent::Disjoint);
|
||||
return Ok(())
|
||||
},
|
||||
Err(SubscriptionManagementError::BlockHashAbsent) => {
|
||||
@@ -336,9 +334,8 @@ where
|
||||
return Ok(())
|
||||
},
|
||||
Err(error) => {
|
||||
let _ = sink.send(&ChainHeadStorageEvent::<String>::Error(ErrorEvent {
|
||||
error: error.to_string(),
|
||||
}));
|
||||
let _ = sink
|
||||
.send(&ChainHeadStorageEvent::Error(ErrorEvent { error: error.to_string() }));
|
||||
return Ok(())
|
||||
},
|
||||
};
|
||||
@@ -362,7 +359,6 @@ where
|
||||
hash: Block::Hash,
|
||||
function: String,
|
||||
call_parameters: String,
|
||||
_network_config: Option<NetworkConfig>,
|
||||
) -> SubscriptionResult {
|
||||
let call_parameters = Bytes::from(parse_hex_param(&mut sink, call_parameters)?);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user