Skip to content

Commit

Permalink
Type events only on message.action
Browse files Browse the repository at this point in the history
  • Loading branch information
zmanian committed May 1, 2020
1 parent 766a86d commit 97f5c9b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tendermint/src/rpc/event_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,14 @@ impl JSONRPC {
/// Extract events from TXEvent if event matches are type query
pub fn extract_events(
&self,
module_query: &str,
action_query: &str,
) -> Result<std::collections::HashMap<String, Vec<String>>, &'static str> {
let events = &self.result.events;
if let Some(message_module) = events.get("message.module"){
if let Some(message_action) = events.get("message.action"){
if message_module.contains(&module_query.to_owned()) && message_action.contains(&action_query.to_owned()) {
if let Some(message_action) = events.get("message.action") {
if message_action.contains(&action_query.to_owned()) {
return Ok(events.clone());
}
}
}

return Err("Incorrect Event Type");

Err("Incorrect Event Type")
}
}

0 comments on commit 97f5c9b

Please sign in to comment.