Skip to content

Commit

Permalink
Upgrade assethub
Browse files Browse the repository at this point in the history
  • Loading branch information
raynaudoe committed Oct 15, 2024
1 parent 503e01a commit af031ad
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 55 deletions.
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ kusama-runtime-constants = { git = "https://github.com/polkadot-fellows/runtimes
bp-bridge-hub-kusama = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.3", package = "bp-bridge-hub-kusama", default-features = false }
bp-bridge-hub-polkadot = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.3", package = "bp-bridge-hub-polkadot", default-features = false }
bp-asset-hub-kusama = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.3", package = "bp-asset-hub-kusama", default-features = false }
collectives-polkadot-runtime-constants = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.3", package = "collectives-polkadot-runtime-constants", default-features = false }


# Local dependencies

Expand Down
2 changes: 1 addition & 1 deletion system-parachains/asset-hub-paseo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bp-bridge-hub-paseo = { workspace = true }
bp-bridge-hub-kusama = { workspace = true }
bp-bridge-hub-polkadot = { workspace = true }
paseo-runtime-constants = { workspace = true }

collectives-polkadot-runtime-constants = { workspace = true }

# Substrate
frame-benchmarking = { optional = true, workspace = true }
Expand Down
21 changes: 18 additions & 3 deletions system-parachains/asset-hub-paseo/src/genesis_config_presets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,22 @@
//! Genesis configs presets for the AssetHubPolkadot runtime
use crate::*;
use AuraId;
use sp_std::vec::Vec;
use sp_genesis_builder::PresetId;
use sp_core::sr25519;
use system_parachains_constants::genesis_presets::*;
use AuraId;

const ASSET_HUB_PASEO_ED: Balance = ExistentialDeposit::get();

/// Invulnerable Collators for the particular case of AssetHubPaseo
pub fn invulnerables_asset_hub_paseo() -> Vec<(AccountId, AuraId)> {
vec![
(get_account_id_from_seed::<sr25519::Public>("Alice"), get_from_seed::<AuraId>("Alice")),
(get_account_id_from_seed::<sr25519::Public>("Bob"), get_from_seed::<AuraId>("Bob")),
]
}

fn asset_hub_paseo_genesis(
invulnerables: Vec<(AccountId, AuraId)>,
endowed_accounts: Vec<AccountId>,
Expand Down Expand Up @@ -66,11 +76,16 @@ fn asset_hub_paseo_genesis(
}

pub fn asset_hub_paseo_local_testnet_genesis(para_id: ParaId) -> serde_json::Value {
asset_hub_paseo_genesis(invulnerables(), testnet_accounts(), para_id)
asset_hub_paseo_genesis(invulnerables_asset_hub_paseo(), testnet_accounts(), para_id)
}

fn asset_hub_paseo_development_genesis(para_id: ParaId) -> serde_json::Value {
asset_hub_paseo_genesis(invulnerables_tot(), testnet_accounts(), para_id)
asset_hub_paseo_local_testnet_genesis(para_id)
}

/// Provides the names of the predefined genesis configs for this runtime.
pub fn preset_names() -> Vec<PresetId> {
vec![PresetId::from("development"), PresetId::from("local_testnet")]
}

/// Provides the JSON representation of predefined genesis config for given `id`.
Expand Down
19 changes: 9 additions & 10 deletions system-parachains/asset-hub-paseo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ use frame_system::{
};
use pallet_nfts::PalletFeatures;
use parachains_common::{
message_queue::*, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, Hash,
Header, Nonce, Signature,
message_queue::*, AccountId, AssetIdForTrustBackedAssets, AuraId,
Balance, BlockNumber, Hash, Header, Nonce, Signature,
};

use sp_runtime::RuntimeDebug;
Expand Down Expand Up @@ -152,7 +152,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("asset-hub-paseo"),
impl_name: create_runtime_str!("asset-hub-paseo"),
authoring_version: 1,
spec_version: 1_003_000,
spec_version: 1_003_003,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 15,
Expand Down Expand Up @@ -488,8 +488,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Assets { .. } |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. } |
RuntimeCall::Nfts { .. } |
RuntimeCall::Uniques { .. }
RuntimeCall::Nfts { .. } | RuntimeCall::Uniques { .. }
)
},
ProxyType::AssetOwner => matches!(
Expand Down Expand Up @@ -1338,10 +1337,7 @@ impl_runtime_apis! {
}

fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
vec![
sp_genesis_builder::PresetId::from("local_testnet"),
sp_genesis_builder::PresetId::from("development"),
]
genesis_config_presets::preset_names()
}
}

Expand Down Expand Up @@ -1617,7 +1613,10 @@ impl_runtime_apis! {
pub TrustedReserve: Option<(Location, Asset)> = Some(
(
xcm_config::bridging::to_kusama::AssetHubKusama::get(),
Asset::from((xcm_config::bridging::to_kusama::KsmLocation::get(), 1000000000000 as u128))
Asset::from((
xcm_config::bridging::to_kusama::KsmLocation::get(),
1000000000000 as u128
))
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(5))
}
/// Storage: `Benchmark::Override` (r:0 w:0)
/// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
pub(crate) fn reserve_asset_deposited() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
Expand Down
Loading

0 comments on commit af031ad

Please sign in to comment.