Skip to content

Commit

Permalink
Remove weights from transact
Browse files Browse the repository at this point in the history
  • Loading branch information
dudo50 committed Nov 7, 2024
1 parent 87125ff commit c62bfe1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
10 changes: 0 additions & 10 deletions templates/parachain/pallets/xcnft/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_collection_empty {
origin_collection: origin_collection.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_collection_same_owner {
origin_collection_id: origin_collection.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_collection_diff_owners {
config,
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_nft_transfer {
origin_collection: origin_collection.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_collection_metadata {
collection: destination_collection_id.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_nft_metadata {
collection: destination_collection_id.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(Call::parse_collection_burn {
collection_to_burn: destination_collection_id.clone(),
witness_data: witnes_data.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(Call::<T, I>::parse_nft_burn {
collection: destination_collection_id.clone(),
item: destination_asset_id.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_collection_owner {
new_owner: destination_account.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(Call::<T, I>::parse_nft_owner {
new_owner: destination_account.clone(),
collection: destination_collection_id.clone(),
Expand Down
10 changes: 0 additions & 10 deletions templates/parachain_two/pallets/xcnft/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_collection_empty {
origin_collection: origin_collection.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_collection_same_owner {
origin_collection_id: origin_collection.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_collection_diff_owners {
origin_collection_id: proposal.collection_id.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_nft_transfer {
origin_collection: origin_collection.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_collection_metadata {
collection: destination_collection_id.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_nft_metadata {
collection: destination_collection_id.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(Call::parse_collection_burn {
collection_to_burn: destination_collection_id.clone(),
witness_data: witnes_data.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(Call::<T, I>::parse_nft_burn {
collection: destination_collection_id.clone(),
item: destination_asset_id.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(
Call::<T, I>::parse_collection_owner {
new_owner: destination_account.clone(),
Expand Down Expand Up @@ -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: <T as Config<I>>::RuntimeCall::from(Call::<T, I>::parse_nft_owner {
new_owner: destination_account.clone(),
collection: destination_collection_id.clone(),
Expand Down
14 changes: 7 additions & 7 deletions templates/parachain_two/runtime/src/genesis_config_presets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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(),
)
}

Expand All @@ -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<vec::Vec<u8>> {
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(
Expand Down

0 comments on commit c62bfe1

Please sign in to comment.