diff --git a/templates/parachain/pallets/xcnft/src/lib.rs b/templates/parachain/pallets/xcnft/src/lib.rs index d5f79a0da85b..863fc09f6a19 100644 --- a/templates/parachain/pallets/xcnft/src/lib.rs +++ b/templates/parachain/pallets/xcnft/src/lib.rs @@ -639,7 +639,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_collection_empty { origin_collection: origin_collection.clone(), @@ -812,7 +811,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_collection_same_owner { origin_collection_id: origin_collection.clone(), @@ -1137,7 +1135,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_collection_diff_owners { config, @@ -1296,7 +1293,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_nft_transfer { origin_collection: origin_collection.clone(), @@ -1568,7 +1564,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::Native, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_collection_metadata { collection: destination_collection_id.clone(), @@ -1640,7 +1635,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_nft_metadata { collection: destination_collection_id.clone(), @@ -1714,7 +1708,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from(Call::parse_collection_burn { collection_to_burn: destination_collection_id.clone(), witness_data: witnes_data.clone(), @@ -1783,7 +1776,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from(Call::::parse_nft_burn { collection: destination_collection_id.clone(), item: destination_asset_id.clone(), @@ -1854,7 +1846,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_collection_owner { new_owner: destination_account.clone(), @@ -1925,7 +1916,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from(Call::::parse_nft_owner { new_owner: destination_account.clone(), collection: destination_collection_id.clone(), diff --git a/templates/parachain_two/pallets/xcnft/src/lib.rs b/templates/parachain_two/pallets/xcnft/src/lib.rs index 071b4c5328cb..dba2bb05a5ea 100644 --- a/templates/parachain_two/pallets/xcnft/src/lib.rs +++ b/templates/parachain_two/pallets/xcnft/src/lib.rs @@ -778,7 +778,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_collection_empty { origin_collection: origin_collection.clone(), @@ -959,7 +958,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_collection_same_owner { origin_collection_id: origin_collection.clone(), @@ -1287,7 +1285,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_collection_diff_owners { origin_collection_id: proposal.collection_id.clone(), @@ -1453,7 +1450,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_nft_transfer { origin_collection: origin_collection.clone(), @@ -1728,7 +1724,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::Native, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_collection_metadata { collection: destination_collection_id.clone(), @@ -1800,7 +1795,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_nft_metadata { collection: destination_collection_id.clone(), @@ -1874,7 +1868,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from(Call::parse_collection_burn { collection_to_burn: destination_collection_id.clone(), witness_data: witnes_data.clone(), @@ -1943,7 +1936,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from(Call::::parse_nft_burn { collection: destination_collection_id.clone(), item: destination_asset_id.clone(), @@ -2014,7 +2006,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from( Call::::parse_collection_owner { new_owner: destination_account.clone(), @@ -2085,7 +2076,6 @@ pub mod pallet { ), Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_parts(1_000_000_000, 64 * 1024), call: >::RuntimeCall::from(Call::::parse_nft_owner { new_owner: destination_account.clone(), collection: destination_collection_id.clone(), diff --git a/templates/parachain_two/runtime/src/genesis_config_presets.rs b/templates/parachain_two/runtime/src/genesis_config_presets.rs index 88f0d71cf98f..744c85083260 100644 --- a/templates/parachain_two/runtime/src/genesis_config_presets.rs +++ b/templates/parachain_two/runtime/src/genesis_config_presets.rs @@ -15,6 +15,8 @@ use sp_keyring::Sr25519Keyring; /// The default XCM version to set in genesis config. const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; +/// Parachain id used for gensis config presets of parachain template. +const PARACHAIN_ID: u32 = 1000; /// Generate the session keys from individual elements. /// @@ -76,9 +78,7 @@ fn local_testnet_genesis() -> Value { ], Sr25519Keyring::well_known().map(|k| k.to_account_id()).collect(), Sr25519Keyring::Alice.to_account_id(), - // TODO: this is super opaque, how should one know they should configure this? add to - // README! - 1000.into(), + PARACHAIN_ID.into(), ) } @@ -91,15 +91,15 @@ fn development_config_genesis() -> Value { ], Sr25519Keyring::well_known().map(|k| k.to_account_id()).collect(), Sr25519Keyring::Alice.to_account_id(), - 1000.into(), + PARACHAIN_ID.into(), ) } /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &PresetId) -> Option> { - let patch = match id.try_into() { - Ok(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET) => local_testnet_genesis(), - Ok(sp_genesis_builder::DEV_RUNTIME_PRESET) => development_config_genesis(), + let patch = match id.as_ref() { + sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET => local_testnet_genesis(), + sp_genesis_builder::DEV_RUNTIME_PRESET => development_config_genesis(), _ => return None, }; Some(