diff --git a/client_cli/src/main.rs b/client_cli/src/main.rs index f17d374cab8..1d06e1c8e5b 100644 --- a/client_cli/src/main.rs +++ b/client_cli/src/main.rs @@ -264,16 +264,16 @@ mod events { impl RunArgs for Args { fn run(self, context: &mut dyn RunContext) -> Result<()> { - let filter = match self { - Args::Pipeline => EventFilterBox::Pipeline(PipelineEventFilter::new()), - Args::Data => EventFilterBox::Data(DataEventFilter::Any), - Args::Notification => EventFilterBox::Notification(NotificationEventFilter::ByAny), - }; - listen(filter, context) + match self { + Args::Pipeline => listen(PipelineEventFilter::new(), context), + Args::Data => listen(DataEventFilter::Any, context), + Args::Notification => listen(NotificationEventFilter::ByAny, context), + } } } - fn listen(filter: EventFilterBox, context: &mut dyn RunContext) -> Result<()> { + fn listen(filter: impl Into, context: &mut dyn RunContext) -> Result<()> { + let filter = filter.into(); let iroha_client = context.client_from_config(); eprintln!("Listening to events with filter: {filter:?}"); iroha_client diff --git a/core/test_network/src/lib.rs b/core/test_network/src/lib.rs index 8b67fe14c53..0b036eff0fe 100644 --- a/core/test_network/src/lib.rs +++ b/core/test_network/src/lib.rs @@ -672,7 +672,7 @@ pub trait TestClient: Sized { fn test_with_account(api_url: &SocketAddr, keys: KeyPair, account_id: &AccountId) -> Self; /// Loop for events with filter and handler function - fn for_each_event(self, event_filter: EventFilterBox, f: impl Fn(Result)); + fn for_each_event(self, event_filter: impl Into, f: impl Fn(Result)); /// Submit instruction with polling /// @@ -811,7 +811,7 @@ impl TestClient for Client { Client::new(config) } - fn for_each_event(self, event_filter: EventFilterBox, f: impl Fn(Result)) { + fn for_each_event(self, event_filter: impl Into, f: impl Fn(Result)) { for event_result in self .listen_for_events(event_filter) .expect("Failed to create event iterator.") diff --git a/tools/parity_scale_decoder/src/main.rs b/tools/parity_scale_decoder/src/main.rs index 57bb09981b6..1aa1bb3b0f1 100644 --- a/tools/parity_scale_decoder/src/main.rs +++ b/tools/parity_scale_decoder/src/main.rs @@ -271,7 +271,7 @@ mod tests { ); let rose_id = AssetId::new(rose_definition_id, account_id.clone()); let trigger_id = "mint_rose".parse().expect("Valid"); - let action = Action::::new( + let action = Action::new( vec![Mint::asset_numeric(1u32, rose_id)], Repeats::Indefinitely, account_id,