Skip to content

Commit

Permalink
[refactor] hyperledger#4378: Transactional trigger set
Browse files Browse the repository at this point in the history
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
  • Loading branch information
Erigara committed Apr 22, 2024
1 parent 7cec705 commit bbcffc0
Show file tree
Hide file tree
Showing 5 changed files with 575 additions and 374 deletions.
1 change: 1 addition & 0 deletions core/src/smartcontracts/isi/mod.rs
Expand Up @@ -21,6 +21,7 @@ use storage::storage::StorageReadOnly;
use super::Execute;
use crate::{
prelude::*,
smartcontracts::triggers::set::SetReadOnly,
state::{StateReadOnly, StateTransaction, WorldReadOnly},
};

Expand Down
6 changes: 3 additions & 3 deletions core/src/smartcontracts/isi/triggers/mod.rs
Expand Up @@ -96,7 +96,7 @@ pub mod isi {
let trigger_id = self.object_id.clone();

let triggers = &mut state_transaction.world.triggers;
if triggers.remove(&trigger_id) {
if triggers.remove(trigger_id.clone()) {
state_transaction
.world
.emit_events(Some(TriggerEvent::Deleted(self.object_id)));
Expand Down Expand Up @@ -299,15 +299,15 @@ pub mod query {
};

use super::*;
use crate::{prelude::*, state::StateReadOnly};
use crate::{prelude::*, smartcontracts::triggers::set::SetReadOnly, state::StateReadOnly};

impl ValidQuery for FindAllActiveTriggerIds {
#[metrics(+"find_all_active_triggers")]
fn execute<'state>(
&self,
state_ro: &'state impl StateReadOnly,
) -> Result<Box<dyn Iterator<Item = TriggerId> + 'state>, Error> {
Ok(Box::new(state_ro.world().triggers().ids().cloned()))
Ok(Box::new(state_ro.world().triggers().ids_iter().cloned()))
}
}

Expand Down

0 comments on commit bbcffc0

Please sign in to comment.