Co #10719: Use into_account_truncating (#4947)

* Use into_account_truncating

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* more truncating

* more truncating

* more

* clean up parachain primitives

* more truncating

* update lockfile for {"substrate"}

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Oliver Tale-Yazdi
2022-05-17 23:53:14 +02:00
committed by GitHub
parent 2907a7aeae
commit 157b5186ba
15 changed files with 279 additions and 236 deletions
+7 -7
View File
@@ -687,7 +687,7 @@ impl<T: Config> Pallet<T> {
// Return the deposit of the sender, but only if it is not the para being offboarded.
if !outgoing.contains(&req_id.sender) {
T::Currency::unreserve(
&req_id.sender.into_account(),
&req_id.sender.into_account_truncating(),
req_data.sender_deposit.unique_saturated_into(),
);
}
@@ -700,7 +700,7 @@ impl<T: Config> Pallet<T> {
if req_data.confirmed {
if !outgoing.contains(&req_id.recipient) {
T::Currency::unreserve(
&req_id.recipient.into_account(),
&req_id.recipient.into_account_truncating(),
config.hrmp_recipient_deposit.unique_saturated_into(),
);
}
@@ -817,11 +817,11 @@ impl<T: Config> Pallet<T> {
<Self as Store>::HrmpChannels::take(channel_id)
{
T::Currency::unreserve(
&channel_id.sender.into_account(),
&channel_id.sender.into_account_truncating(),
sender_deposit.unique_saturated_into(),
);
T::Currency::unreserve(
&channel_id.recipient.into_account(),
&channel_id.recipient.into_account_truncating(),
recipient_deposit.unique_saturated_into(),
);
}
@@ -1137,7 +1137,7 @@ impl<T: Config> Pallet<T> {
);
T::Currency::reserve(
&origin.into_account(),
&origin.into_account_truncating(),
config.hrmp_sender_deposit.unique_saturated_into(),
)?;
@@ -1210,7 +1210,7 @@ impl<T: Config> Pallet<T> {
);
T::Currency::reserve(
&origin.into_account(),
&origin.into_account_truncating(),
config.hrmp_recipient_deposit.unique_saturated_into(),
)?;
@@ -1264,7 +1264,7 @@ impl<T: Config> Pallet<T> {
// Unreserve the sender's deposit. The recipient could not have left their deposit because
// we ensured that the request is not confirmed.
T::Currency::unreserve(
&channel_id.sender.into_account(),
&channel_id.sender.into_account_truncating(),
open_channel_req.sender_deposit.unique_saturated_into(),
);