Skip to content

Commit 0efc5e1

Browse files
committed
fix
1 parent 07ad5c4 commit 0efc5e1

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

payments/src/lib.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ pub mod pallet {
7474
weights::WeightInfo,
7575
};
7676
use frame_support::{
77-
dispatch::DispatchResultWithPostInfo, fail, pallet_prelude::*, require_transactional,
78-
storage::bounded_btree_map::BoundedBTreeMap, traits::tokens::BalanceStatus,
77+
dispatch::DispatchResultWithPostInfo,
78+
fail,
79+
pallet_prelude::*,
80+
require_transactional,
81+
storage::bounded_btree_map::BoundedBTreeMap,
82+
traits::{tokens::BalanceStatus, ExistenceRequirement},
7983
};
8084
use frame_system::pallet_prelude::*;
8185
use orml_traits::{MultiCurrency, MultiReservableCurrency};
@@ -634,6 +638,7 @@ pub mod pallet {
634638
from, // fee is paid by payment creator
635639
&fee_recipient, // account of fee recipient
636640
fee_amount, // amount of fee
641+
ExistenceRequirement::AllowDeath,
637642
)?;
638643
}
639644
}
@@ -648,7 +653,13 @@ pub mod pallet {
648653
let amount_to_recipient = recipient_share.mul_floor(payment.amount);
649654
let amount_to_sender = payment.amount.saturating_sub(amount_to_recipient);
650655
// send share to recipient
651-
T::Asset::transfer(payment.asset, to, from, amount_to_sender)?;
656+
T::Asset::transfer(
657+
payment.asset,
658+
to,
659+
from,
660+
amount_to_sender,
661+
ExistenceRequirement::AllowDeath,
662+
)?;
652663

653664
Ok(())
654665
})?;

0 commit comments

Comments
 (0)