forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2afc09f
commit 8dadc2d
Showing
9 changed files
with
103 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
use crate::ParaId; | ||
use log; | ||
use sp_runtime::{DispatchResult, SaturatedConversion, Saturating, TokenError}; | ||
use xcm::opaque::lts::{Junction::Parachain, Location, XcmContext}; | ||
use xcm::opaque::lts::{Location, XcmContext}; | ||
use xcm_executor::traits::TransactAsset; | ||
const LOG_TARGET: &str = "xcm_fees"; | ||
|
||
/// Burns the fees embedded in the XCM for teleports. | ||
pub fn burn_fees<AssetTransactor, Balance>(para_id: ParaId, fee: Balance) -> DispatchResult | ||
pub fn burn_fees<AssetTransactor, Balance>(dest: Location, fee: Balance) -> DispatchResult | ||
where | ||
AssetTransactor: TransactAsset, | ||
Balance: Saturating + TryInto<u128> + Copy, | ||
{ | ||
let dummy_context = XcmContext { origin: None, message_id: Default::default(), topic: None }; | ||
let dest = Location::new(1, [Parachain(para_id.into())]); | ||
let fees = (Location::parent(), fee.saturated_into::<u128>()).into(); | ||
|
||
// Check if the asset can be checked out | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.