Skip to content

Commit

Permalink
bug(pallet-gear): Send message to user keep alive requirement (#3458)
Browse files Browse the repository at this point in the history
  • Loading branch information
breathx authored Oct 31, 2023
1 parent d761a72 commit ca13acc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pallets/gear/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1894,13 +1894,19 @@ pub mod pallet {
.try_into()
.unwrap_or_else(|_| unreachable!("Signal message sent to user"));

let existence_requirement = if keep_alive {
ExistenceRequirement::KeepAlive
} else {
ExistenceRequirement::AllowDeath
};

CurrencyOf::<T>::transfer(
&who,
&<T as frame_system::Config>::AccountId::from_origin(
message.destination().into_origin(),
),
value.unique_saturated_into(),
ExistenceRequirement::AllowDeath,
existence_requirement,
)?;

Pallet::<T>::deposit_event(Event::UserMessageSent {
Expand Down

0 comments on commit ca13acc

Please sign in to comment.