Skip to content

Commit

Permalink
Add InstructionMediators event (#1610)
Browse files Browse the repository at this point in the history
  • Loading branch information
HenriqueNogara committed Feb 26, 2024
1 parent eec088c commit 3944dd4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pallets/common/src/traits/settlement.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use frame_support::decl_event;
use frame_support::dispatch::DispatchError;
use frame_support::weights::Weight;
use sp_std::collections::btree_set::BTreeSet;
use sp_std::vec::Vec;

use polymesh_primitives::settlement::{
Expand Down Expand Up @@ -83,6 +84,9 @@ decl_event!(
/// An instruction affirmation has been withdrawn by a mediator.
/// Parameters: [`IdentityId`] of the mediator and [`InstructionId`] of the instruction.
MediatorAffirmationWithdrawn(IdentityId, InstructionId),
/// An instruction with mediators has been created.
/// Parameters: [`InstructionId`] of the instruction and the [`IdentityId`] of all mediators.
InstructionMediators(InstructionId, BTreeSet<IdentityId>),
}
);

Expand Down
8 changes: 8 additions & 0 deletions pallets/settlement/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,14 @@ impl<T: Config> Module<T> {
legs,
memo,
));

if !instruction_info.mediators().is_empty() {
Self::deposit_event(RawEvent::InstructionMediators(
instruction_id,
instruction_info.mediators().clone(),
));
}

Ok(instruction_id)
}

Expand Down

0 comments on commit 3944dd4

Please sign in to comment.