Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Asset Class Creation Deposits #259

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Update runtime weights [polkadot-fellows/runtimes#223](https://github.com/polkadot-fellows/runtimes/pull/223)
- Treasury Spend detects relative locations of the native asset ([polkadot-fellows/runtimes#233](https://github.com/polkadot-fellows/runtimes/pull/233))
- Increase consumer reference limits for Asset Hubs ([polkadot-fellows/runtimes#258](https://github.com/polkadot-fellows/runtimes/pull/258))
- Updated Asset Hub asset class creation deposit to use `system_para_deposit()` ([polkadot-fellows/runtimes#259](https://github.com/polkadot-fellows/runtimes/pull/259))

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use xcm::prelude::*;

pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall;

use system_parachains_constants::kusama::currency::UNITS;
use system_parachains_constants::kusama::currency::*;

/// `AssetHubKusama` Runtime `Call` enum.
///
Expand Down Expand Up @@ -52,7 +52,7 @@ frame_support::parameter_types! {
pub UncongestedMessage: Xcm<()> = build_congestion_message(false).into();

/// Should match the `AssetDeposit` of the `ForeignAssets` pallet on Asset Hub.
pub const CreateForeignAssetDeposit: u128 = UNITS / 10;
pub const CreateForeignAssetDeposit: u128 = system_para_deposit(1, 190);
}

fn build_congestion_message(is_congested: bool) -> sp_std::vec::Vec<Instruction<()>> {
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl pallet_transaction_payment::Config for Runtime {
}

parameter_types! {
pub const AssetDeposit: Balance = UNITS / 10; // 1 / 10 UNITS deposit to create asset
pub const AssetDeposit: Balance = system_para_deposit(1, 190);
pub const AssetAccountDeposit: Balance = system_para_deposit(1, 16);
pub const AssetsStringLimit: u32 = 50;
/// Key = 32 bytes, Value = 36 bytes (32+1+1+1+1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use xcm::prelude::*;

pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall;

use system_parachains_constants::polkadot::currency::UNITS;
use system_parachains_constants::polkadot::currency::*;

/// `AssetHubPolkadot` Runtime `Call` enum.
///
Expand Down Expand Up @@ -52,7 +52,7 @@ frame_support::parameter_types! {
pub UncongestedMessage: Xcm<()> = build_congestion_message(false).into();

/// Should match the `AssetDeposit` of the `ForeignAssets` pallet on Asset Hub.
pub const CreateForeignAssetDeposit: u128 = 10 * UNITS;
pub const CreateForeignAssetDeposit: u128 = system_para_deposit(1, 190);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

190 is based on the bytes? there should be some way to get that number without hardcoding no?

with max_encoded_len?

Copy link
Contributor Author

@joepetrowski joepetrowski Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the encoded length of AssetDetails in this configuration.

I'm not sure if we can use max_encoded_len here? ( @ggwpez ?) I calculated it by writing a test and asserting encoded_len.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you remove the const it should work.

}

fn build_congestion_message(is_congested: bool) -> sp_std::vec::Vec<Instruction<()>> {
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl pallet_transaction_payment::Config for Runtime {
}

parameter_types! {
pub const AssetDeposit: Balance = 10 * UNITS; // 10 UNITS deposit to create fungible asset class
pub const AssetDeposit: Balance = system_para_deposit(1, 190);
pub const AssetAccountDeposit: Balance = system_para_deposit(1, 16);
pub const AssetsStringLimit: u32 = 50;
/// Key = 32 bytes, Value = 36 bytes (32+1+1+1+1)
Expand Down
Loading