Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…r-iroha#3068: Use the auto-generated event sets instead of handwritten matchers

Signed-off-by: Nikita Strygin <[email protected]>
  • Loading branch information
DCNick3 committed Mar 4, 2024
1 parent bb9746d commit 2e8fda3
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 613 deletions.
6 changes: 3 additions & 3 deletions client/tests/integration/triggers/data_trigger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn must_execute_both_triggers() -> Result<()> {
Repeats::Indefinitely,
account_id.clone(),
TriggeringEventFilterBox::Data(DataEventFilter::Account(
AccountEventFilter::new().only_events(AccountEventMatcher::Created),
AccountEventFilter::new().only_events(AccountEventSet::Created),
)),
),
));
Expand All @@ -36,7 +36,7 @@ fn must_execute_both_triggers() -> Result<()> {
Repeats::Indefinitely,
account_id,
TriggeringEventFilterBox::Data(DataEventFilter::Domain(
DomainEventFilter::new().only_events(DomainEventMatcher::Created),
DomainEventFilter::new().only_events(DomainEventSet::Created),
)),
),
));
Expand Down Expand Up @@ -89,7 +89,7 @@ fn domain_scoped_trigger_must_be_executed_only_on_events_in_its_domain() -> Resu
Repeats::Indefinitely,
account_id,
TriggeringEventFilterBox::Data(DataEventFilter::Account(
AccountEventFilter::new().only_events(AccountEventMatcher::Created),
AccountEventFilter::new().only_events(AccountEventSet::Created),
)),
),
));
Expand Down
2 changes: 1 addition & 1 deletion client/tests/integration/triggers/event_trigger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn test_mint_asset_when_new_asset_definition_created() -> Result<()> {
Repeats::Indefinitely,
account_id,
TriggeringEventFilterBox::Data(DataEventFilter::AssetDefinition(
AssetDefinitionEventFilter::new().only_events(AssetDefinitionEventMatcher::Created),
AssetDefinitionEventFilter::new().only_events(AssetDefinitionEventSet::Created),
)),
),
));
Expand Down
20 changes: 11 additions & 9 deletions data_model/src/events/data/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![allow(missing_docs)]

use getset::Getters;
use iroha_data_model_derive::{model, HasOrigin};
use iroha_data_model_derive::{model, EventSet, HasOrigin};

pub use self::model::*;
use super::*;
Expand All @@ -18,6 +18,7 @@ macro_rules! data_event {
PartialOrd,
Ord,
HasOrigin,
EventSet,
parity_scale_codec::Decode,
parity_scale_codec::Encode,
serde::Deserialize,
Expand Down Expand Up @@ -642,18 +643,19 @@ impl DataEvent {

pub mod prelude {
pub use super::{
account::{AccountEvent, AccountPermissionChanged, AccountRoleChanged},
account::{AccountEvent, AccountEventSet, AccountPermissionChanged, AccountRoleChanged},
asset::{
AssetChanged, AssetDefinitionEvent, AssetDefinitionOwnerChanged,
AssetDefinitionTotalQuantityChanged, AssetEvent,
AssetChanged, AssetDefinitionEvent, AssetDefinitionEventSet,
AssetDefinitionOwnerChanged, AssetDefinitionTotalQuantityChanged, AssetEvent,
AssetEventSet,
},
config::ConfigurationEvent,
domain::{DomainEvent, DomainOwnerChanged},
config::{ConfigurationEvent, ConfigurationEventSet},
domain::{DomainEvent, DomainEventSet, DomainOwnerChanged},
executor::{ExecutorEvent, ExecutorFilter},
peer::PeerEvent,
peer::{PeerEvent, PeerEventSet},
permission::PermissionTokenSchemaUpdateEvent,
role::{PermissionRemoved, RoleEvent},
trigger::{TriggerEvent, TriggerNumberOfExecutionsChanged},
role::{PermissionRemoved, RoleEvent, RoleEventSet},
trigger::{TriggerEvent, TriggerEventSet, TriggerNumberOfExecutionsChanged},
DataEvent, HasOrigin, MetadataChanged,
};
}
Loading

0 comments on commit 2e8fda3

Please sign in to comment.