forked from polkadot-fellows/runtimes
-
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.
Treasury Pallet Account as destination for XCM fees on System Paracha…
…ins (polkadot-fellows#191) Designates the Treasury Pallet Account as the destination for XCM fees on System Parachains. This ensures that assets accumulated in the pallet's account can be spent by Treasury Origins from Relay Chains. --------- Co-authored-by: Sergej Sakac <[email protected]>
- Loading branch information
Showing
10 changed files
with
115 additions
and
18 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
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 |
---|---|---|
|
@@ -23,7 +23,10 @@ use bridge_hub_kusama_runtime::{ | |
RequiredStakeForStakeAndSlash, WithBridgeHubPolkadotMessageBridge, | ||
WithBridgeHubPolkadotMessagesInstance, XCM_LANE_FOR_ASSET_HUB_KUSAMA_TO_ASSET_HUB_POLKADOT, | ||
}, | ||
xcm_config::{KsmRelayLocation, RelayNetwork, XcmConfig}, | ||
xcm_config::{ | ||
KsmRelayLocation, LocationToAccountId, RelayNetwork, RelayTreasuryLocation, | ||
RelayTreasuryPalletAccount, XcmConfig, | ||
}, | ||
AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages, Executive, ExistentialDeposit, | ||
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, SessionKeys, | ||
SignedExtra, TransactionPayment, UncheckedExtrinsic, SLOT_DURATION, | ||
|
@@ -42,6 +45,7 @@ use system_parachains_constants::kusama::{ | |
consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, fee::WeightToFee, | ||
}; | ||
use xcm::latest::prelude::*; | ||
use xcm_executor::traits::ConvertLocation; | ||
|
||
// Para id of sibling chain used in tests. | ||
pub const SIBLING_PARACHAIN_ID: u32 = 1000; | ||
|
@@ -360,6 +364,14 @@ pub fn can_calculate_fee_for_complex_message_confirmation_transaction() { | |
) | ||
} | ||
|
||
#[test] | ||
fn treasury_pallet_account_not_none() { | ||
assert_eq!( | ||
RelayTreasuryPalletAccount::get(), | ||
LocationToAccountId::convert_location(&RelayTreasuryLocation::get()).unwrap() | ||
) | ||
} | ||
|
||
use sp_runtime::Perbill; | ||
|
||
// TODO:(PR#159): remove when `[email protected]` bump (https://github.com/polkadot-fellows/runtimes/issues/186) | ||
|
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 |
---|---|---|
|
@@ -24,7 +24,10 @@ use bridge_hub_polkadot_runtime::{ | |
WithBridgeHubKusamaMessageBridge, WithBridgeHubKusamaMessagesInstance, | ||
XCM_LANE_FOR_ASSET_HUB_POLKADOT_TO_ASSET_HUB_KUSAMA, | ||
}, | ||
xcm_config::{DotRelayLocation, RelayNetwork, XcmConfig}, | ||
xcm_config::{ | ||
DotRelayLocation, LocationToAccountId, RelayNetwork, RelayTreasuryLocation, | ||
RelayTreasuryPalletAccount, XcmConfig, | ||
}, | ||
AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages, Executive, ExistentialDeposit, | ||
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, SessionKeys, | ||
SignedExtra, TransactionPayment, UncheckedExtrinsic, SLOT_DURATION, | ||
|
@@ -43,6 +46,7 @@ use system_parachains_constants::polkadot::{ | |
consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, fee::WeightToFee, | ||
}; | ||
use xcm::latest::prelude::*; | ||
use xcm_executor::traits::ConvertLocation; | ||
|
||
// Para id of sibling chain used in tests. | ||
pub const SIBLING_PARACHAIN_ID: u32 = 1000; | ||
|
@@ -361,6 +365,14 @@ pub fn can_calculate_fee_for_complex_message_confirmation_transaction() { | |
) | ||
} | ||
|
||
#[test] | ||
fn treasury_pallet_account_not_none() { | ||
assert_eq!( | ||
RelayTreasuryPalletAccount::get(), | ||
LocationToAccountId::convert_location(&RelayTreasuryLocation::get()).unwrap() | ||
) | ||
} | ||
|
||
// TODO:(PR#159): remove when `[email protected]` bump (https://github.com/polkadot-fellows/runtimes/issues/186) | ||
/// A helper function for comparing the actual value of a fee constant with its estimated value. The | ||
/// estimated value can be overestimated (`overestimate_in_percent`), and if the difference to the | ||
|
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