From a8336a40e4fe65e8d6f907002f7ef69e1885e9d4 Mon Sep 17 00:00:00 2001 From: nanocryk <6422796+nanocryk@users.noreply.github.com> Date: Thu, 23 May 2024 18:41:16 +0200 Subject: [PATCH] Data Preservers Profiles (#551) * profiles storage and extrinsics * wip tests * forced mode + tests * separate extrinsics for forced * benchmarks * real benchmarks * typescript api * fix bench test * fmt * typescript apis * wip ts tests * T::ProfileId + support for blacklists * fix bench --- .../nodes/frontier/src/rpc/finality.rs | 14 +- .../nodes/frontier/src/rpc/mod.rs | 2 +- .../frontier/src/xcm_config.rs | 12 +- .../simple/src/xcm_config.rs | 10 +- pallets/data-preservers/src/benchmarks.rs | 233 ++++++- pallets/data-preservers/src/lib.rs | 405 +++++++++++- pallets/data-preservers/src/mock.rs | 52 +- pallets/data-preservers/src/tests.rs | 604 +++++++++++++++++- pallets/data-preservers/src/weights.rs | 237 ++++++- pallets/xcm-core-buyer/src/benchmarks.rs | 14 +- pallets/xcm-core-buyer/src/lib.rs | 9 +- pallets/xcm-core-buyer/src/mock.rs | 9 +- pallets/xcm-core-buyer/src/tests.rs | 3 +- runtime/common/src/benchmarking.rs | 6 +- runtime/dancebox/src/lib.rs | 19 +- .../src/weights/pallet_data_preservers.rs | 124 +++- runtime/dancebox/src/xcm_config.rs | 11 +- .../dancebox/tests/common/xcm/core_buyer.rs | 24 +- .../tests/common/xcm/delivery_fees.rs | 21 +- .../xcm/foreign_signed_based_sovereign.rs | 17 +- .../tests/common/xcm/foreign_sovereigns.rs | 17 +- .../xcm/reserver_transfers_polkadot_xcm.rs | 18 +- ...derivative_reception_container_dancebox.rs | 15 +- ...e_reception_dancebox_frontier_container.rs | 14 +- ...ive_reception_dancebox_simple_container.rs | 15 +- ...ken_derivative_reception_relay_dancebox.rs | 14 +- ...tive_reception_relay_frontier_container.rs | 15 +- ...vative_reception_relay_simple_container.rs | 14 +- runtime/dancebox/tests/common/xcm/transact.rs | 12 +- runtime/dancebox/tests/common/xcm/trap.rs | 8 +- runtime/flashbox/src/lib.rs | 20 +- .../src/weights/pallet_data_preservers.rs | 118 +++- .../test_pallet_data_preservers.ts | 242 +++++++ .../dancebox/interfaces/augment-api-consts.ts | 1 + .../dancebox/interfaces/augment-api-errors.ts | 2 + .../dancebox/interfaces/augment-api-events.ts | 15 + .../dancebox/interfaces/augment-api-query.ts | 8 + .../src/dancebox/interfaces/augment-api-tx.ts | 58 ++ .../src/dancebox/interfaces/lookup.ts | 314 +++++---- .../src/dancebox/interfaces/registry.ts | 10 + .../src/dancebox/interfaces/types-lookup.ts | 345 ++++++---- .../flashbox/interfaces/augment-api-consts.ts | 1 + .../flashbox/interfaces/augment-api-errors.ts | 2 + .../flashbox/interfaces/augment-api-events.ts | 15 + .../flashbox/interfaces/augment-api-query.ts | 8 + .../src/flashbox/interfaces/augment-api-tx.ts | 58 ++ .../src/flashbox/interfaces/lookup.ts | 215 +++++-- .../src/flashbox/interfaces/registry.ts | 10 + .../src/flashbox/interfaces/types-lookup.ts | 233 +++++-- 49 files changed, 3071 insertions(+), 572 deletions(-) create mode 100644 test/suites/common-tanssi/pallet-data-preservers/test_pallet_data_preservers.ts diff --git a/container-chains/nodes/frontier/src/rpc/finality.rs b/container-chains/nodes/frontier/src/rpc/finality.rs index 65a2717af..ad7980a2c 100644 --- a/container-chains/nodes/frontier/src/rpc/finality.rs +++ b/container-chains/nodes/frontier/src/rpc/finality.rs @@ -14,12 +14,14 @@ // You should have received a copy of the GNU General Public License // along with Tanssi. If not, see . -use fc_rpc::frontier_backend_client::{self, is_canon}; -use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use sp_blockchain::HeaderBackend; -use sp_core::H256; -use sp_runtime::traits::Block; -use std::{marker::PhantomData, sync::Arc}; +use { + fc_rpc::frontier_backend_client::{self, is_canon}, + jsonrpsee::{core::RpcResult, proc_macros::rpc}, + sp_blockchain::HeaderBackend, + sp_core::H256, + sp_runtime::traits::Block, + std::{marker::PhantomData, sync::Arc}, +}; #[rpc(server)] #[async_trait::async_trait] diff --git a/container-chains/nodes/frontier/src/rpc/mod.rs b/container-chains/nodes/frontier/src/rpc/mod.rs index add27065c..1ca53d197 100644 --- a/container-chains/nodes/frontier/src/rpc/mod.rs +++ b/container-chains/nodes/frontier/src/rpc/mod.rs @@ -133,12 +133,12 @@ where C::Api: RuntimeApiCollection, P: TransactionPool + 'static, { - use finality::{FrontierFinality, FrontierFinalityApiServer}; use { fc_rpc::{ Eth, EthApiServer, EthFilter, EthFilterApiServer, EthPubSub, EthPubSubApiServer, Net, NetApiServer, Web3, Web3ApiServer, }, + finality::{FrontierFinality, FrontierFinalityApiServer}, substrate_frame_rpc_system::{System, SystemApiServer}, }; diff --git a/container-chains/runtime-templates/frontier/src/xcm_config.rs b/container-chains/runtime-templates/frontier/src/xcm_config.rs index 41639fb94..1b5a3087e 100644 --- a/container-chains/runtime-templates/frontier/src/xcm_config.rs +++ b/container-chains/runtime-templates/frontier/src/xcm_config.rs @@ -16,11 +16,13 @@ use { super::{ - currency::MICROUNIT, precompiles::FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, weights, - weights::xcm::XcmWeight as XcmGenericWeights, AccountId, AllPalletsWithSystem, AssetRate, - Balance, Balances, ForeignAssetsCreator, MaintenanceMode, MessageQueue, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, RuntimeBlockWeights, RuntimeCall, RuntimeEvent, - RuntimeOrigin, TransactionByteFee, WeightToFee, XcmpQueue, + currency::MICROUNIT, + precompiles::FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, + weights::{self, xcm::XcmWeight as XcmGenericWeights}, + AccountId, AllPalletsWithSystem, AssetRate, Balance, Balances, ForeignAssetsCreator, + MaintenanceMode, MessageQueue, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, + RuntimeBlockWeights, RuntimeCall, RuntimeEvent, RuntimeOrigin, TransactionByteFee, + WeightToFee, XcmpQueue, }, ccp_xcm::SignedToAccountKey20, cumulus_primitives_core::{AggregateMessageOrigin, ParaId}, diff --git a/container-chains/runtime-templates/simple/src/xcm_config.rs b/container-chains/runtime-templates/simple/src/xcm_config.rs index 909801e4a..54558d34e 100644 --- a/container-chains/runtime-templates/simple/src/xcm_config.rs +++ b/container-chains/runtime-templates/simple/src/xcm_config.rs @@ -16,10 +16,12 @@ use { super::{ - currency::MICROUNIT, weights, weights::xcm::XcmWeight as XcmGenericWeights, AccountId, - AllPalletsWithSystem, AssetRate, Balance, Balances, ForeignAssetsCreator, MaintenanceMode, - MessageQueue, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeBlockWeights, - RuntimeCall, RuntimeEvent, RuntimeOrigin, TransactionByteFee, WeightToFee, XcmpQueue, + currency::MICROUNIT, + weights::{self, xcm::XcmWeight as XcmGenericWeights}, + AccountId, AllPalletsWithSystem, AssetRate, Balance, Balances, ForeignAssetsCreator, + MaintenanceMode, MessageQueue, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, + RuntimeBlockWeights, RuntimeCall, RuntimeEvent, RuntimeOrigin, TransactionByteFee, + WeightToFee, XcmpQueue, }, cumulus_primitives_core::{AggregateMessageOrigin, ParaId}, frame_support::{ diff --git a/pallets/data-preservers/src/benchmarks.rs b/pallets/data-preservers/src/benchmarks.rs index 6a07dd3b1..867013c26 100644 --- a/pallets/data-preservers/src/benchmarks.rs +++ b/pallets/data-preservers/src/benchmarks.rs @@ -18,18 +18,39 @@ //! Benchmarking use { - crate::{Call, Config, Pallet}, + crate::{ + Call, Config, Pallet, ParaIdsFilter, Profile, ProfileDeposit, ProfileMode, Profiles, + RegisteredProfile, + }, frame_benchmarking::v2::*, frame_support::{ - traits::{EnsureOriginWithArg, OriginTrait}, + traits::{ + fungible::{Inspect, Mutate}, + EnsureOrigin, EnsureOriginWithArg, OriginTrait, + }, BoundedVec, }, frame_system::RawOrigin, + sp_runtime::traits::Zero, sp_std::vec, tp_traits::ParaId, }; -#[benchmarks] +const SEED: u32 = 0; + +fn create_funded_user(string: &'static str, n: u32, balance_factor: u32) -> T::AccountId +where + T::Currency: Mutate, +{ + let user = account(string, n, SEED); + let balance = ::minimum_balance() * balance_factor.into(); + let _ = ::set_balance(&user, balance); + user +} + +#[benchmarks( + where T::Currency: Mutate, T::ProfileId: Zero +)] mod benchmarks { use super::*; @@ -55,5 +76,209 @@ mod benchmarks { assert_eq!(Pallet::::boot_nodes(para_id), boot_nodes); } - impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); + #[benchmark] + fn create_profile(x: Linear<1, 200>, y: Linear<1, 10>) { + // x: url len, y: para ids len + let url = BoundedVec::try_from(vec![b'A'; x as usize]).unwrap(); + let para_ids = BoundedVec::try_from(vec![ParaId::from(42); y as usize]).unwrap(); + + let profile = Profile { + url, + para_ids: ParaIdsFilter::Whitelist(para_ids), + mode: ProfileMode::Bootnode, + }; + + let deposit = T::ProfileDeposit::profile_deposit(&profile).expect("deposit to be computed"); + + let caller = create_funded_user::("caller", 1, 1_000_000_000u32); + + #[extrinsic_call] + Pallet::::create_profile(RawOrigin::Signed(caller.clone()), profile.clone()); + + assert_eq!( + Profiles::::get(T::ProfileId::zero()), + Some(RegisteredProfile { + account: caller, + deposit, + profile + }) + ); + } + + #[benchmark] + fn force_create_profile(x: Linear<1, 200>, y: Linear<1, 10>) { + // x: url len, y: para ids len + let url = BoundedVec::try_from(vec![b'A'; x as usize]).unwrap(); + let para_ids = BoundedVec::try_from(vec![ParaId::from(42); y as usize]).unwrap(); + + let profile = Profile { + url, + para_ids: ParaIdsFilter::Whitelist(para_ids), + mode: ProfileMode::Bootnode, + }; + + let owner = create_funded_user::("owner", 1, 1_000_000_000u32); + let origin_force = T::ForceSetProfileOrigin::try_successful_origin() + .expect("failed to create ForceSetProfileOrigin"); + + #[extrinsic_call] + Pallet::::force_create_profile( + origin_force as T::RuntimeOrigin, + profile.clone(), + owner.clone(), + ); + + assert_eq!( + Profiles::::get(T::ProfileId::zero()), + Some(RegisteredProfile { + account: owner, + deposit: 0u32.into(), + profile + }) + ); + } + + #[benchmark] + fn update_profile(x: Linear<1, 200>, y: Linear<1, 10>) { + let url = BoundedVec::try_from(vec![b'A'; 10]).unwrap(); + let para_ids = BoundedVec::try_from(vec![ParaId::from(42); 2]).unwrap(); + + let profile = Profile { + url, + para_ids: ParaIdsFilter::Whitelist(para_ids), + mode: ProfileMode::Bootnode, + }; + + let caller = create_funded_user::("caller", 1, 1_000_000_000u32); + + Pallet::::create_profile(RawOrigin::Signed(caller.clone()).into(), profile) + .expect("to create profile"); + + // x: url len, y: para ids len + let url = BoundedVec::try_from(vec![b'B'; x as usize]).unwrap(); + let para_ids = BoundedVec::try_from(vec![ParaId::from(43); y as usize]).unwrap(); + + let profile = Profile { + url, + para_ids: ParaIdsFilter::Whitelist(para_ids), + mode: ProfileMode::Bootnode, + }; + + let deposit = T::ProfileDeposit::profile_deposit(&profile).expect("deposit to be computed"); + + #[extrinsic_call] + Pallet::::update_profile( + RawOrigin::Signed(caller.clone()), + T::ProfileId::zero(), + profile.clone(), + ); + + assert_eq!( + Profiles::::get(T::ProfileId::zero()), + Some(RegisteredProfile { + account: caller, + deposit, + profile + }) + ); + } + + #[benchmark] + fn force_update_profile(x: Linear<1, 200>, y: Linear<1, 10>) { + let url = BoundedVec::try_from(vec![b'A'; 10]).unwrap(); + let para_ids = BoundedVec::try_from(vec![ParaId::from(42); 2]).unwrap(); + + let profile = Profile { + url, + para_ids: ParaIdsFilter::Whitelist(para_ids), + mode: ProfileMode::Bootnode, + }; + + let caller = create_funded_user::("caller", 1, 1_000_000_000u32); + + Pallet::::create_profile(RawOrigin::Signed(caller.clone()).into(), profile) + .expect("to create profile"); + + // x: url len, y: para ids len + let url = BoundedVec::try_from(vec![b'B'; x as usize]).unwrap(); + let para_ids = BoundedVec::try_from(vec![ParaId::from(43); y as usize]).unwrap(); + + let profile = Profile { + url, + para_ids: ParaIdsFilter::Whitelist(para_ids), + mode: ProfileMode::Bootnode, + }; + + let origin_force = T::ForceSetProfileOrigin::try_successful_origin() + .expect("failed to create ForceSetProfileOrigin"); + + #[extrinsic_call] + Pallet::::force_update_profile( + origin_force as T::RuntimeOrigin, + T::ProfileId::zero(), + profile.clone(), + ); + + assert_eq!( + Profiles::::get(T::ProfileId::zero()), + Some(RegisteredProfile { + account: caller, + deposit: 0u32.into(), + profile + }) + ); + } + + #[benchmark] + fn delete_profile() { + let url = BoundedVec::try_from(vec![b'A'; 10]).unwrap(); + let para_ids = BoundedVec::try_from(vec![ParaId::from(42); 2]).unwrap(); + + let profile = Profile { + url, + para_ids: ParaIdsFilter::Whitelist(para_ids), + mode: ProfileMode::Bootnode, + }; + + let caller = create_funded_user::("caller", 1, 1_000_000_000u32); + + Pallet::::create_profile(RawOrigin::Signed(caller.clone()).into(), profile) + .expect("to create profile"); + + #[extrinsic_call] + Pallet::::delete_profile(RawOrigin::Signed(caller.clone()), T::ProfileId::zero()); + + assert_eq!(Profiles::::get(T::ProfileId::zero()), None); + } + + #[benchmark] + fn force_delete_profile() { + let url = BoundedVec::try_from(vec![b'A'; 10]).unwrap(); + let para_ids = BoundedVec::try_from(vec![ParaId::from(42); 2]).unwrap(); + + let profile = Profile { + url, + para_ids: ParaIdsFilter::Whitelist(para_ids), + mode: ProfileMode::Bootnode, + }; + + let caller = create_funded_user::("caller", 1, 1_000_000_000u32); + + Pallet::::create_profile(RawOrigin::Signed(caller.clone()).into(), profile) + .expect("to create profile"); + + let origin_force = T::ForceSetProfileOrigin::try_successful_origin() + .expect("failed to create ForceSetProfileOrigin"); + + #[extrinsic_call] + Pallet::::force_delete_profile(origin_force as T::RuntimeOrigin, T::ProfileId::zero()); + + assert_eq!(Profiles::::get(T::ProfileId::zero()), None); + } + + impl_benchmark_test_suite!( + Pallet, + crate::mock::ExtBuilder::default().build(), + crate::mock::Test + ); } diff --git a/pallets/data-preservers/src/lib.rs b/pallets/data-preservers/src/lib.rs index 5626c3944..8b9f9608c 100644 --- a/pallets/data-preservers/src/lib.rs +++ b/pallets/data-preservers/src/lib.rs @@ -33,18 +33,28 @@ mod benchmarks; pub mod weights; pub use weights::WeightInfo; +#[cfg(feature = "std")] +use serde::{Deserialize, Serialize}; + use { + core::fmt::Debug, dp_core::ParaId, frame_support::{ + dispatch::DispatchErrorWithPostInfo, pallet_prelude::*, traits::{ - fungible::{Balanced, Inspect}, + fungible::{Balanced, Inspect, MutateHold}, + tokens::Precision, EnsureOriginWithArg, }, DefaultNoBound, }, frame_system::pallet_prelude::*, - sp_runtime::traits::Get, + parity_scale_codec::FullCodec, + sp_runtime::{ + traits::{CheckedAdd, CheckedMul, CheckedSub, Get, One, Zero}, + ArithmeticError, + }, sp_std::vec::Vec, }; @@ -95,14 +105,37 @@ pub mod pallet { pub trait Config: frame_system::Config { /// Overarching event type. type RuntimeEvent: From> + IsType<::RuntimeEvent>; - type Currency: Inspect + Balanced; + + type RuntimeHoldReason: From; + + type Currency: Inspect + + Balanced + + MutateHold; + + type ProfileId: Default + + FullCodec + + TypeInfo + + Copy + + Clone + + Debug + + Eq + + CheckedAdd + + One; + // Who can call set_boot_nodes? type SetBootNodesOrigin: EnsureOriginWithArg; + type ForceSetProfileOrigin: EnsureOrigin; + #[pallet::constant] type MaxBootNodes: Get; #[pallet::constant] type MaxBootNodeUrlLen: Get; + #[pallet::constant] + type MaxParaIdsVecLen: Get; + + /// How much must be deposited to register a profile. + type ProfileDeposit: ProfileDeposit, BalanceOf>; type WeightInfo: WeightInfo; } @@ -112,12 +145,34 @@ pub mod pallet { pub enum Event { /// The list of boot_nodes changed. BootNodesChanged { para_id: ParaId }, + ProfileCreated { + account: T::AccountId, + profile_id: T::ProfileId, + deposit: BalanceOf, + }, + ProfileUpdated { + profile_id: T::ProfileId, + old_deposit: BalanceOf, + new_deposit: BalanceOf, + }, + ProfileDeleted { + profile_id: T::ProfileId, + released_deposit: BalanceOf, + }, } #[pallet::error] pub enum Error { /// This container chain does not have any boot nodes NoBootNodes, + + UnknownProfileId, + NextProfileIdShouldBeAvailable, + } + + #[pallet::composite_enum] + pub enum HoldReason { + ProfileDeposit, } #[pallet::storage] @@ -130,6 +185,104 @@ pub mod pallet { ValueQuery, >; + #[pallet::storage] + pub type Profiles = + StorageMap<_, Blake2_128Concat, T::ProfileId, RegisteredProfile, OptionQuery>; + + #[pallet::storage] + pub type NextProfileId = StorageValue<_, T::ProfileId, ValueQuery>; + + /// Balance used by this pallet + pub type BalanceOf = + <::Currency as Inspect<::AccountId>>::Balance; + + /// Data preserver profile. + #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] + #[derive( + RuntimeDebugNoBound, PartialEqNoBound, EqNoBound, Encode, Decode, CloneNoBound, TypeInfo, + )] + #[scale_info(skip_type_params(T))] + pub struct Profile { + pub url: BoundedVec, + pub para_ids: ParaIdsFilter, + pub mode: ProfileMode, + } + + #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] + #[derive( + RuntimeDebugNoBound, PartialEqNoBound, EqNoBound, Encode, Decode, CloneNoBound, TypeInfo, + )] + #[scale_info(skip_type_params(T))] + pub enum ParaIdsFilter { + AnyParaId, + Whitelist(BoundedVec), + Blacklist(BoundedVec), + } + + impl ParaIdsFilter { + pub fn len(&self) -> usize { + match self { + Self::AnyParaId => 0, + Self::Whitelist(list) | Self::Blacklist(list) => list.len(), + } + } + } + + #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] + #[derive(RuntimeDebug, PartialEq, Eq, Encode, Decode, Clone, TypeInfo)] + pub enum ProfileMode { + Bootnode, + Rpc { supports_ethereum_rpcs: bool }, + } + + /// Profile with additional data: + /// - the account id which created (and manage) the profile + /// - the amount deposited to register the profile + #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] + #[derive( + RuntimeDebugNoBound, PartialEqNoBound, EqNoBound, Encode, Decode, CloneNoBound, TypeInfo, + )] + #[scale_info(skip_type_params(T))] + pub struct RegisteredProfile { + pub account: T::AccountId, + pub deposit: BalanceOf, + pub profile: Profile, + } + + /// Computes the deposit cost of a profile. + pub trait ProfileDeposit { + fn profile_deposit(profile: &Profile) -> Result; + } + + /// Implementation of `ProfileDeposit` based on the size of the SCALE-encoding. + pub struct BytesProfileDeposit(PhantomData<(BaseCost, ByteCost)>); + + impl ProfileDeposit + for BytesProfileDeposit + where + BaseCost: Get, + ByteCost: Get, + Profile: Encode, + Balance: TryFrom + CheckedAdd + CheckedMul, + { + fn profile_deposit(profile: &Profile) -> Result { + let base = BaseCost::get(); + let byte = ByteCost::get(); + let size: Balance = profile + .encoded_size() + .try_into() + .map_err(|_| ArithmeticError::Overflow)?; + + let deposit = byte + .checked_mul(&size) + .ok_or(ArithmeticError::Overflow)? + .checked_add(&base) + .ok_or(ArithmeticError::Overflow)?; + + Ok(deposit) + } + } + #[pallet::call] impl Pallet { /// Set boot_nodes for this para id @@ -151,6 +304,252 @@ pub mod pallet { Ok(()) } + + #[pallet::call_index(1)] + #[pallet::weight(T::WeightInfo::create_profile( + profile.url.len() as u32, + profile.para_ids.len() as u32, + ))] + pub fn create_profile( + origin: OriginFor, + profile: Profile, + ) -> DispatchResultWithPostInfo { + let account = ensure_signed(origin)?; + + let deposit = T::ProfileDeposit::profile_deposit(&profile)?; + T::Currency::hold(&HoldReason::ProfileDeposit.into(), &account, deposit)?; + + let id = NextProfileId::::get(); + NextProfileId::::set( + id.checked_add(&One::one()) + .ok_or(ArithmeticError::Overflow)?, + ); + + ensure!( + !Profiles::::contains_key(id), + Error::::NextProfileIdShouldBeAvailable + ); + + Profiles::::insert( + id, + RegisteredProfile { + account: account.clone(), + deposit, + profile, + }, + ); + + Self::deposit_event(Event::ProfileCreated { + account, + profile_id: id, + deposit, + }); + + Ok(().into()) + } + + #[pallet::call_index(2)] + #[pallet::weight(T::WeightInfo::update_profile( + profile.url.len() as u32, + profile.para_ids.len() as u32, + ))] + pub fn update_profile( + origin: OriginFor, + profile_id: T::ProfileId, + profile: Profile, + ) -> DispatchResultWithPostInfo { + let account = ensure_signed(origin)?; + + let Some(existing_profile) = Profiles::::get(profile_id) else { + Err(Error::::UnknownProfileId)? + }; + + ensure!( + existing_profile.account == account, + sp_runtime::DispatchError::BadOrigin, + ); + + // Update deposit + let new_deposit = T::ProfileDeposit::profile_deposit(&profile)?; + + if let Some(diff) = new_deposit.checked_sub(&existing_profile.deposit) { + T::Currency::hold( + &HoldReason::ProfileDeposit.into(), + &existing_profile.account, + diff, + )?; + } else if let Some(diff) = existing_profile.deposit.checked_sub(&new_deposit) { + T::Currency::release( + &HoldReason::ProfileDeposit.into(), + &existing_profile.account, + diff, + Precision::Exact, + )?; + } + + Profiles::::insert( + profile_id, + RegisteredProfile { + account: existing_profile.account, + deposit: new_deposit, + profile, + }, + ); + + Self::deposit_event(Event::ProfileUpdated { + profile_id, + old_deposit: existing_profile.deposit, + new_deposit, + }); + + Ok(().into()) + } + + #[pallet::call_index(3)] + #[pallet::weight(T::WeightInfo::delete_profile())] + pub fn delete_profile( + origin: OriginFor, + profile_id: T::ProfileId, + ) -> DispatchResultWithPostInfo { + let account = ensure_signed(origin)?; + + let Some(profile) = Profiles::::get(profile_id) else { + Err(Error::::UnknownProfileId)? + }; + + ensure!( + profile.account == account, + sp_runtime::DispatchError::BadOrigin, + ); + + T::Currency::release( + &HoldReason::ProfileDeposit.into(), + &profile.account, + profile.deposit, + Precision::Exact, + )?; + + Profiles::::remove(profile_id); + + Self::deposit_event(Event::ProfileDeleted { + profile_id, + released_deposit: profile.deposit, + }); + + Ok(().into()) + } + + #[pallet::call_index(4)] + #[pallet::weight(T::WeightInfo::force_create_profile( + profile.url.len() as u32, + profile.para_ids.len() as u32, + ))] + pub fn force_create_profile( + origin: OriginFor, + profile: Profile, + for_account: T::AccountId, + ) -> DispatchResultWithPostInfo { + T::ForceSetProfileOrigin::ensure_origin(origin)?; + + let id = NextProfileId::::get(); + NextProfileId::::set( + id.checked_add(&One::one()) + .ok_or(ArithmeticError::Overflow)?, + ); + + ensure!( + !Profiles::::contains_key(id), + Error::::NextProfileIdShouldBeAvailable + ); + + Profiles::::insert( + id, + RegisteredProfile { + account: for_account.clone(), + deposit: Zero::zero(), + profile, + }, + ); + + Self::deposit_event(Event::ProfileCreated { + account: for_account, + profile_id: id, + deposit: Zero::zero(), + }); + + Ok(().into()) + } + + #[pallet::call_index(5)] + #[pallet::weight(T::WeightInfo::force_update_profile( + profile.url.len() as u32, + profile.para_ids.len() as u32, + ))] + pub fn force_update_profile( + origin: OriginFor, + profile_id: T::ProfileId, + profile: Profile, + ) -> DispatchResultWithPostInfo { + T::ForceSetProfileOrigin::ensure_origin(origin)?; + + let Some(existing_profile) = Profiles::::get(profile_id) else { + Err(Error::::UnknownProfileId)? + }; + + // We release the previous deposit + T::Currency::release( + &HoldReason::ProfileDeposit.into(), + &existing_profile.account, + existing_profile.deposit, + Precision::Exact, + )?; + + Profiles::::insert( + profile_id, + RegisteredProfile { + account: existing_profile.account, + deposit: Zero::zero(), + profile, + }, + ); + + Self::deposit_event(Event::ProfileUpdated { + profile_id, + old_deposit: existing_profile.deposit, + new_deposit: Zero::zero(), + }); + + Ok(().into()) + } + + #[pallet::call_index(6)] + #[pallet::weight(T::WeightInfo::force_delete_profile())] + pub fn force_delete_profile( + origin: OriginFor, + profile_id: T::ProfileId, + ) -> DispatchResultWithPostInfo { + T::ForceSetProfileOrigin::ensure_origin(origin)?; + + let Some(profile) = Profiles::::get(profile_id) else { + Err(Error::::UnknownProfileId)? + }; + + T::Currency::release( + &HoldReason::ProfileDeposit.into(), + &profile.account, + profile.deposit, + Precision::Exact, + )?; + + Profiles::::remove(profile_id); + + Self::deposit_event(Event::ProfileDeleted { + profile_id, + released_deposit: profile.deposit, + }); + + Ok(().into()) + } } impl Pallet { diff --git a/pallets/data-preservers/src/mock.rs b/pallets/data-preservers/src/mock.rs index d4f99cfd7..1e0f66864 100644 --- a/pallets/data-preservers/src/mock.rs +++ b/pallets/data-preservers/src/mock.rs @@ -20,7 +20,7 @@ use { frame_support::{ pallet_prelude::*, parameter_types, - traits::{ConstU64, EitherOfDiverse, EnsureOriginWithArg, Everything}, + traits::{ConstU128, ConstU64, EitherOfDiverse, EnsureOriginWithArg, Everything}, }, frame_system::{EnsureRoot, EnsureSigned, RawOrigin}, sp_core::H256, @@ -88,7 +88,7 @@ impl pallet_balances::Config for Test { type AccountStore = System; type FreezeIdentifier = (); type MaxFreezes = (); - type RuntimeHoldReason = (); + type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = (); type MaxHolds = ConstU32<5>; type WeightInfo = (); @@ -217,24 +217,56 @@ where impl pallet_data_preservers::Config for Test { type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; type Currency = Balances; + type ProfileId = u64; type SetBootNodesOrigin = MockContainerChainManagerOrRootOrigin>; + type ForceSetProfileOrigin = EnsureRoot; type MaxBootNodes = ConstU32<10>; type MaxBootNodeUrlLen = ConstU32<200>; + type MaxParaIdsVecLen = ConstU32<20>; + type ProfileDeposit = crate::BytesProfileDeposit, ConstU128<51>>; type WeightInfo = (); } -// Build genesis storage according to the mock runtime. -pub fn new_test_ext() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::::default() - .build_storage() - .unwrap(); +#[derive(Default)] +pub struct ExtBuilder { + balances: Vec<(AccountId, Balance)>, +} - let balances = vec![(0, 10_000)]; +impl ExtBuilder { + pub fn with_balances(mut self, balances: Vec<(AccountId, Balance)>) -> Self { + self.balances = balances; + self + } + + pub fn build(self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::::default() + .build_storage() + .unwrap(); - pallet_balances::GenesisConfig:: { balances } + pallet_balances::GenesisConfig:: { + balances: self.balances, + } .assimilate_storage(&mut t) .unwrap(); - t.into() + let mut ext: sp_io::TestExternalities = t.into(); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} + +pub(crate) fn events() -> Vec> { + System::events() + .into_iter() + .map(|r| r.event) + .filter_map(|e| { + if let RuntimeEvent::DataPreservers(inner) = e { + Some(inner) + } else { + None + } + }) + .collect::>() } diff --git a/pallets/data-preservers/src/tests.rs b/pallets/data-preservers/src/tests.rs index bc738b2f3..42fe407f3 100644 --- a/pallets/data-preservers/src/tests.rs +++ b/pallets/data-preservers/src/tests.rs @@ -17,6 +17,7 @@ use { crate::{mock::*, *}, frame_support::{assert_noop, assert_ok, pallet_prelude::*}, + sp_runtime::TokenError, }; const ALICE: u64 = 1; @@ -24,7 +25,7 @@ const BOB: u64 = 2; #[test] fn set_boot_nodes_bad_origin() { - new_test_ext().execute_with(|| { + ExtBuilder::default().build().execute_with(|| { // Para 1001 has no manager, Alice cannot set boot nodes assert_noop!(DataPreservers::set_boot_nodes( RuntimeOrigin::signed(ALICE), @@ -40,7 +41,7 @@ fn set_boot_nodes_bad_origin() { #[test] fn set_boot_nodes_by_root_no_manager() { - new_test_ext().execute_with(|| { + ExtBuilder::default().build().execute_with(|| { // Para 1001 has no manager, root can set boot nodes let boot_nodes: BoundedVec, _> = vec![ b"/ip4/127.0.0.1/tcp/33049/ws/p2p/12D3KooWHVMhQDHBpj9vQmssgyfspYecgV6e3hH1dQVDUkUbCYC9" @@ -61,7 +62,7 @@ fn set_boot_nodes_by_root_no_manager() { #[test] fn set_boot_nodes_by_root_with_manager() { - new_test_ext().execute_with(|| { + ExtBuilder::default().build().execute_with(|| { // Set ALICE as manager of para 1002 MockData::mutate(|m| { m.container_chain_managers.insert(1002.into(), Some(ALICE)); @@ -86,7 +87,7 @@ fn set_boot_nodes_by_root_with_manager() { #[test] fn set_boot_nodes_by_para_id_registrar() { - new_test_ext().execute_with(|| { + ExtBuilder::default().build().execute_with(|| { // Set ALICE as manager of para 1002 MockData::mutate(|m| { m.container_chain_managers.insert(1002.into(), Some(ALICE)); @@ -111,7 +112,7 @@ fn set_boot_nodes_by_para_id_registrar() { #[test] fn set_boot_nodes_by_invalid_user_no_manager() { - new_test_ext().execute_with(|| { + ExtBuilder::default().build().execute_with(|| { // Para 1001 has no manager MockData::mutate(|m| { m.container_chain_managers.insert(1002.into(), Some(ALICE)); @@ -131,7 +132,7 @@ fn set_boot_nodes_by_invalid_user_no_manager() { #[test] fn set_boot_nodes_by_invalid_user() { - new_test_ext().execute_with(|| { + ExtBuilder::default().build().execute_with(|| { // Set ALICE as manager of para 1002 MockData::mutate(|m| { m.container_chain_managers.insert(1002.into(), Some(ALICE)); @@ -161,7 +162,7 @@ fn set_boot_nodes_by_invalid_user() { #[test] fn set_boot_nodes_by_invalid_user_bad_para_id() { - new_test_ext().execute_with(|| { + ExtBuilder::default().build().execute_with(|| { // Para 1003 does not exist, only root can set bootnodes assert_noop!(DataPreservers::set_boot_nodes( RuntimeOrigin::signed(BOB), @@ -179,7 +180,7 @@ fn set_boot_nodes_by_invalid_user_bad_para_id() { fn set_boot_nodes_bad_para_id() { // Para 1003 does not exist, only root can set bootnodes // This is allowed in case we want to set bootnodes before registering the chain - new_test_ext().execute_with(|| { + ExtBuilder::default().build().execute_with(|| { let boot_nodes: BoundedVec, _> = vec![ b"/ip4/127.0.0.1/tcp/33049/ws/p2p/12D3KooWHVMhQDHBpj9vQmssgyfspYecgV6e3hH1dQVDUkUbCYC9" .to_vec() @@ -196,3 +197,590 @@ fn set_boot_nodes_bad_para_id() { assert_eq!(DataPreservers::boot_nodes(ParaId::from(1003)), boot_nodes); }); } + +mod create_profile { + use super::*; + + #[test] + fn create_profile_works() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_000_000_000_000)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + assert_eq!( + Profiles::::get(0), + Some(RegisteredProfile { + account: ALICE, + deposit: 1_357, // 1_000 base deposit + 51 * 7 bytes deposit + profile + }) + ); + + assert_eq!(NextProfileId::::get(), 1); + + assert_eq!( + events(), + vec![Event::ProfileCreated { + account: ALICE, + profile_id: 0, + deposit: 1_357, + }] + ); + }); + } + + #[test] + fn insufficient_balance_for_deposit() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_356)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_noop!( + DataPreservers::create_profile(RuntimeOrigin::signed(ALICE), profile.clone(),), + TokenError::FundsUnavailable + ); + + assert_eq!(Profiles::::get(0), None); + assert_eq!(NextProfileId::::get(), 0); + assert_eq!(events(), vec![],); + }); + } + + #[test] + fn protection_for_existing_profile() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_000_000_000_000)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + // Set some profile at next id. (this shouldn't occur but we protect from it + // anyway) + Profiles::::insert( + 0, + RegisteredProfile { + account: ALICE, + deposit: 0, + profile: profile.clone(), + }, + ); + + assert_noop!( + DataPreservers::create_profile(RuntimeOrigin::signed(ALICE), profile.clone(),), + Error::::NextProfileIdShouldBeAvailable + ); + }); + } + + #[test] + fn forced_create_profile_works() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_000_000_000_000)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::force_create_profile( + RuntimeOrigin::root(), + profile.clone(), + ALICE, + )); + + assert_eq!( + Profiles::::get(0), + Some(RegisteredProfile { + account: ALICE, + deposit: 0, // no deposit when forced + profile + }) + ); + + assert_eq!(NextProfileId::::get(), 1); + + assert_eq!( + events(), + vec![Event::ProfileCreated { + account: ALICE, + profile_id: 0, + deposit: 0, // no deposit when forced + }] + ); + }); + } + + #[test] + fn forced_create_profile_filter() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_000_000_000_000)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_noop!( + DataPreservers::force_create_profile( + RuntimeOrigin::signed(BOB), + profile.clone(), + ALICE, + ), + sp_runtime::DispatchError::BadOrigin + ); + }); + } +} + +mod update_profile { + use super::*; + + #[test] + fn update_profile_works() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_000_000_000_000)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + let profile2 = Profile { + url: b"test2".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::Whitelist(vec![ParaId::from(42)].try_into().unwrap()), + mode: ProfileMode::Rpc { + supports_ethereum_rpcs: false, + }, + }; + + assert_ok!(DataPreservers::update_profile( + RuntimeOrigin::signed(ALICE), + 0, + profile2.clone(), + )); + + assert_eq!( + Profiles::::get(0), + Some(RegisteredProfile { + account: ALICE, + deposit: 1_714, // 1_000 base deposit + 51 * 14 bytes deposit + profile: profile2 + }) + ); + + assert_eq!( + events(), + vec![ + Event::ProfileCreated { + account: ALICE, + profile_id: 0, + deposit: 1_357, + }, + Event::ProfileUpdated { + profile_id: 0, + old_deposit: 1_357, + new_deposit: 1_714, + } + ] + ); + }); + } + + #[test] + fn unknown_profile_id() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_400)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + let profile2 = Profile { + url: b"test2".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::Whitelist(vec![ParaId::from(42)].try_into().unwrap()), + mode: ProfileMode::Rpc { + supports_ethereum_rpcs: false, + }, + }; + + assert_noop!( + DataPreservers::update_profile( + RuntimeOrigin::signed(ALICE), + 1, // wrong profile id + profile2.clone(), + ), + Error::::UnknownProfileId + ); + }); + } + + #[test] + fn wrong_user() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_400)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + let profile2 = Profile { + url: b"test2".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::Whitelist(vec![ParaId::from(42)].try_into().unwrap()), + mode: ProfileMode::Rpc { + supports_ethereum_rpcs: false, + }, + }; + + assert_noop!( + DataPreservers::update_profile( + RuntimeOrigin::signed(BOB), // not the profile's owner + 0, + profile2.clone(), + ), + sp_runtime::DispatchError::BadOrigin, + ); + }); + } + + #[test] + fn insufficient_balance_for_new_deposit() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_400)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + let profile2 = Profile { + url: b"test2".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::Whitelist(vec![ParaId::from(42)].try_into().unwrap()), + mode: ProfileMode::Rpc { + supports_ethereum_rpcs: false, + }, + }; + + assert_noop!( + DataPreservers::update_profile( + RuntimeOrigin::signed(ALICE), + 0, + profile2.clone(), + ), + TokenError::FundsUnavailable + ); + }); + } + + #[test] + fn forced_update_profile_works() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_000_000_000_000)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + let profile2 = Profile { + url: b"test2".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::Whitelist(vec![ParaId::from(42)].try_into().unwrap()), + mode: ProfileMode::Rpc { + supports_ethereum_rpcs: false, + }, + }; + + assert_ok!(DataPreservers::force_update_profile( + RuntimeOrigin::root(), + 0, + profile2.clone(), + )); + + assert_eq!( + Profiles::::get(0), + Some(RegisteredProfile { + account: ALICE, + deposit: 0, // forced update release deposit + profile: profile2 + }) + ); + + assert_eq!( + events(), + vec![ + Event::ProfileCreated { + account: ALICE, + profile_id: 0, + deposit: 1_357, + }, + Event::ProfileUpdated { + profile_id: 0, + old_deposit: 1_357, + new_deposit: 0, + } + ] + ); + }); + } + + #[test] + fn forced_update_profile_filter() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_000_000_000_000)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + let profile2 = Profile { + url: b"test2".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::Whitelist(vec![ParaId::from(42)].try_into().unwrap()), + mode: ProfileMode::Rpc { + supports_ethereum_rpcs: false, + }, + }; + + assert_noop!( + DataPreservers::force_update_profile( + RuntimeOrigin::signed(ALICE), + 0, + profile2.clone(), + ), + sp_runtime::DispatchError::BadOrigin, + ); + }); + } +} + +mod delete_profile { + use super::*; + + #[test] + fn delete_profile_works() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_000_000_000_000)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + assert_ok!(DataPreservers::delete_profile( + RuntimeOrigin::signed(ALICE), + 0, + )); + + assert_eq!(Profiles::::get(0), None); + + assert_eq!( + events(), + vec![ + Event::ProfileCreated { + account: ALICE, + profile_id: 0, + deposit: 1_357, + }, + Event::ProfileDeleted { + profile_id: 0, + released_deposit: 1_357, + } + ] + ); + }); + } + + #[test] + fn unknown_profile_id() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_400)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + assert_noop!( + DataPreservers::delete_profile( + RuntimeOrigin::signed(ALICE), + 1, // wrong profile id + ), + Error::::UnknownProfileId + ); + }); + } + + #[test] + fn wrong_user() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_400)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + assert_noop!( + DataPreservers::delete_profile( + RuntimeOrigin::signed(BOB), // not the profile's owner + 0, + ), + sp_runtime::DispatchError::BadOrigin, + ); + }); + } + + #[test] + fn forced_delete_profile_works() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_000_000_000_000)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + assert_ok!(DataPreservers::force_delete_profile( + RuntimeOrigin::root(), + 0, + )); + + assert_eq!(Profiles::::get(0), None); + + assert_eq!( + events(), + vec![ + Event::ProfileCreated { + account: ALICE, + profile_id: 0, + deposit: 1_357, + }, + Event::ProfileDeleted { + profile_id: 0, + released_deposit: 1_357, + } + ] + ); + }); + } + + #[test] + fn forced_delete_profile_filter() { + ExtBuilder::default() + .with_balances(vec![(ALICE, 1_000_000_000_000)]) + .build() + .execute_with(|| { + let profile = Profile { + url: b"test".to_vec().try_into().unwrap(), + para_ids: ParaIdsFilter::AnyParaId, + mode: ProfileMode::Bootnode, + }; + + assert_ok!(DataPreservers::create_profile( + RuntimeOrigin::signed(ALICE), + profile.clone(), + )); + + assert_noop!( + DataPreservers::force_delete_profile(RuntimeOrigin::signed(ALICE), 0), + sp_runtime::DispatchError::BadOrigin, + ); + }); + } +} diff --git a/pallets/data-preservers/src/weights.rs b/pallets/data-preservers/src/weights.rs index b93d57d1a..9e282966b 100644 --- a/pallets/data-preservers/src/weights.rs +++ b/pallets/data-preservers/src/weights.rs @@ -18,10 +18,10 @@ //! Autogenerated weights for pallet_data_preservers //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-12-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-05-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `tomasz-XPS-15-9520`, CPU: `12th Gen Intel(R) Core(TM) i7-12700H` -//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 +//! HOSTNAME: `pop-os`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: // ./target/release/tanssi-node @@ -33,15 +33,16 @@ // pallet_data_preservers // --extrinsic // * +// --chain=dev // --steps // 50 // --repeat // 20 -// --template=./benchmarking/frame-weight-template.hbs +// --template=./benchmarking/frame-weight-pallet-template.hbs // --json-file // raw.json // --output -// weights.rs +// tmp/pallet_data_preservers.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -53,6 +54,12 @@ use sp_std::marker::PhantomData; /// Weight functions needed for pallet_data_preservers. pub trait WeightInfo { fn set_boot_nodes(x: u32, y: u32, ) -> Weight; + fn create_profile(x: u32, y: u32, ) -> Weight; + fn force_create_profile(x: u32, y: u32, ) -> Weight; + fn update_profile(x: u32, y: u32, ) -> Weight; + fn force_update_profile(x: u32, y: u32, ) -> Weight; + fn delete_profile() -> Weight; + fn force_delete_profile() -> Weight; } /// Weights for pallet_data_preservers using the Substrate node and recommended hardware. @@ -68,15 +75,113 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `195` // Estimated: `3660` - // Minimum execution time: 10_703_000 picoseconds. - Weight::from_parts(9_788_229, 3660) - // Standard Error: 170 - .saturating_add(Weight::from_parts(7_964, 0).saturating_mul(x.into())) - // Standard Error: 3_552 - .saturating_add(Weight::from_parts(334_296, 0).saturating_mul(y.into())) + // Minimum execution time: 10_063_000 picoseconds. + Weight::from_parts(10_198_905, 3660) + // Standard Error: 739 + .saturating_add(Weight::from_parts(2_403, 0).saturating_mul(x.into())) + // Standard Error: 15_425 + .saturating_add(Weight::from_parts(258_908, 0).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// Storage: `DataPreservers::NextProfileId` (r:1 w:1) + /// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn create_profile(_x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `182` + // Estimated: `3694` + // Minimum execution time: 34_210_000 picoseconds. + Weight::from_parts(43_239_265, 3694) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: `DataPreservers::NextProfileId` (r:1 w:1) + /// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn force_create_profile(_x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `79` + // Estimated: `3544` + // Minimum execution time: 9_075_000 picoseconds. + Weight::from_parts(11_443_644, 3544) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn update_profile(_x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 33_842_000 picoseconds. + Weight::from_parts(42_067_126, 3784) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn force_update_profile(_x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 29_757_000 picoseconds. + Weight::from_parts(34_984_806, 3784) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + fn delete_profile() -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 32_125_000 picoseconds. + Weight::from_parts(35_384_000, 3784) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + fn force_delete_profile() -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 35_189_000 picoseconds. + Weight::from_parts(36_883_000, 3784) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } } // For backwards compatibility and tests @@ -91,13 +196,111 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `195` // Estimated: `3660` - // Minimum execution time: 10_703_000 picoseconds. - Weight::from_parts(9_788_229, 3660) - // Standard Error: 170 - .saturating_add(Weight::from_parts(7_964, 0).saturating_mul(x.into())) - // Standard Error: 3_552 - .saturating_add(Weight::from_parts(334_296, 0).saturating_mul(y.into())) + // Minimum execution time: 10_063_000 picoseconds. + Weight::from_parts(10_198_905, 3660) + // Standard Error: 739 + .saturating_add(Weight::from_parts(2_403, 0).saturating_mul(x.into())) + // Standard Error: 15_425 + .saturating_add(Weight::from_parts(258_908, 0).saturating_mul(y.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// Storage: `DataPreservers::NextProfileId` (r:1 w:1) + /// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn create_profile(_x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `182` + // Estimated: `3694` + // Minimum execution time: 34_210_000 picoseconds. + Weight::from_parts(43_239_265, 3694) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) + } + /// Storage: `DataPreservers::NextProfileId` (r:1 w:1) + /// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn force_create_profile(_x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `79` + // Estimated: `3544` + // Minimum execution time: 9_075_000 picoseconds. + Weight::from_parts(11_443_644, 3544) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn update_profile(_x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 33_842_000 picoseconds. + Weight::from_parts(42_067_126, 3784) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn force_update_profile(_x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 29_757_000 picoseconds. + Weight::from_parts(34_984_806, 3784) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + fn delete_profile() -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 32_125_000 picoseconds. + Weight::from_parts(35_384_000, 3784) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + fn force_delete_profile() -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 35_189_000 picoseconds. + Weight::from_parts(36_883_000, 3784) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } } diff --git a/pallets/xcm-core-buyer/src/benchmarks.rs b/pallets/xcm-core-buyer/src/benchmarks.rs index 70a6d55a0..3e760fe22 100644 --- a/pallets/xcm-core-buyer/src/benchmarks.rs +++ b/pallets/xcm-core-buyer/src/benchmarks.rs @@ -35,11 +35,15 @@ pub const PLACE_ORDER_WEIGHT_AT_MOST: Weight = Weight::from_parts(1_000_000_000, #[benchmarks(where ::RuntimeOrigin: From)] mod benchmarks { - use super::*; - use crate::{InFlightCoreBuyingOrder, PendingBlocks, QueryIdToParaId}; - use frame_system::pallet_prelude::BlockNumberFor; - use staging_xcm::latest::{MaybeErrorCode, QueryId}; - use staging_xcm::v3::{MultiLocation, Response}; + use { + super::*, + crate::{InFlightCoreBuyingOrder, PendingBlocks, QueryIdToParaId}, + frame_system::pallet_prelude::BlockNumberFor, + staging_xcm::{ + latest::{MaybeErrorCode, QueryId}, + v3::{MultiLocation, Response}, + }, + }; #[benchmark] fn force_buy_core() { diff --git a/pallets/xcm-core-buyer/src/lib.rs b/pallets/xcm-core-buyer/src/lib.rs index 05acf15c9..1b6f91698 100644 --- a/pallets/xcm-core-buyer/src/lib.rs +++ b/pallets/xcm-core-buyer/src/lib.rs @@ -34,7 +34,6 @@ mod benchmarks; pub mod weights; pub use weights::WeightInfo; -use tp_traits::{AuthorNotingHook, BlockNumber}; use { dp_core::ParaId, frame_support::{ @@ -46,12 +45,11 @@ use { parity_scale_codec::EncodeLike, sp_runtime::traits::{AccountIdConversion, Convert, Get}, sp_std::{vec, vec::Vec}, - staging_xcm::v3::Response, staging_xcm::{ prelude::*, - v3::{InteriorMultiLocation, MultiAsset, MultiAssets, Xcm}, + v3::{InteriorMultiLocation, MultiAsset, MultiAssets, Response, Xcm}, }, - tp_traits::ParathreadParams, + tp_traits::{AuthorNotingHook, BlockNumber, ParathreadParams}, }; pub trait XCMNotifier { @@ -97,8 +95,7 @@ impl AuthorNotingHook for Pallet { #[frame_support::pallet] pub mod pallet { - use super::*; - use pallet_xcm::ensure_response; + use {super::*, pallet_xcm::ensure_response}; #[pallet::pallet] #[pallet::without_storage_info] pub struct Pallet(PhantomData); diff --git a/pallets/xcm-core-buyer/src/mock.rs b/pallets/xcm-core-buyer/src/mock.rs index 10ea2e020..0eb07a8df 100644 --- a/pallets/xcm-core-buyer/src/mock.rs +++ b/pallets/xcm-core-buyer/src/mock.rs @@ -14,9 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Tanssi. If not, see -use pallet_xcm::Origin; -use staging_xcm::prelude::{GlobalConsensus, Parachain, X2}; -use staging_xcm::prelude::{InteriorMultiLocation, NetworkId}; use { crate::{ self as pallet_xcm_core_buyer, GetParathreadCollators, GetPurchaseCoreCall, @@ -29,6 +26,7 @@ use { parameter_types, traits::{ConstU64, Everything}, }, + pallet_xcm::Origin, sp_core::H256, sp_io::TestExternalities, sp_runtime::{ @@ -36,8 +34,9 @@ use { BuildStorage, }, sp_std::collections::btree_map::BTreeMap, - staging_xcm::latest::{ - MultiAssets, MultiLocation, SendError, SendResult, SendXcm, Xcm, XcmHash, + staging_xcm::{ + latest::{MultiAssets, MultiLocation, SendError, SendResult, SendXcm, Xcm, XcmHash}, + prelude::{GlobalConsensus, InteriorMultiLocation, NetworkId, Parachain, X2}, }, tp_traits::{ParathreadParams, SlotFrequency}, }; diff --git a/pallets/xcm-core-buyer/src/tests.rs b/pallets/xcm-core-buyer/src/tests.rs index 2d51ca3b1..2d32132fc 100644 --- a/pallets/xcm-core-buyer/src/tests.rs +++ b/pallets/xcm-core-buyer/src/tests.rs @@ -14,10 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Tanssi. If not, see -use frame_support::assert_storage_noop; use { crate::{mock::*, *}, - frame_support::{assert_noop, assert_ok}, + frame_support::{assert_noop, assert_ok, assert_storage_noop}, sp_runtime::traits::BadOrigin, }; diff --git a/runtime/common/src/benchmarking.rs b/runtime/common/src/benchmarking.rs index 273f66988..f631688fb 100644 --- a/runtime/common/src/benchmarking.rs +++ b/runtime/common/src/benchmarking.rs @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Tanssi. If not, see -use frame_support::traits::Currency; -use pallet_treasury::ArgumentsFactory; -use sp_std::marker::PhantomData; +use { + frame_support::traits::Currency, pallet_treasury::ArgumentsFactory, sp_std::marker::PhantomData, +}; pub struct TreasurtBenchmarkHelper(PhantomData); impl ArgumentsFactory<(), T::AccountId> for TreasurtBenchmarkHelper diff --git a/runtime/dancebox/src/lib.rs b/runtime/dancebox/src/lib.rs index 64c88ce6c..75eda0b83 100644 --- a/runtime/dancebox/src/lib.rs +++ b/runtime/dancebox/src/lib.rs @@ -68,6 +68,7 @@ use { nimbus_primitives::{NimbusId, SlotBeacon}, pallet_balances::NegativeImbalance, pallet_collator_assignment::{GetRandomnessForNextBlock, RotateCollatorsEveryNSessions}, + pallet_data_preservers::BytesProfileDeposit, pallet_invulnerables::InvulnerableRewardDistribution, pallet_pooled_staking::traits::{IsCandidateEligible, Timer}, pallet_registrar::RegistrarHooks, @@ -156,9 +157,10 @@ pub mod currency { pub const KILODANCE: Balance = 1_000_000_000_000_000; pub const STORAGE_BYTE_FEE: Balance = 100 * MICRODANCE * SUPPLY_FACTOR; + pub const STORAGE_ITEM_FEE: Balance = 100 * MILLIDANCE * SUPPLY_FACTOR; pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 100 * MILLIDANCE * SUPPLY_FACTOR + (bytes as Balance) * STORAGE_BYTE_FEE + items as Balance * STORAGE_ITEM_FEE + (bytes as Balance) * STORAGE_BYTE_FEE } } @@ -924,14 +926,27 @@ impl pallet_services_payment::Config for Runtime { type WeightInfo = weights::pallet_services_payment::SubstrateWeight; } +parameter_types! { + pub const ProfileDepositBaseFee: Balance = currency::STORAGE_ITEM_FEE; + pub const ProfileDepositByteFee: Balance = currency::STORAGE_BYTE_FEE; +} + impl pallet_data_preservers::Config for Runtime { type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; type Currency = Balances; + type WeightInfo = weights::pallet_data_preservers::SubstrateWeight; + + type ProfileId = u64; + type ProfileDeposit = BytesProfileDeposit; + type SetBootNodesOrigin = EitherOfDiverse, EnsureRoot>; + type ForceSetProfileOrigin = EnsureRoot; + type MaxBootNodes = MaxBootNodes; type MaxBootNodeUrlLen = MaxBootNodeUrlLen; - type WeightInfo = weights::pallet_data_preservers::SubstrateWeight; + type MaxParaIdsVecLen = MaxLengthParaIds; } impl pallet_author_noting::Config for Runtime { diff --git a/runtime/dancebox/src/weights/pallet_data_preservers.rs b/runtime/dancebox/src/weights/pallet_data_preservers.rs index a9ebb563f..9c42a0160 100644 --- a/runtime/dancebox/src/weights/pallet_data_preservers.rs +++ b/runtime/dancebox/src/weights/pallet_data_preservers.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_data_preservers //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-04-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-05-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-1`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 @@ -64,13 +64,123 @@ impl pallet_data_preservers::WeightInfo for SubstrateWe // Proof Size summary in bytes: // Measured: `195` // Estimated: `3660` - // Minimum execution time: 17_362_000 picoseconds. - Weight::from_parts(15_414_530, 3660) - // Standard Error: 144 - .saturating_add(Weight::from_parts(11_706, 0).saturating_mul(x.into())) - // Standard Error: 3_020 - .saturating_add(Weight::from_parts(455_376, 0).saturating_mul(y.into())) + // Minimum execution time: 17_579_000 picoseconds. + Weight::from_parts(15_512_474, 3660) + // Standard Error: 155 + .saturating_add(Weight::from_parts(12_145, 0).saturating_mul(x.into())) + // Standard Error: 3_245 + .saturating_add(Weight::from_parts(444_028, 0).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// Storage: `DataPreservers::NextProfileId` (r:1 w:1) + /// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn create_profile(x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `182` + // Estimated: `3694` + // Minimum execution time: 60_338_000 picoseconds. + Weight::from_parts(61_745_449, 3694) + // Standard Error: 237 + .saturating_add(Weight::from_parts(43, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: `DataPreservers::NextProfileId` (r:1 w:1) + /// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn force_create_profile(x: u32, y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `79` + // Estimated: `3544` + // Minimum execution time: 17_167_000 picoseconds. + Weight::from_parts(17_704_087, 3544) + // Standard Error: 98 + .saturating_add(Weight::from_parts(221, 0).saturating_mul(x.into())) + // Standard Error: 2_053 + .saturating_add(Weight::from_parts(5_369, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn update_profile(x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 59_285_000 picoseconds. + Weight::from_parts(60_566_202, 3784) + // Standard Error: 172 + .saturating_add(Weight::from_parts(336, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn force_update_profile(x: u32, y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 51_519_000 picoseconds. + Weight::from_parts(53_016_751, 3784) + // Standard Error: 202 + .saturating_add(Weight::from_parts(224, 0).saturating_mul(x.into())) + // Standard Error: 4_224 + .saturating_add(Weight::from_parts(17, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + fn delete_profile() -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 50_942_000 picoseconds. + Weight::from_parts(51_642_000, 3784) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + fn force_delete_profile() -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 50_872_000 picoseconds. + Weight::from_parts(51_956_000, 3784) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } } \ No newline at end of file diff --git a/runtime/dancebox/src/xcm_config.rs b/runtime/dancebox/src/xcm_config.rs index 65f5d85af..e9e821ddf 100644 --- a/runtime/dancebox/src/xcm_config.rs +++ b/runtime/dancebox/src/xcm_config.rs @@ -14,9 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Tanssi. If not, see -use frame_system::pallet_prelude::BlockNumberFor; -use pallet_xcm_core_buyer::XCMNotifier; -use staging_xcm_builder::TrailingSetTopicAsId; use { super::{ currency::MICRODANCE, weights::xcm::XcmWeight as XcmGenericWeights, AccountId, @@ -33,11 +30,11 @@ use { traits::{Everything, Nothing, PalletInfoAccess, TransformOrigin}, weights::Weight, }, - frame_system::EnsureRoot, + frame_system::{pallet_prelude::BlockNumberFor, EnsureRoot}, pallet_xcm::XcmPassthrough, pallet_xcm_core_buyer::{ GetParathreadCollators, GetParathreadMaxCorePrice, GetParathreadParams, - GetPurchaseCoreCall, ParaIdIntoAccountTruncating, + GetPurchaseCoreCall, ParaIdIntoAccountTruncating, XCMNotifier, }, parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}, parity_scale_codec::{Decode, Encode}, @@ -52,8 +49,8 @@ use { AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, EnsureXcmOrigin, FungibleAdapter, FungiblesAdapter, IsConcrete, NoChecking, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, - WeightInfoBounds, WithComputedOrigin, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, + UsingComponents, WeightInfoBounds, WithComputedOrigin, }, staging_xcm_executor::{traits::JustTry, XcmExecutor}, tp_traits::ParathreadParams, diff --git a/runtime/dancebox/tests/common/xcm/core_buyer.rs b/runtime/dancebox/tests/common/xcm/core_buyer.rs index 27e30a9df..11be4e1df 100644 --- a/runtime/dancebox/tests/common/xcm/core_buyer.rs +++ b/runtime/dancebox/tests/common/xcm/core_buyer.rs @@ -14,18 +14,18 @@ // You should have received a copy of the GNU General Public License // along with Tanssi. If not, see -use crate::assert_expected_events; -use staging_xcm::latest::{MaybeErrorCode, Response}; -use staging_xcm::v3::QueryId; use { - crate::common::{ - dummy_boot_nodes, empty_genesis_data, run_to_session, start_block, - xcm::{ - mocknets::{ - DanceboxRococoPara as Dancebox, DanceboxSender, RococoRelay as Rococo, - RococoRelayPallet, RococoSender, + crate::{ + assert_expected_events, + common::{ + dummy_boot_nodes, empty_genesis_data, run_to_session, start_block, + xcm::{ + mocknets::{ + DanceboxRococoPara as Dancebox, DanceboxSender, RococoRelay as Rococo, + RococoRelayPallet, RococoSender, + }, + *, }, - *, }, }, core::marker::PhantomData, @@ -35,6 +35,10 @@ use { pallet_xcm_core_buyer::RelayXcmWeightConfigInner, polkadot_runtime_parachains::assigner_on_demand as parachains_assigner_on_demand, sp_runtime::AccountId32, + staging_xcm::{ + latest::{MaybeErrorCode, Response}, + v3::QueryId, + }, staging_xcm_executor::traits::ConvertLocation, tp_traits::{ParaId, SlotFrequency}, xcm_emulator::{Chain, RelayChain}, diff --git a/runtime/dancebox/tests/common/xcm/delivery_fees.rs b/runtime/dancebox/tests/common/xcm/delivery_fees.rs index 2272e8791..3250afc01 100644 --- a/runtime/dancebox/tests/common/xcm/delivery_fees.rs +++ b/runtime/dancebox/tests/common/xcm/delivery_fees.rs @@ -15,18 +15,19 @@ // along with Tanssi. If not, see use { - crate::assert_expected_events, - crate::common::xcm::{ - mocknets::{ - DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxSender, - EthereumSender as FrontierTemplateSender, FrontierTemplatePara as FrontierTemplate, - FrontierTemplateParaPallet, SimpleTemplatePara as SimpleTemplate, - SimpleTemplateParaPallet, SimpleTemplateSender, + crate::{ + assert_expected_events, + common::xcm::{ + mocknets::{ + DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxSender, + EthereumSender as FrontierTemplateSender, FrontierTemplatePara as FrontierTemplate, + FrontierTemplateParaPallet, SimpleTemplatePara as SimpleTemplate, + SimpleTemplateParaPallet, SimpleTemplateSender, + }, + *, }, - *, }, - frame_support::assert_ok, - frame_support::traits::EnsureOrigin, + frame_support::{assert_ok, traits::EnsureOrigin}, paste::paste, staging_xcm::{latest::prelude::*, VersionedMultiLocation, VersionedXcm}, xcm_emulator::Chain, diff --git a/runtime/dancebox/tests/common/xcm/foreign_signed_based_sovereign.rs b/runtime/dancebox/tests/common/xcm/foreign_signed_based_sovereign.rs index 93f29aa99..8c3830dba 100644 --- a/runtime/dancebox/tests/common/xcm/foreign_signed_based_sovereign.rs +++ b/runtime/dancebox/tests/common/xcm/foreign_signed_based_sovereign.rs @@ -15,14 +15,17 @@ // along with Tanssi. If not, see use { - crate::assert_expected_events, - crate::common::xcm::{ - mocknets::{ - DanceboxEmptyReceiver, DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxSender, - EthereumEmptyReceiver, EthereumSender, FrontierTemplatePara as FrontierTemplate, - FrontierTemplateParaPallet, WestendRelay as Westend, WestendRelayPallet, WestendSender, + crate::{ + assert_expected_events, + common::xcm::{ + mocknets::{ + DanceboxEmptyReceiver, DanceboxPara as Dancebox, DanceboxParaPallet, + DanceboxSender, EthereumEmptyReceiver, EthereumSender, + FrontierTemplatePara as FrontierTemplate, FrontierTemplateParaPallet, + WestendRelay as Westend, WestendRelayPallet, WestendSender, + }, + *, }, - *, }, container_chain_template_frontier_runtime::currency::UNIT as FRONTIER_DEV, dancebox_runtime::UNIT as DANCE, diff --git a/runtime/dancebox/tests/common/xcm/foreign_sovereigns.rs b/runtime/dancebox/tests/common/xcm/foreign_sovereigns.rs index d0000b3b1..108da6a3e 100644 --- a/runtime/dancebox/tests/common/xcm/foreign_sovereigns.rs +++ b/runtime/dancebox/tests/common/xcm/foreign_sovereigns.rs @@ -15,14 +15,17 @@ // along with Tanssi. If not, see use { - crate::assert_expected_events, - crate::common::xcm::{ - mocknets::{ - DanceboxPara as Dancebox, DanceboxParaPallet, EthereumEmptyReceiver, EthereumSender, - FrontierTemplatePara as FrontierTemplate, FrontierTemplateParaPallet, - WestendEmptyReceiver, WestendRelay as Westend, WestendRelayPallet, WestendSender, + crate::{ + assert_expected_events, + common::xcm::{ + mocknets::{ + DanceboxPara as Dancebox, DanceboxParaPallet, EthereumEmptyReceiver, + EthereumSender, FrontierTemplatePara as FrontierTemplate, + FrontierTemplateParaPallet, WestendEmptyReceiver, WestendRelay as Westend, + WestendRelayPallet, WestendSender, + }, + *, }, - *, }, container_chain_template_frontier_runtime::currency::UNIT as FRONTIER_DEV, frame_support::{ diff --git a/runtime/dancebox/tests/common/xcm/reserver_transfers_polkadot_xcm.rs b/runtime/dancebox/tests/common/xcm/reserver_transfers_polkadot_xcm.rs index ffb945a90..e732ae32c 100644 --- a/runtime/dancebox/tests/common/xcm/reserver_transfers_polkadot_xcm.rs +++ b/runtime/dancebox/tests/common/xcm/reserver_transfers_polkadot_xcm.rs @@ -15,15 +15,17 @@ // along with Tanssi. If not, see use { - crate::assert_expected_events, - crate::common::xcm::{ - mocknets::{ - DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxSender, - SimpleTemplateEmptyReceiver, SimpleTemplatePara as SimpleTemplate, - SimpleTemplateParaPallet, SimpleTemplateSender, WestendRelay as Westend, - WestendRelayPallet, WestendSender, + crate::{ + assert_expected_events, + common::xcm::{ + mocknets::{ + DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxSender, + SimpleTemplateEmptyReceiver, SimpleTemplatePara as SimpleTemplate, + SimpleTemplateParaPallet, SimpleTemplateSender, WestendRelay as Westend, + WestendRelayPallet, WestendSender, + }, + *, }, - *, }, frame_support::{ assert_noop, assert_ok, diff --git a/runtime/dancebox/tests/common/xcm/token_derivative_reception_container_dancebox.rs b/runtime/dancebox/tests/common/xcm/token_derivative_reception_container_dancebox.rs index 5568869d1..6b5f06b77 100644 --- a/runtime/dancebox/tests/common/xcm/token_derivative_reception_container_dancebox.rs +++ b/runtime/dancebox/tests/common/xcm/token_derivative_reception_container_dancebox.rs @@ -15,13 +15,16 @@ // along with Tanssi. If not, see use { - crate::assert_expected_events, - crate::common::xcm::{ - mocknets::{ - DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxReceiver, - SimpleTemplatePara as SimpleTemplate, SimpleTemplateParaPallet, SimpleTemplateSender, + crate::{ + assert_expected_events, + common::xcm::{ + mocknets::{ + DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxReceiver, + SimpleTemplatePara as SimpleTemplate, SimpleTemplateParaPallet, + SimpleTemplateSender, + }, + *, }, - *, }, frame_support::{ assert_ok, diff --git a/runtime/dancebox/tests/common/xcm/token_derivative_reception_dancebox_frontier_container.rs b/runtime/dancebox/tests/common/xcm/token_derivative_reception_dancebox_frontier_container.rs index eac81f7ed..88788ba14 100644 --- a/runtime/dancebox/tests/common/xcm/token_derivative_reception_dancebox_frontier_container.rs +++ b/runtime/dancebox/tests/common/xcm/token_derivative_reception_dancebox_frontier_container.rs @@ -15,13 +15,15 @@ // along with Tanssi. If not, see use { - crate::assert_expected_events, - crate::common::xcm::{ - mocknets::{ - DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxSender, EthereumReceiver, - FrontierTemplatePara as FrontierTemplate, FrontierTemplateParaPallet, + crate::{ + assert_expected_events, + common::xcm::{ + mocknets::{ + DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxSender, EthereumReceiver, + FrontierTemplatePara as FrontierTemplate, FrontierTemplateParaPallet, + }, + *, }, - *, }, frame_support::{ assert_ok, diff --git a/runtime/dancebox/tests/common/xcm/token_derivative_reception_dancebox_simple_container.rs b/runtime/dancebox/tests/common/xcm/token_derivative_reception_dancebox_simple_container.rs index 8d4dd06b8..5310c3e13 100644 --- a/runtime/dancebox/tests/common/xcm/token_derivative_reception_dancebox_simple_container.rs +++ b/runtime/dancebox/tests/common/xcm/token_derivative_reception_dancebox_simple_container.rs @@ -15,13 +15,16 @@ // along with Tanssi. If not, see use { - crate::assert_expected_events, - crate::common::xcm::{ - mocknets::{ - DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxSender, - SimpleTemplatePara as SimpleTemplate, SimpleTemplateParaPallet, SimpleTemplateReceiver, + crate::{ + assert_expected_events, + common::xcm::{ + mocknets::{ + DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxSender, + SimpleTemplatePara as SimpleTemplate, SimpleTemplateParaPallet, + SimpleTemplateReceiver, + }, + *, }, - *, }, frame_support::{ assert_ok, diff --git a/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_dancebox.rs b/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_dancebox.rs index 6e939af81..158db98fd 100644 --- a/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_dancebox.rs +++ b/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_dancebox.rs @@ -15,13 +15,15 @@ // along with Tanssi. If not, see use { - crate::assert_expected_events, - crate::common::xcm::{ - mocknets::{ - DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxReceiver, - WestendRelay as Westend, WestendRelayPallet, WestendSender, + crate::{ + assert_expected_events, + common::xcm::{ + mocknets::{ + DanceboxPara as Dancebox, DanceboxParaPallet, DanceboxReceiver, + WestendRelay as Westend, WestendRelayPallet, WestendSender, + }, + *, }, - *, }, frame_support::{ assert_ok, diff --git a/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_frontier_container.rs b/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_frontier_container.rs index cf495c263..f287b3553 100644 --- a/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_frontier_container.rs +++ b/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_frontier_container.rs @@ -15,13 +15,16 @@ // along with Tanssi. If not, see use { - crate::assert_expected_events, - crate::common::xcm::{ - mocknets::{ - EthereumReceiver, FrontierTemplatePara as FrontierTemplate, FrontierTemplateParaPallet, - WestendRelay as Westend, WestendRelayPallet, WestendSender, + crate::{ + assert_expected_events, + common::xcm::{ + mocknets::{ + EthereumReceiver, FrontierTemplatePara as FrontierTemplate, + FrontierTemplateParaPallet, WestendRelay as Westend, WestendRelayPallet, + WestendSender, + }, + *, }, - *, }, frame_support::{ assert_ok, diff --git a/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_simple_container.rs b/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_simple_container.rs index 09374a5a3..0503bb9ae 100644 --- a/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_simple_container.rs +++ b/runtime/dancebox/tests/common/xcm/token_derivative_reception_relay_simple_container.rs @@ -15,13 +15,15 @@ // along with Tanssi. If not, see use { - crate::assert_expected_events, - crate::common::xcm::{ - mocknets::{ - SimpleTemplatePara as SimpleTemplate, SimpleTemplateParaPallet, SimpleTemplateReceiver, - WestendRelay as Westend, WestendRelayPallet, WestendSender, + crate::{ + assert_expected_events, + common::xcm::{ + mocknets::{ + SimpleTemplatePara as SimpleTemplate, SimpleTemplateParaPallet, + SimpleTemplateReceiver, WestendRelay as Westend, WestendRelayPallet, WestendSender, + }, + *, }, - *, }, frame_support::{ assert_ok, diff --git a/runtime/dancebox/tests/common/xcm/transact.rs b/runtime/dancebox/tests/common/xcm/transact.rs index 0abeaaf2d..22949a8c6 100644 --- a/runtime/dancebox/tests/common/xcm/transact.rs +++ b/runtime/dancebox/tests/common/xcm/transact.rs @@ -17,11 +17,13 @@ use crate::common::xcm::*; use { - crate::assert_expected_events, - crate::common::xcm::mocknets::{ - DanceboxPara as Dancebox, FrontierTemplatePara as FrontierTemplate, - FrontierTemplateParaPallet, SimpleTemplatePara as SimpleTemplate, SimpleTemplateParaPallet, - WestendRelay as Westend, WestendRelayPallet, + crate::{ + assert_expected_events, + common::xcm::mocknets::{ + DanceboxPara as Dancebox, FrontierTemplatePara as FrontierTemplate, + FrontierTemplateParaPallet, SimpleTemplatePara as SimpleTemplate, + SimpleTemplateParaPallet, WestendRelay as Westend, WestendRelayPallet, + }, }, frame_support::{ assert_ok, diff --git a/runtime/dancebox/tests/common/xcm/trap.rs b/runtime/dancebox/tests/common/xcm/trap.rs index 11da0ae41..49c433bc3 100644 --- a/runtime/dancebox/tests/common/xcm/trap.rs +++ b/runtime/dancebox/tests/common/xcm/trap.rs @@ -17,9 +17,11 @@ use crate::common::xcm::*; use { - crate::assert_expected_events, - crate::common::xcm::mocknets::{ - DanceboxPara as Dancebox, WestendRelay as Westend, WestendRelayPallet, + crate::{ + assert_expected_events, + common::xcm::mocknets::{ + DanceboxPara as Dancebox, WestendRelay as Westend, WestendRelayPallet, + }, }, frame_support::{ assert_ok, diff --git a/runtime/flashbox/src/lib.rs b/runtime/flashbox/src/lib.rs index 5d75deea7..910b57331 100644 --- a/runtime/flashbox/src/lib.rs +++ b/runtime/flashbox/src/lib.rs @@ -65,6 +65,7 @@ use { }, nimbus_primitives::{NimbusId, SlotBeacon}, pallet_balances::NegativeImbalance, + pallet_data_preservers::BytesProfileDeposit, pallet_invulnerables::InvulnerableRewardDistribution, pallet_registrar::RegistrarHooks, pallet_registrar_runtime_api::ContainerChainGenesisData, @@ -150,9 +151,10 @@ pub mod currency { pub const KILODANCE: Balance = 1_000_000_000_000_000; pub const STORAGE_BYTE_FEE: Balance = 100 * MICRODANCE * SUPPLY_FACTOR; + pub const STORAGE_ITEM_FEE: Balance = 100 * MILLIDANCE * SUPPLY_FACTOR; pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 100 * MILLIDANCE * SUPPLY_FACTOR + (bytes as Balance) * STORAGE_BYTE_FEE + items as Balance * STORAGE_ITEM_FEE + (bytes as Balance) * STORAGE_BYTE_FEE } } @@ -782,14 +784,28 @@ impl pallet_services_payment::Config for Runtime { EitherOfDiverse, EnsureRoot>; type WeightInfo = weights::pallet_services_payment::SubstrateWeight; } + +parameter_types! { + pub const ProfileDepositBaseFee: Balance = currency::STORAGE_ITEM_FEE; + pub const ProfileDepositByteFee: Balance = currency::STORAGE_BYTE_FEE; +} + impl pallet_data_preservers::Config for Runtime { type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; type Currency = Balances; + type WeightInfo = weights::pallet_data_preservers::SubstrateWeight; + + type ProfileId = u64; + type ProfileDeposit = BytesProfileDeposit; + type SetBootNodesOrigin = EitherOfDiverse, EnsureRoot>; + type ForceSetProfileOrigin = EnsureRoot; + type MaxBootNodes = MaxBootNodes; type MaxBootNodeUrlLen = MaxBootNodeUrlLen; - type WeightInfo = weights::pallet_data_preservers::SubstrateWeight; + type MaxParaIdsVecLen = MaxLengthParaIds; } impl pallet_author_noting::Config for Runtime { diff --git a/runtime/flashbox/src/weights/pallet_data_preservers.rs b/runtime/flashbox/src/weights/pallet_data_preservers.rs index c906acb2d..27c1f78a7 100644 --- a/runtime/flashbox/src/weights/pallet_data_preservers.rs +++ b/runtime/flashbox/src/weights/pallet_data_preservers.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_data_preservers //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-04-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-05-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-1`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("flashbox_dev"), DB CACHE: 1024 @@ -64,13 +64,119 @@ impl pallet_data_preservers::WeightInfo for SubstrateWe // Proof Size summary in bytes: // Measured: `195` // Estimated: `3660` - // Minimum execution time: 16_473_000 picoseconds. - Weight::from_parts(14_542_746, 3660) + // Minimum execution time: 16_267_000 picoseconds. + Weight::from_parts(14_208_199, 3660) // Standard Error: 159 - .saturating_add(Weight::from_parts(12_051, 0).saturating_mul(x.into())) - // Standard Error: 3_325 - .saturating_add(Weight::from_parts(452_868, 0).saturating_mul(y.into())) + .saturating_add(Weight::from_parts(11_989, 0).saturating_mul(x.into())) + // Standard Error: 3_322 + .saturating_add(Weight::from_parts(452_756, 0).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// Storage: `DataPreservers::NextProfileId` (r:1 w:1) + /// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn create_profile(x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `182` + // Estimated: `3694` + // Minimum execution time: 59_513_000 picoseconds. + Weight::from_parts(60_845_441, 3694) + // Standard Error: 269 + .saturating_add(Weight::from_parts(1_122, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: `DataPreservers::NextProfileId` (r:1 w:1) + /// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn force_create_profile(x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `79` + // Estimated: `3544` + // Minimum execution time: 15_994_000 picoseconds. + Weight::from_parts(16_661_778, 3544) + // Standard Error: 116 + .saturating_add(Weight::from_parts(1_112, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn update_profile(x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 58_515_000 picoseconds. + Weight::from_parts(59_596_525, 3784) + // Standard Error: 181 + .saturating_add(Weight::from_parts(1_609, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 200]`. + /// The range of component `y` is `[1, 10]`. + fn force_update_profile(x: u32, _y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 50_727_000 picoseconds. + Weight::from_parts(52_180_969, 3784) + // Standard Error: 179 + .saturating_add(Weight::from_parts(1_243, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + fn delete_profile() -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 50_322_000 picoseconds. + Weight::from_parts(51_297_000, 3784) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `DataPreservers::Profiles` (r:1 w:1) + /// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`) + fn force_delete_profile() -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3784` + // Minimum execution time: 49_809_000 picoseconds. + Weight::from_parts(50_842_000, 3784) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } } \ No newline at end of file diff --git a/test/suites/common-tanssi/pallet-data-preservers/test_pallet_data_preservers.ts b/test/suites/common-tanssi/pallet-data-preservers/test_pallet_data_preservers.ts new file mode 100644 index 000000000..67adcc4b2 --- /dev/null +++ b/test/suites/common-tanssi/pallet-data-preservers/test_pallet_data_preservers.ts @@ -0,0 +1,242 @@ +import "@tanssi/api-augment"; +import { describeSuite, expect, beforeAll } from "@moonwall/cli"; +import { ApiPromise } from "@polkadot/api"; +import { KeyringPair } from "@moonwall/util"; + +describeSuite({ + id: "CT1001", + title: "Data preservers pallet test suite", + foundationMethods: "dev", + + testCases: ({ it, context }) => { + let polkadotJs: ApiPromise; + let sudo_alice: KeyringPair; + let general_user_bob: KeyringPair; + let profileId = 0; + + beforeAll(async () => { + polkadotJs = context.polkadotJs(); + sudo_alice = context.keyring.alice; + general_user_bob = context.keyring.charlie; + }); + + it({ + id: "E01", + title: "User can create profile", + test: async function () { + const profile = { + url: "exemple", + paraIds: { whitelist: [42, 43] }, + mode: "Bootnode", + }; + + const tx = polkadotJs.tx.dataPreservers.createProfile(profile); + const signedTx = await tx.signAsync(general_user_bob); + await context.createBlock([signedTx]); + + const storedProfile = await polkadotJs.query.dataPreservers.profiles(profileId); + expect(storedProfile.toJSON()).to.be.deep.equal({ + account: general_user_bob.address, + deposit: 10_190_000_000_000, + profile: { + url: "0x6578656d706c65", + paraIds: { whitelist: [42, 43] }, + mode: { bootnode: null }, + }, + }); + }, + }); + + it({ + id: "E02", + title: "User can update profile", + test: async function () { + const profile = { + url: "exemple", + paraIds: { whitelist: [42, 43] }, + mode: "Bootnode", + }; + + const tx = polkadotJs.tx.dataPreservers.createProfile(profile); + const signedTx = await tx.signAsync(general_user_bob); + await context.createBlock([signedTx]); + + const storedProfile = await polkadotJs.query.dataPreservers.profiles(++profileId); + expect(storedProfile.toJSON()).to.be.deep.equal({ + account: general_user_bob.address, + deposit: 10_190_000_000_000, + profile: { + url: "0x6578656d706c65", + paraIds: { whitelist: [42, 43] }, + mode: { bootnode: null }, + }, + }); + + const profile2 = { + url: "exemple2", + paraIds: { whitelist: [42, 43] }, + mode: { Rpc: { supportsEthereumRpcs: false } }, + }; + + const tx2 = polkadotJs.tx.dataPreservers.updateProfile(profileId, profile2); + const signedTx2 = await tx2.signAsync(general_user_bob); + await context.createBlock([signedTx2]); + + const storedProfile2 = await polkadotJs.query.dataPreservers.profiles(profileId); + expect(storedProfile2.toJSON()).to.be.deep.equal({ + account: general_user_bob.address, + deposit: 10_210_000_000_000, + profile: { + url: "0x6578656d706c6532", + paraIds: { whitelist: [42, 43] }, + mode: { rpc: { supportsEthereumRpcs: false } }, + }, + }); + }, + }); + + it({ + id: "E03", + title: "User can delete profile", + test: async function () { + const profile = { + url: "exemple", + paraIds: { whitelist: [42, 43] }, + mode: "Bootnode", + }; + + const tx = polkadotJs.tx.dataPreservers.createProfile(profile); + const signedTx = await tx.signAsync(general_user_bob); + await context.createBlock([signedTx]); + + const storedProfile = await polkadotJs.query.dataPreservers.profiles(++profileId); + expect(storedProfile.toJSON()).to.be.deep.equal({ + account: general_user_bob.address, + deposit: 10_190_000_000_000, + profile: { + url: "0x6578656d706c65", + paraIds: { whitelist: [42, 43] }, + mode: { bootnode: null }, + }, + }); + + const tx2 = polkadotJs.tx.dataPreservers.deleteProfile(profileId); + const signedTx2 = await tx2.signAsync(general_user_bob); + await context.createBlock([signedTx2]); + + const storedProfile2 = await polkadotJs.query.dataPreservers.profiles(profileId); + expect(storedProfile2.toJSON()).to.be.equal(null); + }, + }); + + it({ + id: "E04", + title: "Root can force create profile", + test: async function () { + const profile = { + url: "exemple", + paraIds: { whitelist: [42, 43] }, + mode: "Bootnode", + }; + + const tx = polkadotJs.tx.dataPreservers.forceCreateProfile(profile, general_user_bob.address); + const signedTx = await polkadotJs.tx.sudo.sudo(tx).signAsync(sudo_alice); + await context.createBlock([signedTx]); + + const storedProfile = await polkadotJs.query.dataPreservers.profiles(++profileId); + expect(storedProfile.toJSON()).to.be.deep.equal({ + account: general_user_bob.address, + deposit: 0, + profile: { + url: "0x6578656d706c65", + paraIds: { whitelist: [42, 43] }, + mode: { bootnode: null }, + }, + }); + }, + }); + + it({ + id: "E05", + title: "Root can force update profile", + test: async function () { + const profile = { + url: "exemple", + paraIds: { whitelist: [42, 43] }, + mode: "Bootnode", + }; + + const tx = polkadotJs.tx.dataPreservers.createProfile(profile); + const signedTx = await tx.signAsync(general_user_bob); + await context.createBlock([signedTx]); + + const storedProfile = await polkadotJs.query.dataPreservers.profiles(++profileId); + expect(storedProfile.toJSON()).to.be.deep.equal({ + account: general_user_bob.address, + deposit: 10_190_000_000_000, + profile: { + url: "0x6578656d706c65", + paraIds: { whitelist: [42, 43] }, + mode: { bootnode: null }, + }, + }); + + const profile2 = { + url: "exemple2", + paraIds: { whitelist: [42, 43] }, + mode: { Rpc: { supportsEthereumRpcs: false } }, + }; + + const tx2 = polkadotJs.tx.dataPreservers.forceUpdateProfile(profileId, profile2); + const signedTx2 = await polkadotJs.tx.sudo.sudo(tx2).signAsync(sudo_alice); + await context.createBlock([signedTx2]); + + const storedProfile2 = await polkadotJs.query.dataPreservers.profiles(profileId); + expect(storedProfile2.toJSON()).to.be.deep.equal({ + account: general_user_bob.address, + deposit: 0, + profile: { + url: "0x6578656d706c6532", + paraIds: { whitelist: [42, 43] }, + mode: { rpc: { supportsEthereumRpcs: false } }, + }, + }); + }, + }); + + it({ + id: "E06", + title: "Root can force delete profile", + test: async function () { + const profile = { + url: "exemple", + paraIds: { whitelist: [42, 43] }, + mode: "Bootnode", + }; + + const tx = polkadotJs.tx.dataPreservers.createProfile(profile); + const signedTx = await tx.signAsync(general_user_bob); + await context.createBlock([signedTx]); + + const storedProfile = await polkadotJs.query.dataPreservers.profiles(++profileId); + expect(storedProfile.toJSON()).to.be.deep.equal({ + account: general_user_bob.address, + deposit: 10_190_000_000_000, + profile: { + url: "0x6578656d706c65", + paraIds: { whitelist: [42, 43] }, + mode: { bootnode: null }, + }, + }); + + const tx2 = polkadotJs.tx.dataPreservers.forceDeleteProfile(profileId); + const signedTx2 = await polkadotJs.tx.sudo.sudo(tx2).signAsync(sudo_alice); + await context.createBlock(); // session boundary block cannot contain tx + await context.createBlock([signedTx2]); + + const storedProfile2 = await polkadotJs.query.dataPreservers.profiles(profileId); + expect(storedProfile2.toJSON()).to.be.equal(null); + }, + }); + }, +}); diff --git a/typescript-api/src/dancebox/interfaces/augment-api-consts.ts b/typescript-api/src/dancebox/interfaces/augment-api-consts.ts index 983e22c32..3bf20a79d 100644 --- a/typescript-api/src/dancebox/interfaces/augment-api-consts.ts +++ b/typescript-api/src/dancebox/interfaces/augment-api-consts.ts @@ -64,6 +64,7 @@ declare module "@polkadot/api-base/types/consts" { dataPreservers: { maxBootNodes: u32 & AugmentedConst; maxBootNodeUrlLen: u32 & AugmentedConst; + maxParaIdsVecLen: u32 & AugmentedConst; /** Generic const */ [key: string]: Codec; }; diff --git a/typescript-api/src/dancebox/interfaces/augment-api-errors.ts b/typescript-api/src/dancebox/interfaces/augment-api-errors.ts index 45a6f2dd3..f3a393bcc 100644 --- a/typescript-api/src/dancebox/interfaces/augment-api-errors.ts +++ b/typescript-api/src/dancebox/interfaces/augment-api-errors.ts @@ -74,8 +74,10 @@ declare module "@polkadot/api-base/types/errors" { [key: string]: AugmentedError; }; dataPreservers: { + NextProfileIdShouldBeAvailable: AugmentedError; /** This container chain does not have any boot nodes */ NoBootNodes: AugmentedError; + UnknownProfileId: AugmentedError; /** Generic error */ [key: string]: AugmentedError; }; diff --git a/typescript-api/src/dancebox/interfaces/augment-api-events.ts b/typescript-api/src/dancebox/interfaces/augment-api-events.ts index 12fcd135c..4c5566650 100644 --- a/typescript-api/src/dancebox/interfaces/augment-api-events.ts +++ b/typescript-api/src/dancebox/interfaces/augment-api-events.ts @@ -156,6 +156,21 @@ declare module "@polkadot/api-base/types/events" { dataPreservers: { /** The list of boot_nodes changed. */ BootNodesChanged: AugmentedEvent; + ProfileCreated: AugmentedEvent< + ApiType, + [account: AccountId32, profileId: u64, deposit: u128], + { account: AccountId32; profileId: u64; deposit: u128 } + >; + ProfileDeleted: AugmentedEvent< + ApiType, + [profileId: u64, releasedDeposit: u128], + { profileId: u64; releasedDeposit: u128 } + >; + ProfileUpdated: AugmentedEvent< + ApiType, + [profileId: u64, oldDeposit: u128, newDeposit: u128], + { profileId: u64; oldDeposit: u128; newDeposit: u128 } + >; /** Generic event */ [key: string]: AugmentedEvent; }; diff --git a/typescript-api/src/dancebox/interfaces/augment-api-query.ts b/typescript-api/src/dancebox/interfaces/augment-api-query.ts index 064768587..76d9c0909 100644 --- a/typescript-api/src/dancebox/interfaces/augment-api-query.ts +++ b/typescript-api/src/dancebox/interfaces/augment-api-query.ts @@ -53,6 +53,7 @@ import type { PalletBalancesIdAmountRuntimeHoldReason, PalletBalancesReserveData, PalletConfigurationHostConfiguration, + PalletDataPreserversRegisteredProfile, PalletIdentityAuthorityProperties, PalletIdentityRegistrarInfo, PalletIdentityRegistration, @@ -294,6 +295,13 @@ declare module "@polkadot/api-base/types/storage" { dataPreservers: { bootNodes: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; + nextProfileId: AugmentedQuery Observable, []> & QueryableStorageEntry; + profiles: AugmentedQuery< + ApiType, + (arg: u64 | AnyNumber | Uint8Array) => Observable>, + [u64] + > & + QueryableStorageEntry; /** Generic query */ [key: string]: QueryableStorageEntry; }; diff --git a/typescript-api/src/dancebox/interfaces/augment-api-tx.ts b/typescript-api/src/dancebox/interfaces/augment-api-tx.ts index 8ebe1d19c..e56694f96 100644 --- a/typescript-api/src/dancebox/interfaces/augment-api-tx.ts +++ b/typescript-api/src/dancebox/interfaces/augment-api-tx.ts @@ -23,6 +23,7 @@ import type { DanceboxRuntimeSessionKeys, DanceboxRuntimeStreamPaymentAssetId, DanceboxRuntimeXcmConfigRelayChain, + PalletDataPreserversProfile, PalletIdentityJudgement, PalletIdentityLegacyIdentityInfo, PalletMultisigTimepoint, @@ -287,6 +288,51 @@ declare module "@polkadot/api-base/types/submittable" { [key: string]: SubmittableExtrinsicFunction; }; dataPreservers: { + /** See [`Pallet::create_profile`]. */ + createProfile: AugmentedSubmittable< + ( + profile: + | PalletDataPreserversProfile + | { url?: any; paraIds?: any; mode?: any } + | string + | Uint8Array + ) => SubmittableExtrinsic, + [PalletDataPreserversProfile] + >; + /** See [`Pallet::delete_profile`]. */ + deleteProfile: AugmentedSubmittable< + (profileId: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, + [u64] + >; + /** See [`Pallet::force_create_profile`]. */ + forceCreateProfile: AugmentedSubmittable< + ( + profile: + | PalletDataPreserversProfile + | { url?: any; paraIds?: any; mode?: any } + | string + | Uint8Array, + forAccount: AccountId32 | string | Uint8Array + ) => SubmittableExtrinsic, + [PalletDataPreserversProfile, AccountId32] + >; + /** See [`Pallet::force_delete_profile`]. */ + forceDeleteProfile: AugmentedSubmittable< + (profileId: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, + [u64] + >; + /** See [`Pallet::force_update_profile`]. */ + forceUpdateProfile: AugmentedSubmittable< + ( + profileId: u64 | AnyNumber | Uint8Array, + profile: + | PalletDataPreserversProfile + | { url?: any; paraIds?: any; mode?: any } + | string + | Uint8Array + ) => SubmittableExtrinsic, + [u64, PalletDataPreserversProfile] + >; /** See [`Pallet::set_boot_nodes`]. */ setBootNodes: AugmentedSubmittable< ( @@ -295,6 +341,18 @@ declare module "@polkadot/api-base/types/submittable" { ) => SubmittableExtrinsic, [u32, Vec] >; + /** See [`Pallet::update_profile`]. */ + updateProfile: AugmentedSubmittable< + ( + profileId: u64 | AnyNumber | Uint8Array, + profile: + | PalletDataPreserversProfile + | { url?: any; paraIds?: any; mode?: any } + | string + | Uint8Array + ) => SubmittableExtrinsic, + [u64, PalletDataPreserversProfile] + >; /** Generic tx */ [key: string]: SubmittableExtrinsicFunction; }; diff --git a/typescript-api/src/dancebox/interfaces/lookup.ts b/typescript-api/src/dancebox/interfaces/lookup.ts index fc1849910..a999a4f6d 100644 --- a/typescript-api/src/dancebox/interfaces/lookup.ts +++ b/typescript-api/src/dancebox/interfaces/lookup.ts @@ -659,6 +659,20 @@ export default { BootNodesChanged: { paraId: "u32", }, + ProfileCreated: { + account: "AccountId32", + profileId: "u64", + deposit: "u128", + }, + ProfileUpdated: { + profileId: "u64", + oldDeposit: "u128", + newDeposit: "u128", + }, + ProfileDeleted: { + profileId: "u64", + releasedDeposit: "u128", + }, }, }, /** Lookup68: pallet_invulnerables::pallet::Event */ @@ -2711,9 +2725,53 @@ export default { paraId: "u32", bootNodes: "Vec", }, + create_profile: { + profile: "PalletDataPreserversProfile", + }, + update_profile: { + profileId: "u64", + profile: "PalletDataPreserversProfile", + }, + delete_profile: { + profileId: "u64", + }, + force_create_profile: { + profile: "PalletDataPreserversProfile", + forAccount: "AccountId32", + }, + force_update_profile: { + profileId: "u64", + profile: "PalletDataPreserversProfile", + }, + force_delete_profile: { + profileId: "u64", + }, + }, + }, + /** Lookup295: pallet_data_preservers::pallet::Profile */ + PalletDataPreserversProfile: { + url: "Bytes", + paraIds: "PalletDataPreserversParaIdsFilter", + mode: "PalletDataPreserversProfileMode", + }, + /** Lookup296: pallet_data_preservers::pallet::ParaIdsFilter */ + PalletDataPreserversParaIdsFilter: { + _enum: { + AnyParaId: "Null", + Whitelist: "Vec", + Blacklist: "Vec", + }, + }, + /** Lookup298: pallet_data_preservers::pallet::ProfileMode */ + PalletDataPreserversProfileMode: { + _enum: { + Bootnode: "Null", + Rpc: { + supportsEthereumRpcs: "bool", + }, }, }, - /** Lookup295: pallet_invulnerables::pallet::Call */ + /** Lookup299: pallet_invulnerables::pallet::Call */ PalletInvulnerablesCall: { _enum: { __Unused0: "Null", @@ -2725,7 +2783,7 @@ export default { }, }, }, - /** Lookup296: pallet_session::pallet::Call */ + /** Lookup300: pallet_session::pallet::Call */ PalletSessionCall: { _enum: { set_keys: { @@ -2738,19 +2796,19 @@ export default { purge_keys: "Null", }, }, - /** Lookup297: dancebox_runtime::SessionKeys */ + /** Lookup301: dancebox_runtime::SessionKeys */ DanceboxRuntimeSessionKeys: { nimbus: "NimbusPrimitivesNimbusCryptoPublic", }, - /** Lookup298: nimbus_primitives::nimbus_crypto::Public */ + /** Lookup302: nimbus_primitives::nimbus_crypto::Public */ NimbusPrimitivesNimbusCryptoPublic: "SpCoreSr25519Public", - /** Lookup299: sp_core::sr25519::Public */ + /** Lookup303: sp_core::sr25519::Public */ SpCoreSr25519Public: "[u8;32]", - /** Lookup300: pallet_author_inherent::pallet::Call */ + /** Lookup304: pallet_author_inherent::pallet::Call */ PalletAuthorInherentCall: { _enum: ["kick_off_authorship_validation"], }, - /** Lookup301: pallet_pooled_staking::pallet::Call */ + /** Lookup305: pallet_pooled_staking::pallet::Call */ PalletPooledStakingCall: { _enum: { rebalance_hold: { @@ -2784,16 +2842,16 @@ export default { }, }, }, - /** Lookup302: pallet_pooled_staking::pallet::AllTargetPool */ + /** Lookup306: pallet_pooled_staking::pallet::AllTargetPool */ PalletPooledStakingAllTargetPool: { _enum: ["Joining", "AutoCompounding", "ManualRewards", "Leaving"], }, - /** Lookup304: pallet_pooled_staking::pallet::PendingOperationQuery */ + /** Lookup308: pallet_pooled_staking::pallet::PendingOperationQuery */ PalletPooledStakingPendingOperationQuery: { delegator: "AccountId32", operation: "PalletPooledStakingPendingOperationKey", }, - /** Lookup305: pallet_pooled_staking::pallet::PendingOperationKey */ + /** Lookup309: pallet_pooled_staking::pallet::PendingOperationKey */ PalletPooledStakingPendingOperationKey: { _enum: { JoiningAutoCompounding: { @@ -2810,14 +2868,14 @@ export default { }, }, }, - /** Lookup306: pallet_pooled_staking::pallet::SharesOrStake */ + /** Lookup310: pallet_pooled_staking::pallet::SharesOrStake */ PalletPooledStakingSharesOrStake: { _enum: { Shares: "u128", Stake: "u128", }, }, - /** Lookup309: pallet_treasury::pallet::Call */ + /** Lookup313: pallet_treasury::pallet::Call */ PalletTreasuryCall: { _enum: { propose_spend: { @@ -2854,7 +2912,7 @@ export default { }, }, }, - /** Lookup310: cumulus_pallet_xcmp_queue::pallet::Call */ + /** Lookup314: cumulus_pallet_xcmp_queue::pallet::Call */ CumulusPalletXcmpQueueCall: { _enum: { __Unused0: "Null", @@ -2880,9 +2938,9 @@ export default { }, }, }, - /** Lookup311: cumulus_pallet_dmp_queue::pallet::Call */ + /** Lookup315: cumulus_pallet_dmp_queue::pallet::Call */ CumulusPalletDmpQueueCall: "Null", - /** Lookup312: pallet_xcm::pallet::Call */ + /** Lookup316: pallet_xcm::pallet::Call */ PalletXcmCall: { _enum: { send: { @@ -2944,7 +3002,7 @@ export default { }, }, }, - /** Lookup313: xcm::VersionedXcm */ + /** Lookup317: xcm::VersionedXcm */ XcmVersionedXcm: { _enum: { __Unused0: "Null", @@ -2953,9 +3011,9 @@ export default { V3: "XcmV3Xcm", }, }, - /** Lookup314: xcm::v2::Xcm */ + /** Lookup318: xcm::v2::Xcm */ XcmV2Xcm: "Vec", - /** Lookup316: xcm::v2::Instruction */ + /** Lookup320: xcm::v2::Instruction */ XcmV2Instruction: { _enum: { WithdrawAsset: "XcmV2MultiassetMultiAssets", @@ -3051,7 +3109,7 @@ export default { UnsubscribeVersion: "Null", }, }, - /** Lookup317: xcm::v2::Response */ + /** Lookup321: xcm::v2::Response */ XcmV2Response: { _enum: { Null: "Null", @@ -3060,7 +3118,7 @@ export default { Version: "u32", }, }, - /** Lookup320: xcm::v2::traits::Error */ + /** Lookup324: xcm::v2::traits::Error */ XcmV2TraitsError: { _enum: { Overflow: "Null", @@ -3091,14 +3149,14 @@ export default { WeightNotComputable: "Null", }, }, - /** Lookup321: xcm::v2::multiasset::MultiAssetFilter */ + /** Lookup325: xcm::v2::multiasset::MultiAssetFilter */ XcmV2MultiassetMultiAssetFilter: { _enum: { Definite: "XcmV2MultiassetMultiAssets", Wild: "XcmV2MultiassetWildMultiAsset", }, }, - /** Lookup322: xcm::v2::multiasset::WildMultiAsset */ + /** Lookup326: xcm::v2::multiasset::WildMultiAsset */ XcmV2MultiassetWildMultiAsset: { _enum: { All: "Null", @@ -3108,18 +3166,18 @@ export default { }, }, }, - /** Lookup323: xcm::v2::multiasset::WildFungibility */ + /** Lookup327: xcm::v2::multiasset::WildFungibility */ XcmV2MultiassetWildFungibility: { _enum: ["Fungible", "NonFungible"], }, - /** Lookup324: xcm::v2::WeightLimit */ + /** Lookup328: xcm::v2::WeightLimit */ XcmV2WeightLimit: { _enum: { Unlimited: "Null", Limited: "Compact", }, }, - /** Lookup333: pallet_assets::pallet::Call */ + /** Lookup337: pallet_assets::pallet::Call */ PalletAssetsCall: { _enum: { create: { @@ -3269,7 +3327,7 @@ export default { }, }, }, - /** Lookup334: pallet_foreign_asset_creator::pallet::Call */ + /** Lookup338: pallet_foreign_asset_creator::pallet::Call */ PalletForeignAssetCreatorCall: { _enum: { create_foreign_asset: { @@ -3291,7 +3349,7 @@ export default { }, }, }, - /** Lookup335: pallet_asset_rate::pallet::Call */ + /** Lookup339: pallet_asset_rate::pallet::Call */ PalletAssetRateCall: { _enum: { create: { @@ -3307,7 +3365,7 @@ export default { }, }, }, - /** Lookup336: pallet_message_queue::pallet::Call */ + /** Lookup340: pallet_message_queue::pallet::Call */ PalletMessageQueueCall: { _enum: { reap_page: { @@ -3322,7 +3380,7 @@ export default { }, }, }, - /** Lookup337: pallet_xcm_core_buyer::pallet::Call */ + /** Lookup341: pallet_xcm_core_buyer::pallet::Call */ PalletXcmCoreBuyerCall: { _enum: { buy_core: { @@ -3350,21 +3408,21 @@ export default { }, }, }, - /** Lookup338: pallet_xcm_core_buyer::pallet::BuyCoreCollatorProof */ + /** Lookup342: pallet_xcm_core_buyer::pallet::BuyCoreCollatorProof */ PalletXcmCoreBuyerBuyCoreCollatorProof: { account: "AccountId32", signature: "Null", }, - /** Lookup340: pallet_xcm_core_buyer::pallet::RelayXcmWeightConfigInner */ + /** Lookup344: pallet_xcm_core_buyer::pallet::RelayXcmWeightConfigInner */ PalletXcmCoreBuyerRelayXcmWeightConfigInner: { buyExecutionCost: "u128", weightAtMost: "SpWeightsWeightV2Weight", }, - /** Lookup342: dancebox_runtime::xcm_config::RelayChain */ + /** Lookup346: dancebox_runtime::xcm_config::RelayChain */ DanceboxRuntimeXcmConfigRelayChain: { _enum: ["Westend", "Rococo"], }, - /** Lookup343: pallet_root_testing::pallet::Call */ + /** Lookup347: pallet_root_testing::pallet::Call */ PalletRootTestingCall: { _enum: { fill_block: { @@ -3373,27 +3431,27 @@ export default { trigger_defensive: "Null", }, }, - /** Lookup344: pallet_sudo::pallet::Error */ + /** Lookup348: pallet_sudo::pallet::Error */ PalletSudoError: { _enum: ["RequireSudo"], }, - /** Lookup345: pallet_utility::pallet::Error */ + /** Lookup349: pallet_utility::pallet::Error */ PalletUtilityError: { _enum: ["TooManyCalls"], }, - /** Lookup348: pallet_proxy::ProxyDefinition */ + /** Lookup352: pallet_proxy::ProxyDefinition */ PalletProxyProxyDefinition: { delegate: "AccountId32", proxyType: "DanceboxRuntimeProxyType", delay: "u32", }, - /** Lookup352: pallet_proxy::Announcement */ + /** Lookup356: pallet_proxy::Announcement */ PalletProxyAnnouncement: { real: "AccountId32", callHash: "H256", height: "u32", }, - /** Lookup354: pallet_proxy::pallet::Error */ + /** Lookup358: pallet_proxy::pallet::Error */ PalletProxyError: { _enum: [ "TooMany", @@ -3406,39 +3464,39 @@ export default { "NoSelfProxy", ], }, - /** Lookup355: pallet_migrations::pallet::Error */ + /** Lookup359: pallet_migrations::pallet::Error */ PalletMigrationsError: { _enum: ["PreimageMissing", "WrongUpperBound", "PreimageIsTooBig", "PreimageAlreadyExists"], }, - /** Lookup356: pallet_maintenance_mode::pallet::Error */ + /** Lookup360: pallet_maintenance_mode::pallet::Error */ PalletMaintenanceModeError: { _enum: ["AlreadyInMaintenanceMode", "NotInMaintenanceMode"], }, - /** Lookup357: pallet_tx_pause::pallet::Error */ + /** Lookup361: pallet_tx_pause::pallet::Error */ PalletTxPauseError: { _enum: ["IsPaused", "IsUnpaused", "Unpausable", "NotFound"], }, - /** Lookup359: pallet_balances::types::BalanceLock */ + /** Lookup363: pallet_balances::types::BalanceLock */ PalletBalancesBalanceLock: { id: "[u8;8]", amount: "u128", reasons: "PalletBalancesReasons", }, - /** Lookup360: pallet_balances::types::Reasons */ + /** Lookup364: pallet_balances::types::Reasons */ PalletBalancesReasons: { _enum: ["Fee", "Misc", "All"], }, - /** Lookup363: pallet_balances::types::ReserveData */ + /** Lookup367: pallet_balances::types::ReserveData */ PalletBalancesReserveData: { id: "[u8;8]", amount: "u128", }, - /** Lookup366: pallet_balances::types::IdAmount */ + /** Lookup370: pallet_balances::types::IdAmount */ PalletBalancesIdAmountRuntimeHoldReason: { id: "DanceboxRuntimeRuntimeHoldReason", amount: "u128", }, - /** Lookup367: dancebox_runtime::RuntimeHoldReason */ + /** Lookup371: dancebox_runtime::RuntimeHoldReason */ DanceboxRuntimeRuntimeHoldReason: { _enum: { __Unused0: "Null", @@ -3468,7 +3526,7 @@ export default { __Unused24: "Null", __Unused25: "Null", __Unused26: "Null", - __Unused27: "Null", + DataPreservers: "PalletDataPreserversHoldReason", __Unused28: "Null", __Unused29: "Null", __Unused30: "Null", @@ -3478,20 +3536,24 @@ export default { PooledStaking: "PalletPooledStakingHoldReason", }, }, - /** Lookup368: pallet_stream_payment::pallet::HoldReason */ + /** Lookup372: pallet_stream_payment::pallet::HoldReason */ PalletStreamPaymentHoldReason: { _enum: ["StreamPayment", "StreamOpened"], }, - /** Lookup369: pallet_pooled_staking::pallet::HoldReason */ + /** Lookup373: pallet_data_preservers::pallet::HoldReason */ + PalletDataPreserversHoldReason: { + _enum: ["ProfileDeposit"], + }, + /** Lookup374: pallet_pooled_staking::pallet::HoldReason */ PalletPooledStakingHoldReason: { _enum: ["PooledStake"], }, - /** Lookup372: pallet_balances::types::IdAmount */ + /** Lookup377: pallet_balances::types::IdAmount */ PalletBalancesIdAmountRuntimeFreezeReason: { id: "DanceboxRuntimeRuntimeFreezeReason", amount: "u128", }, - /** Lookup373: dancebox_runtime::RuntimeFreezeReason */ + /** Lookup378: dancebox_runtime::RuntimeFreezeReason */ DanceboxRuntimeRuntimeFreezeReason: { _enum: { __Unused0: "Null", @@ -3509,11 +3571,11 @@ export default { StreamPayment: "PalletStreamPaymentFreezeReason", }, }, - /** Lookup374: pallet_stream_payment::pallet::FreezeReason */ + /** Lookup379: pallet_stream_payment::pallet::FreezeReason */ PalletStreamPaymentFreezeReason: { _enum: ["StreamPayment"], }, - /** Lookup376: pallet_balances::pallet::Error */ + /** Lookup381: pallet_balances::pallet::Error */ PalletBalancesError: { _enum: [ "VestingBalance", @@ -3528,12 +3590,12 @@ export default { "TooManyFreezes", ], }, - /** Lookup377: pallet_transaction_payment::Releases */ + /** Lookup382: pallet_transaction_payment::Releases */ PalletTransactionPaymentReleases: { _enum: ["V1Ancient", "V2"], }, /** - * Lookup378: pallet_stream_payment::pallet::Stream */ PalletStreamPaymentStream: { @@ -3547,7 +3609,7 @@ export default { openingDeposit: "u128", }, /** - * Lookup380: pallet_stream_payment::pallet::ChangeRequest */ PalletStreamPaymentChangeRequest: { @@ -3556,7 +3618,7 @@ export default { newConfig: "PalletStreamPaymentStreamConfig", depositChange: "Option", }, - /** Lookup382: pallet_stream_payment::pallet::Error */ + /** Lookup387: pallet_stream_payment::pallet::Error */ PalletStreamPaymentError: { _enum: [ "UnknownStreamId", @@ -3576,24 +3638,24 @@ export default { "ImmediateDepositChangeRequiresSameAssetId", ], }, - /** Lookup384: pallet_identity::types::Registration> */ + /** Lookup389: pallet_identity::types::Registration> */ PalletIdentityRegistration: { judgements: "Vec<(u32,PalletIdentityJudgement)>", deposit: "u128", info: "PalletIdentityLegacyIdentityInfo", }, - /** Lookup393: pallet_identity::types::RegistrarInfo */ + /** Lookup398: pallet_identity::types::RegistrarInfo */ PalletIdentityRegistrarInfo: { account: "AccountId32", fee: "u128", fields: "u64", }, - /** Lookup395: pallet_identity::types::AuthorityProperties> */ + /** Lookup400: pallet_identity::types::AuthorityProperties> */ PalletIdentityAuthorityProperties: { suffix: "Bytes", allocation: "u32", }, - /** Lookup398: pallet_identity::pallet::Error */ + /** Lookup403: pallet_identity::pallet::Error */ PalletIdentityError: { _enum: [ "TooManySubAccounts", @@ -3624,14 +3686,14 @@ export default { "NotExpired", ], }, - /** Lookup400: pallet_multisig::Multisig */ + /** Lookup405: pallet_multisig::Multisig */ PalletMultisigMultisig: { when: "PalletMultisigTimepoint", deposit: "u128", depositor: "AccountId32", approvals: "Vec", }, - /** Lookup402: pallet_multisig::pallet::Error */ + /** Lookup407: pallet_multisig::pallet::Error */ PalletMultisigError: { _enum: [ "MinimumThreshold", @@ -3650,16 +3712,16 @@ export default { "AlreadyStored", ], }, - /** Lookup406: tp_traits::ParathreadParams */ + /** Lookup410: tp_traits::ParathreadParams */ TpTraitsParathreadParams: { slotFrequency: "TpTraitsSlotFrequency", }, - /** Lookup412: pallet_registrar::pallet::DepositInfo */ + /** Lookup416: pallet_registrar::pallet::DepositInfo */ PalletRegistrarDepositInfo: { creator: "AccountId32", deposit: "u128", }, - /** Lookup413: pallet_registrar::pallet::Error */ + /** Lookup417: pallet_registrar::pallet::Error */ PalletRegistrarError: { _enum: [ "ParaIdAlreadyRegistered", @@ -3675,7 +3737,7 @@ export default { "NotParaCreator", ], }, - /** Lookup414: pallet_configuration::HostConfiguration */ + /** Lookup418: pallet_configuration::HostConfiguration */ PalletConfigurationHostConfiguration: { maxCollators: "u32", minOrchestratorCollators: "u32", @@ -3686,22 +3748,22 @@ export default { parathreadsPerCollator: "u32", targetContainerChainFullness: "Perbill", }, - /** Lookup417: pallet_configuration::pallet::Error */ + /** Lookup421: pallet_configuration::pallet::Error */ PalletConfigurationError: { _enum: ["InvalidNewValue"], }, - /** Lookup418: dp_collator_assignment::AssignedCollators */ + /** Lookup422: dp_collator_assignment::AssignedCollators */ DpCollatorAssignmentAssignedCollatorsAccountId32: { orchestratorChain: "Vec", containerChains: "BTreeMap>", }, - /** Lookup423: pallet_author_noting::pallet::ContainerChainBlockInfo */ + /** Lookup427: pallet_author_noting::pallet::ContainerChainBlockInfo */ PalletAuthorNotingContainerChainBlockInfo: { blockNumber: "u32", author: "AccountId32", latestSlotNumber: "u64", }, - /** Lookup424: pallet_author_noting::pallet::Error */ + /** Lookup428: pallet_author_noting::pallet::Error */ PalletAuthorNotingError: { _enum: [ "FailedReading", @@ -3713,20 +3775,26 @@ export default { "NonAuraDigest", ], }, - /** Lookup425: dp_collator_assignment::AssignedCollators */ + /** Lookup429: dp_collator_assignment::AssignedCollators */ DpCollatorAssignmentAssignedCollatorsPublic: { orchestratorChain: "Vec", containerChains: "BTreeMap>", }, - /** Lookup430: pallet_services_payment::pallet::Error */ + /** Lookup434: pallet_services_payment::pallet::Error */ PalletServicesPaymentError: { _enum: ["InsufficientFundsToPurchaseCredits", "InsufficientCredits", "CreditPriceTooExpensive"], }, - /** Lookup431: pallet_data_preservers::pallet::Error */ + /** Lookup435: pallet_data_preservers::pallet::RegisteredProfile */ + PalletDataPreserversRegisteredProfile: { + account: "AccountId32", + deposit: "u128", + profile: "PalletDataPreserversProfile", + }, + /** Lookup436: pallet_data_preservers::pallet::Error */ PalletDataPreserversError: { - _enum: ["NoBootNodes"], + _enum: ["NoBootNodes", "UnknownProfileId", "NextProfileIdShouldBeAvailable"], }, - /** Lookup433: pallet_invulnerables::pallet::Error */ + /** Lookup438: pallet_invulnerables::pallet::Error */ PalletInvulnerablesError: { _enum: [ "TooManyInvulnerables", @@ -3736,22 +3804,22 @@ export default { "UnableToDeriveCollatorId", ], }, - /** Lookup438: sp_core::crypto::KeyTypeId */ + /** Lookup443: sp_core::crypto::KeyTypeId */ SpCoreCryptoKeyTypeId: "[u8;4]", - /** Lookup439: pallet_session::pallet::Error */ + /** Lookup444: pallet_session::pallet::Error */ PalletSessionError: { _enum: ["InvalidProof", "NoAssociatedValidatorId", "DuplicatedKey", "NoKeys", "NoAccount"], }, - /** Lookup443: pallet_author_inherent::pallet::Error */ + /** Lookup448: pallet_author_inherent::pallet::Error */ PalletAuthorInherentError: { _enum: ["AuthorAlreadySet", "NoAccountId", "CannotBeAuthor"], }, - /** Lookup445: pallet_pooled_staking::candidate::EligibleCandidate */ + /** Lookup450: pallet_pooled_staking::candidate::EligibleCandidate */ PalletPooledStakingCandidateEligibleCandidate: { candidate: "AccountId32", stake: "u128", }, - /** Lookup448: pallet_pooled_staking::pallet::PoolsKey */ + /** Lookup453: pallet_pooled_staking::pallet::PoolsKey */ PalletPooledStakingPoolsKey: { _enum: { CandidateTotalStake: "Null", @@ -3793,7 +3861,7 @@ export default { }, }, }, - /** Lookup450: pallet_pooled_staking::pallet::Error */ + /** Lookup455: pallet_pooled_staking::pallet::Error */ PalletPooledStakingError: { _enum: { InvalidPalletSetting: "Null", @@ -3812,19 +3880,19 @@ export default { SwapResultsInZeroShares: "Null", }, }, - /** Lookup451: pallet_inflation_rewards::pallet::ChainsToRewardValue */ + /** Lookup456: pallet_inflation_rewards::pallet::ChainsToRewardValue */ PalletInflationRewardsChainsToRewardValue: { paraIds: "Vec", rewardsPerChain: "u128", }, - /** Lookup452: pallet_treasury::Proposal */ + /** Lookup457: pallet_treasury::Proposal */ PalletTreasuryProposal: { proposer: "AccountId32", value: "u128", beneficiary: "AccountId32", bond: "u128", }, - /** Lookup454: pallet_treasury::SpendStatus */ + /** Lookup459: pallet_treasury::SpendStatus */ PalletTreasurySpendStatus: { assetKind: "Null", amount: "u128", @@ -3833,7 +3901,7 @@ export default { expireAt: "u32", status: "PalletTreasuryPaymentState", }, - /** Lookup455: pallet_treasury::PaymentState */ + /** Lookup460: pallet_treasury::PaymentState */ PalletTreasuryPaymentState: { _enum: { Pending: "Null", @@ -3843,9 +3911,9 @@ export default { Failed: "Null", }, }, - /** Lookup457: frame_support::PalletId */ + /** Lookup462: frame_support::PalletId */ FrameSupportPalletId: "[u8;8]", - /** Lookup458: pallet_treasury::pallet::Error */ + /** Lookup463: pallet_treasury::pallet::Error */ PalletTreasuryError: { _enum: [ "InsufficientProposersBalance", @@ -3862,7 +3930,7 @@ export default { "Inconclusive", ], }, - /** Lookup462: cumulus_pallet_xcmp_queue::OutboundChannelDetails */ + /** Lookup467: cumulus_pallet_xcmp_queue::OutboundChannelDetails */ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: "u32", state: "CumulusPalletXcmpQueueOutboundState", @@ -3870,21 +3938,21 @@ export default { firstIndex: "u16", lastIndex: "u16", }, - /** Lookup463: cumulus_pallet_xcmp_queue::OutboundState */ + /** Lookup468: cumulus_pallet_xcmp_queue::OutboundState */ CumulusPalletXcmpQueueOutboundState: { _enum: ["Ok", "Suspended"], }, - /** Lookup465: cumulus_pallet_xcmp_queue::QueueConfigData */ + /** Lookup470: cumulus_pallet_xcmp_queue::QueueConfigData */ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: "u32", dropThreshold: "u32", resumeThreshold: "u32", }, - /** Lookup466: cumulus_pallet_xcmp_queue::pallet::Error */ + /** Lookup471: cumulus_pallet_xcmp_queue::pallet::Error */ CumulusPalletXcmpQueueError: { _enum: ["BadQueueConfig", "AlreadySuspended", "AlreadyResumed"], }, - /** Lookup467: cumulus_pallet_dmp_queue::pallet::MigrationState */ + /** Lookup472: cumulus_pallet_dmp_queue::pallet::MigrationState */ CumulusPalletDmpQueueMigrationState: { _enum: { NotStarted: "Null", @@ -3902,7 +3970,7 @@ export default { Completed: "Null", }, }, - /** Lookup470: pallet_xcm::pallet::QueryStatus */ + /** Lookup475: pallet_xcm::pallet::QueryStatus */ PalletXcmQueryStatus: { _enum: { Pending: { @@ -3921,7 +3989,7 @@ export default { }, }, }, - /** Lookup474: xcm::VersionedResponse */ + /** Lookup479: xcm::VersionedResponse */ XcmVersionedResponse: { _enum: { __Unused0: "Null", @@ -3930,7 +3998,7 @@ export default { V3: "XcmV3Response", }, }, - /** Lookup480: pallet_xcm::pallet::VersionMigrationStage */ + /** Lookup485: pallet_xcm::pallet::VersionMigrationStage */ PalletXcmVersionMigrationStage: { _enum: { MigrateSupportedVersion: "Null", @@ -3939,7 +4007,7 @@ export default { MigrateAndNotifyOldTargets: "Null", }, }, - /** Lookup482: xcm::VersionedAssetId */ + /** Lookup487: xcm::VersionedAssetId */ XcmVersionedAssetId: { _enum: { __Unused0: "Null", @@ -3948,14 +4016,14 @@ export default { V3: "XcmV3MultiassetAssetId", }, }, - /** Lookup483: pallet_xcm::pallet::RemoteLockedFungibleRecord */ + /** Lookup488: pallet_xcm::pallet::RemoteLockedFungibleRecord */ PalletXcmRemoteLockedFungibleRecord: { amount: "u128", owner: "XcmVersionedMultiLocation", locker: "XcmVersionedMultiLocation", consumers: "Vec<(Null,u128)>", }, - /** Lookup490: pallet_xcm::pallet::Error */ + /** Lookup495: pallet_xcm::pallet::Error */ PalletXcmError: { _enum: [ "Unreachable", @@ -3985,7 +4053,7 @@ export default { "LocalExecutionIncomplete", ], }, - /** Lookup491: pallet_assets::types::AssetDetails */ + /** Lookup496: pallet_assets::types::AssetDetails */ PalletAssetsAssetDetails: { owner: "AccountId32", issuer: "AccountId32", @@ -4000,22 +4068,22 @@ export default { approvals: "u32", status: "PalletAssetsAssetStatus", }, - /** Lookup492: pallet_assets::types::AssetStatus */ + /** Lookup497: pallet_assets::types::AssetStatus */ PalletAssetsAssetStatus: { _enum: ["Live", "Frozen", "Destroying"], }, - /** Lookup494: pallet_assets::types::AssetAccount */ + /** Lookup499: pallet_assets::types::AssetAccount */ PalletAssetsAssetAccount: { balance: "u128", status: "PalletAssetsAccountStatus", reason: "PalletAssetsExistenceReason", extra: "Null", }, - /** Lookup495: pallet_assets::types::AccountStatus */ + /** Lookup500: pallet_assets::types::AccountStatus */ PalletAssetsAccountStatus: { _enum: ["Liquid", "Frozen", "Blocked"], }, - /** Lookup496: pallet_assets::types::ExistenceReason */ + /** Lookup501: pallet_assets::types::ExistenceReason */ PalletAssetsExistenceReason: { _enum: { Consumer: "Null", @@ -4025,12 +4093,12 @@ export default { DepositFrom: "(AccountId32,u128)", }, }, - /** Lookup498: pallet_assets::types::Approval */ + /** Lookup503: pallet_assets::types::Approval */ PalletAssetsApproval: { amount: "u128", deposit: "u128", }, - /** Lookup499: pallet_assets::types::AssetMetadata> */ + /** Lookup504: pallet_assets::types::AssetMetadata> */ PalletAssetsAssetMetadata: { deposit: "u128", name: "Bytes", @@ -4038,7 +4106,7 @@ export default { decimals: "u8", isFrozen: "bool", }, - /** Lookup501: pallet_assets::pallet::Error */ + /** Lookup506: pallet_assets::pallet::Error */ PalletAssetsError: { _enum: [ "BalanceLow", @@ -4063,15 +4131,15 @@ export default { "CallbackFailed", ], }, - /** Lookup502: pallet_foreign_asset_creator::pallet::Error */ + /** Lookup507: pallet_foreign_asset_creator::pallet::Error */ PalletForeignAssetCreatorError: { _enum: ["AssetAlreadyExists", "AssetDoesNotExist"], }, - /** Lookup503: pallet_asset_rate::pallet::Error */ + /** Lookup508: pallet_asset_rate::pallet::Error */ PalletAssetRateError: { _enum: ["UnknownAssetKind", "AlreadyExists", "Overflow"], }, - /** Lookup504: pallet_message_queue::BookState */ + /** Lookup509: pallet_message_queue::BookState */ PalletMessageQueueBookState: { _alias: { size_: "size", @@ -4083,12 +4151,12 @@ export default { messageCount: "u64", size_: "u64", }, - /** Lookup506: pallet_message_queue::Neighbours */ + /** Lookup511: pallet_message_queue::Neighbours */ PalletMessageQueueNeighbours: { prev: "CumulusPrimitivesCoreAggregateMessageOrigin", next: "CumulusPrimitivesCoreAggregateMessageOrigin", }, - /** Lookup508: pallet_message_queue::Page */ + /** Lookup513: pallet_message_queue::Page */ PalletMessageQueuePage: { remaining: "u32", remainingSize: "u32", @@ -4097,7 +4165,7 @@ export default { last: "u32", heap: "Bytes", }, - /** Lookup510: pallet_message_queue::pallet::Error */ + /** Lookup515: pallet_message_queue::pallet::Error */ PalletMessageQueueError: { _enum: [ "NotReapable", @@ -4111,13 +4179,13 @@ export default { "RecursiveDisallowed", ], }, - /** Lookup511: pallet_xcm_core_buyer::InFlightCoreBuyingOrder */ + /** Lookup516: pallet_xcm_core_buyer::InFlightCoreBuyingOrder */ PalletXcmCoreBuyerInFlightCoreBuyingOrder: { paraId: "u32", queryId: "u64", ttl: "u32", }, - /** Lookup512: pallet_xcm_core_buyer::pallet::Error */ + /** Lookup517: pallet_xcm_core_buyer::pallet::Error */ PalletXcmCoreBuyerError: { _enum: [ "InvalidProof", @@ -4136,20 +4204,20 @@ export default { "BlockProductionPending", ], }, - /** Lookup517: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender */ + /** Lookup522: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender */ FrameSystemExtensionsCheckNonZeroSender: "Null", - /** Lookup518: frame_system::extensions::check_spec_version::CheckSpecVersion */ + /** Lookup523: frame_system::extensions::check_spec_version::CheckSpecVersion */ FrameSystemExtensionsCheckSpecVersion: "Null", - /** Lookup519: frame_system::extensions::check_tx_version::CheckTxVersion */ + /** Lookup524: frame_system::extensions::check_tx_version::CheckTxVersion */ FrameSystemExtensionsCheckTxVersion: "Null", - /** Lookup520: frame_system::extensions::check_genesis::CheckGenesis */ + /** Lookup525: frame_system::extensions::check_genesis::CheckGenesis */ FrameSystemExtensionsCheckGenesis: "Null", - /** Lookup523: frame_system::extensions::check_nonce::CheckNonce */ + /** Lookup528: frame_system::extensions::check_nonce::CheckNonce */ FrameSystemExtensionsCheckNonce: "Compact", - /** Lookup524: frame_system::extensions::check_weight::CheckWeight */ + /** Lookup529: frame_system::extensions::check_weight::CheckWeight */ FrameSystemExtensionsCheckWeight: "Null", - /** Lookup525: pallet_transaction_payment::ChargeTransactionPayment */ + /** Lookup530: pallet_transaction_payment::ChargeTransactionPayment */ PalletTransactionPaymentChargeTransactionPayment: "Compact", - /** Lookup526: dancebox_runtime::Runtime */ + /** Lookup531: dancebox_runtime::Runtime */ DanceboxRuntimeRuntime: "Null", }; diff --git a/typescript-api/src/dancebox/interfaces/registry.ts b/typescript-api/src/dancebox/interfaces/registry.ts index dc3a0f009..349fec8a1 100644 --- a/typescript-api/src/dancebox/interfaces/registry.ts +++ b/typescript-api/src/dancebox/interfaces/registry.ts @@ -104,6 +104,11 @@ import type { PalletDataPreserversCall, PalletDataPreserversError, PalletDataPreserversEvent, + PalletDataPreserversHoldReason, + PalletDataPreserversParaIdsFilter, + PalletDataPreserversProfile, + PalletDataPreserversProfileMode, + PalletDataPreserversRegisteredProfile, PalletForeignAssetCreatorCall, PalletForeignAssetCreatorError, PalletForeignAssetCreatorEvent, @@ -393,6 +398,11 @@ declare module "@polkadot/types/types/registry" { PalletDataPreserversCall: PalletDataPreserversCall; PalletDataPreserversError: PalletDataPreserversError; PalletDataPreserversEvent: PalletDataPreserversEvent; + PalletDataPreserversHoldReason: PalletDataPreserversHoldReason; + PalletDataPreserversParaIdsFilter: PalletDataPreserversParaIdsFilter; + PalletDataPreserversProfile: PalletDataPreserversProfile; + PalletDataPreserversProfileMode: PalletDataPreserversProfileMode; + PalletDataPreserversRegisteredProfile: PalletDataPreserversRegisteredProfile; PalletForeignAssetCreatorCall: PalletForeignAssetCreatorCall; PalletForeignAssetCreatorError: PalletForeignAssetCreatorError; PalletForeignAssetCreatorEvent: PalletForeignAssetCreatorEvent; diff --git a/typescript-api/src/dancebox/interfaces/types-lookup.ts b/typescript-api/src/dancebox/interfaces/types-lookup.ts index cf18ddfe6..69738c787 100644 --- a/typescript-api/src/dancebox/interfaces/types-lookup.ts +++ b/typescript-api/src/dancebox/interfaces/types-lookup.ts @@ -935,7 +935,24 @@ declare module "@polkadot/types/lookup" { readonly asBootNodesChanged: { readonly paraId: u32; } & Struct; - readonly type: "BootNodesChanged"; + readonly isProfileCreated: boolean; + readonly asProfileCreated: { + readonly account: AccountId32; + readonly profileId: u64; + readonly deposit: u128; + } & Struct; + readonly isProfileUpdated: boolean; + readonly asProfileUpdated: { + readonly profileId: u64; + readonly oldDeposit: u128; + readonly newDeposit: u128; + } & Struct; + readonly isProfileDeleted: boolean; + readonly asProfileDeleted: { + readonly profileId: u64; + readonly releasedDeposit: u128; + } & Struct; + readonly type: "BootNodesChanged" | "ProfileCreated" | "ProfileUpdated" | "ProfileDeleted"; } /** @name PalletInvulnerablesEvent (68) */ @@ -3634,10 +3651,71 @@ declare module "@polkadot/types/lookup" { readonly paraId: u32; readonly bootNodes: Vec; } & Struct; - readonly type: "SetBootNodes"; + readonly isCreateProfile: boolean; + readonly asCreateProfile: { + readonly profile: PalletDataPreserversProfile; + } & Struct; + readonly isUpdateProfile: boolean; + readonly asUpdateProfile: { + readonly profileId: u64; + readonly profile: PalletDataPreserversProfile; + } & Struct; + readonly isDeleteProfile: boolean; + readonly asDeleteProfile: { + readonly profileId: u64; + } & Struct; + readonly isForceCreateProfile: boolean; + readonly asForceCreateProfile: { + readonly profile: PalletDataPreserversProfile; + readonly forAccount: AccountId32; + } & Struct; + readonly isForceUpdateProfile: boolean; + readonly asForceUpdateProfile: { + readonly profileId: u64; + readonly profile: PalletDataPreserversProfile; + } & Struct; + readonly isForceDeleteProfile: boolean; + readonly asForceDeleteProfile: { + readonly profileId: u64; + } & Struct; + readonly type: + | "SetBootNodes" + | "CreateProfile" + | "UpdateProfile" + | "DeleteProfile" + | "ForceCreateProfile" + | "ForceUpdateProfile" + | "ForceDeleteProfile"; } - /** @name PalletInvulnerablesCall (295) */ + /** @name PalletDataPreserversProfile (295) */ + interface PalletDataPreserversProfile extends Struct { + readonly url: Bytes; + readonly paraIds: PalletDataPreserversParaIdsFilter; + readonly mode: PalletDataPreserversProfileMode; + } + + /** @name PalletDataPreserversParaIdsFilter (296) */ + interface PalletDataPreserversParaIdsFilter extends Enum { + readonly isAnyParaId: boolean; + readonly isWhitelist: boolean; + readonly asWhitelist: Vec; + readonly isBlacklist: boolean; + readonly asBlacklist: Vec; + readonly type: "AnyParaId" | "Whitelist" | "Blacklist"; + } + + /** @name PalletDataPreserversProfileMode (298) */ + interface PalletDataPreserversProfileMode extends Enum { + readonly isBootnode: boolean; + readonly isRpc: boolean; + readonly asRpc: { + readonly supportsEthereumRpcs: bool; + } & Struct; + readonly type: "Bootnode" | "Rpc"; + } + + /** @name PalletInvulnerablesCall (299) */ interface PalletInvulnerablesCall extends Enum { readonly isAddInvulnerable: boolean; readonly asAddInvulnerable: { @@ -3650,7 +3728,7 @@ declare module "@polkadot/types/lookup" { readonly type: "AddInvulnerable" | "RemoveInvulnerable"; } - /** @name PalletSessionCall (296) */ + /** @name PalletSessionCall (300) */ interface PalletSessionCall extends Enum { readonly isSetKeys: boolean; readonly asSetKeys: { @@ -3661,24 +3739,24 @@ declare module "@polkadot/types/lookup" { readonly type: "SetKeys" | "PurgeKeys"; } - /** @name DanceboxRuntimeSessionKeys (297) */ + /** @name DanceboxRuntimeSessionKeys (301) */ interface DanceboxRuntimeSessionKeys extends Struct { readonly nimbus: NimbusPrimitivesNimbusCryptoPublic; } - /** @name NimbusPrimitivesNimbusCryptoPublic (298) */ + /** @name NimbusPrimitivesNimbusCryptoPublic (302) */ interface NimbusPrimitivesNimbusCryptoPublic extends SpCoreSr25519Public {} - /** @name SpCoreSr25519Public (299) */ + /** @name SpCoreSr25519Public (303) */ interface SpCoreSr25519Public extends U8aFixed {} - /** @name PalletAuthorInherentCall (300) */ + /** @name PalletAuthorInherentCall (304) */ interface PalletAuthorInherentCall extends Enum { readonly isKickOffAuthorshipValidation: boolean; readonly type: "KickOffAuthorshipValidation"; } - /** @name PalletPooledStakingCall (301) */ + /** @name PalletPooledStakingCall (305) */ interface PalletPooledStakingCall extends Enum { readonly isRebalanceHold: boolean; readonly asRebalanceHold: { @@ -3726,7 +3804,7 @@ declare module "@polkadot/types/lookup" { | "SwapPool"; } - /** @name PalletPooledStakingAllTargetPool (302) */ + /** @name PalletPooledStakingAllTargetPool (306) */ interface PalletPooledStakingAllTargetPool extends Enum { readonly isJoining: boolean; readonly isAutoCompounding: boolean; @@ -3735,13 +3813,13 @@ declare module "@polkadot/types/lookup" { readonly type: "Joining" | "AutoCompounding" | "ManualRewards" | "Leaving"; } - /** @name PalletPooledStakingPendingOperationQuery (304) */ + /** @name PalletPooledStakingPendingOperationQuery (308) */ interface PalletPooledStakingPendingOperationQuery extends Struct { readonly delegator: AccountId32; readonly operation: PalletPooledStakingPendingOperationKey; } - /** @name PalletPooledStakingPendingOperationKey (305) */ + /** @name PalletPooledStakingPendingOperationKey (309) */ interface PalletPooledStakingPendingOperationKey extends Enum { readonly isJoiningAutoCompounding: boolean; readonly asJoiningAutoCompounding: { @@ -3761,7 +3839,7 @@ declare module "@polkadot/types/lookup" { readonly type: "JoiningAutoCompounding" | "JoiningManualRewards" | "Leaving"; } - /** @name PalletPooledStakingSharesOrStake (306) */ + /** @name PalletPooledStakingSharesOrStake (310) */ interface PalletPooledStakingSharesOrStake extends Enum { readonly isShares: boolean; readonly asShares: u128; @@ -3770,7 +3848,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Shares" | "Stake"; } - /** @name PalletTreasuryCall (309) */ + /** @name PalletTreasuryCall (313) */ interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { @@ -3825,7 +3903,7 @@ declare module "@polkadot/types/lookup" { | "VoidSpend"; } - /** @name CumulusPalletXcmpQueueCall (310) */ + /** @name CumulusPalletXcmpQueueCall (314) */ interface CumulusPalletXcmpQueueCall extends Enum { readonly isSuspendXcmExecution: boolean; readonly isResumeXcmExecution: boolean; @@ -3849,10 +3927,10 @@ declare module "@polkadot/types/lookup" { | "UpdateResumeThreshold"; } - /** @name CumulusPalletDmpQueueCall (311) */ + /** @name CumulusPalletDmpQueueCall (315) */ type CumulusPalletDmpQueueCall = Null; - /** @name PalletXcmCall (312) */ + /** @name PalletXcmCall (316) */ interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { @@ -3938,7 +4016,7 @@ declare module "@polkadot/types/lookup" { | "TransferAssets"; } - /** @name XcmVersionedXcm (313) */ + /** @name XcmVersionedXcm (317) */ interface XcmVersionedXcm extends Enum { readonly isV2: boolean; readonly asV2: XcmV2Xcm; @@ -3947,10 +4025,10 @@ declare module "@polkadot/types/lookup" { readonly type: "V2" | "V3"; } - /** @name XcmV2Xcm (314) */ + /** @name XcmV2Xcm (318) */ interface XcmV2Xcm extends Vec {} - /** @name XcmV2Instruction (316) */ + /** @name XcmV2Instruction (320) */ interface XcmV2Instruction extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: XcmV2MultiassetMultiAssets; @@ -4098,7 +4176,7 @@ declare module "@polkadot/types/lookup" { | "UnsubscribeVersion"; } - /** @name XcmV2Response (317) */ + /** @name XcmV2Response (321) */ interface XcmV2Response extends Enum { readonly isNull: boolean; readonly isAssets: boolean; @@ -4110,7 +4188,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Null" | "Assets" | "ExecutionResult" | "Version"; } - /** @name XcmV2TraitsError (320) */ + /** @name XcmV2TraitsError (324) */ interface XcmV2TraitsError extends Enum { readonly isOverflow: boolean; readonly isUnimplemented: boolean; @@ -4169,7 +4247,7 @@ declare module "@polkadot/types/lookup" { | "WeightNotComputable"; } - /** @name XcmV2MultiassetMultiAssetFilter (321) */ + /** @name XcmV2MultiassetMultiAssetFilter (325) */ interface XcmV2MultiassetMultiAssetFilter extends Enum { readonly isDefinite: boolean; readonly asDefinite: XcmV2MultiassetMultiAssets; @@ -4178,7 +4256,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Definite" | "Wild"; } - /** @name XcmV2MultiassetWildMultiAsset (322) */ + /** @name XcmV2MultiassetWildMultiAsset (326) */ interface XcmV2MultiassetWildMultiAsset extends Enum { readonly isAll: boolean; readonly isAllOf: boolean; @@ -4189,14 +4267,14 @@ declare module "@polkadot/types/lookup" { readonly type: "All" | "AllOf"; } - /** @name XcmV2MultiassetWildFungibility (323) */ + /** @name XcmV2MultiassetWildFungibility (327) */ interface XcmV2MultiassetWildFungibility extends Enum { readonly isFungible: boolean; readonly isNonFungible: boolean; readonly type: "Fungible" | "NonFungible"; } - /** @name XcmV2WeightLimit (324) */ + /** @name XcmV2WeightLimit (328) */ interface XcmV2WeightLimit extends Enum { readonly isUnlimited: boolean; readonly isLimited: boolean; @@ -4204,7 +4282,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Unlimited" | "Limited"; } - /** @name PalletAssetsCall (333) */ + /** @name PalletAssetsCall (337) */ interface PalletAssetsCall extends Enum { readonly isCreate: boolean; readonly asCreate: { @@ -4418,7 +4496,7 @@ declare module "@polkadot/types/lookup" { | "Block"; } - /** @name PalletForeignAssetCreatorCall (334) */ + /** @name PalletForeignAssetCreatorCall (338) */ interface PalletForeignAssetCreatorCall extends Enum { readonly isCreateForeignAsset: boolean; readonly asCreateForeignAsset: { @@ -4448,7 +4526,7 @@ declare module "@polkadot/types/lookup" { | "DestroyForeignAsset"; } - /** @name PalletAssetRateCall (335) */ + /** @name PalletAssetRateCall (339) */ interface PalletAssetRateCall extends Enum { readonly isCreate: boolean; readonly asCreate: { @@ -4467,7 +4545,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Create" | "Update" | "Remove"; } - /** @name PalletMessageQueueCall (336) */ + /** @name PalletMessageQueueCall (340) */ interface PalletMessageQueueCall extends Enum { readonly isReapPage: boolean; readonly asReapPage: { @@ -4484,7 +4562,7 @@ declare module "@polkadot/types/lookup" { readonly type: "ReapPage" | "ExecuteOverweight"; } - /** @name PalletXcmCoreBuyerCall (337) */ + /** @name PalletXcmCoreBuyerCall (341) */ interface PalletXcmCoreBuyerCall extends Enum { readonly isBuyCore: boolean; readonly asBuyCore: { @@ -4526,26 +4604,26 @@ declare module "@polkadot/types/lookup" { | "CleanUpExpiredInFlightOrders"; } - /** @name PalletXcmCoreBuyerBuyCoreCollatorProof (338) */ + /** @name PalletXcmCoreBuyerBuyCoreCollatorProof (342) */ interface PalletXcmCoreBuyerBuyCoreCollatorProof extends Struct { readonly account: AccountId32; readonly signature: Null; } - /** @name PalletXcmCoreBuyerRelayXcmWeightConfigInner (340) */ + /** @name PalletXcmCoreBuyerRelayXcmWeightConfigInner (344) */ interface PalletXcmCoreBuyerRelayXcmWeightConfigInner extends Struct { readonly buyExecutionCost: u128; readonly weightAtMost: SpWeightsWeightV2Weight; } - /** @name DanceboxRuntimeXcmConfigRelayChain (342) */ + /** @name DanceboxRuntimeXcmConfigRelayChain (346) */ interface DanceboxRuntimeXcmConfigRelayChain extends Enum { readonly isWestend: boolean; readonly isRococo: boolean; readonly type: "Westend" | "Rococo"; } - /** @name PalletRootTestingCall (343) */ + /** @name PalletRootTestingCall (347) */ interface PalletRootTestingCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -4555,33 +4633,33 @@ declare module "@polkadot/types/lookup" { readonly type: "FillBlock" | "TriggerDefensive"; } - /** @name PalletSudoError (344) */ + /** @name PalletSudoError (348) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: "RequireSudo"; } - /** @name PalletUtilityError (345) */ + /** @name PalletUtilityError (349) */ interface PalletUtilityError extends Enum { readonly isTooManyCalls: boolean; readonly type: "TooManyCalls"; } - /** @name PalletProxyProxyDefinition (348) */ + /** @name PalletProxyProxyDefinition (352) */ interface PalletProxyProxyDefinition extends Struct { readonly delegate: AccountId32; readonly proxyType: DanceboxRuntimeProxyType; readonly delay: u32; } - /** @name PalletProxyAnnouncement (352) */ + /** @name PalletProxyAnnouncement (356) */ interface PalletProxyAnnouncement extends Struct { readonly real: AccountId32; readonly callHash: H256; readonly height: u32; } - /** @name PalletProxyError (354) */ + /** @name PalletProxyError (358) */ interface PalletProxyError extends Enum { readonly isTooMany: boolean; readonly isNotFound: boolean; @@ -4602,7 +4680,7 @@ declare module "@polkadot/types/lookup" { | "NoSelfProxy"; } - /** @name PalletMigrationsError (355) */ + /** @name PalletMigrationsError (359) */ interface PalletMigrationsError extends Enum { readonly isPreimageMissing: boolean; readonly isWrongUpperBound: boolean; @@ -4611,14 +4689,14 @@ declare module "@polkadot/types/lookup" { readonly type: "PreimageMissing" | "WrongUpperBound" | "PreimageIsTooBig" | "PreimageAlreadyExists"; } - /** @name PalletMaintenanceModeError (356) */ + /** @name PalletMaintenanceModeError (360) */ interface PalletMaintenanceModeError extends Enum { readonly isAlreadyInMaintenanceMode: boolean; readonly isNotInMaintenanceMode: boolean; readonly type: "AlreadyInMaintenanceMode" | "NotInMaintenanceMode"; } - /** @name PalletTxPauseError (357) */ + /** @name PalletTxPauseError (361) */ interface PalletTxPauseError extends Enum { readonly isIsPaused: boolean; readonly isIsUnpaused: boolean; @@ -4627,14 +4705,14 @@ declare module "@polkadot/types/lookup" { readonly type: "IsPaused" | "IsUnpaused" | "Unpausable" | "NotFound"; } - /** @name PalletBalancesBalanceLock (359) */ + /** @name PalletBalancesBalanceLock (363) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (360) */ + /** @name PalletBalancesReasons (364) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -4642,60 +4720,68 @@ declare module "@polkadot/types/lookup" { readonly type: "Fee" | "Misc" | "All"; } - /** @name PalletBalancesReserveData (363) */ + /** @name PalletBalancesReserveData (367) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name PalletBalancesIdAmountRuntimeHoldReason (366) */ + /** @name PalletBalancesIdAmountRuntimeHoldReason (370) */ interface PalletBalancesIdAmountRuntimeHoldReason extends Struct { readonly id: DanceboxRuntimeRuntimeHoldReason; readonly amount: u128; } - /** @name DanceboxRuntimeRuntimeHoldReason (367) */ + /** @name DanceboxRuntimeRuntimeHoldReason (371) */ interface DanceboxRuntimeRuntimeHoldReason extends Enum { readonly isStreamPayment: boolean; readonly asStreamPayment: PalletStreamPaymentHoldReason; + readonly isDataPreservers: boolean; + readonly asDataPreservers: PalletDataPreserversHoldReason; readonly isPooledStaking: boolean; readonly asPooledStaking: PalletPooledStakingHoldReason; - readonly type: "StreamPayment" | "PooledStaking"; + readonly type: "StreamPayment" | "DataPreservers" | "PooledStaking"; } - /** @name PalletStreamPaymentHoldReason (368) */ + /** @name PalletStreamPaymentHoldReason (372) */ interface PalletStreamPaymentHoldReason extends Enum { readonly isStreamPayment: boolean; readonly isStreamOpened: boolean; readonly type: "StreamPayment" | "StreamOpened"; } - /** @name PalletPooledStakingHoldReason (369) */ + /** @name PalletDataPreserversHoldReason (373) */ + interface PalletDataPreserversHoldReason extends Enum { + readonly isProfileDeposit: boolean; + readonly type: "ProfileDeposit"; + } + + /** @name PalletPooledStakingHoldReason (374) */ interface PalletPooledStakingHoldReason extends Enum { readonly isPooledStake: boolean; readonly type: "PooledStake"; } - /** @name PalletBalancesIdAmountRuntimeFreezeReason (372) */ + /** @name PalletBalancesIdAmountRuntimeFreezeReason (377) */ interface PalletBalancesIdAmountRuntimeFreezeReason extends Struct { readonly id: DanceboxRuntimeRuntimeFreezeReason; readonly amount: u128; } - /** @name DanceboxRuntimeRuntimeFreezeReason (373) */ + /** @name DanceboxRuntimeRuntimeFreezeReason (378) */ interface DanceboxRuntimeRuntimeFreezeReason extends Enum { readonly isStreamPayment: boolean; readonly asStreamPayment: PalletStreamPaymentFreezeReason; readonly type: "StreamPayment"; } - /** @name PalletStreamPaymentFreezeReason (374) */ + /** @name PalletStreamPaymentFreezeReason (379) */ interface PalletStreamPaymentFreezeReason extends Enum { readonly isStreamPayment: boolean; readonly type: "StreamPayment"; } - /** @name PalletBalancesError (376) */ + /** @name PalletBalancesError (381) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -4720,14 +4806,14 @@ declare module "@polkadot/types/lookup" { | "TooManyFreezes"; } - /** @name PalletTransactionPaymentReleases (377) */ + /** @name PalletTransactionPaymentReleases (382) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: "V1Ancient" | "V2"; } - /** @name PalletStreamPaymentStream (378) */ + /** @name PalletStreamPaymentStream (383) */ interface PalletStreamPaymentStream extends Struct { readonly source: AccountId32; readonly target: AccountId32; @@ -4739,7 +4825,7 @@ declare module "@polkadot/types/lookup" { readonly openingDeposit: u128; } - /** @name PalletStreamPaymentChangeRequest (380) */ + /** @name PalletStreamPaymentChangeRequest (385) */ interface PalletStreamPaymentChangeRequest extends Struct { readonly requester: PalletStreamPaymentParty; readonly kind: PalletStreamPaymentChangeKind; @@ -4747,7 +4833,7 @@ declare module "@polkadot/types/lookup" { readonly depositChange: Option; } - /** @name PalletStreamPaymentError (382) */ + /** @name PalletStreamPaymentError (387) */ interface PalletStreamPaymentError extends Enum { readonly isUnknownStreamId: boolean; readonly isStreamIdOverflow: boolean; @@ -4782,27 +4868,27 @@ declare module "@polkadot/types/lookup" { | "ImmediateDepositChangeRequiresSameAssetId"; } - /** @name PalletIdentityRegistration (384) */ + /** @name PalletIdentityRegistration (389) */ interface PalletIdentityRegistration extends Struct { readonly judgements: Vec>; readonly deposit: u128; readonly info: PalletIdentityLegacyIdentityInfo; } - /** @name PalletIdentityRegistrarInfo (393) */ + /** @name PalletIdentityRegistrarInfo (398) */ interface PalletIdentityRegistrarInfo extends Struct { readonly account: AccountId32; readonly fee: u128; readonly fields: u64; } - /** @name PalletIdentityAuthorityProperties (395) */ + /** @name PalletIdentityAuthorityProperties (400) */ interface PalletIdentityAuthorityProperties extends Struct { readonly suffix: Bytes; readonly allocation: u32; } - /** @name PalletIdentityError (398) */ + /** @name PalletIdentityError (403) */ interface PalletIdentityError extends Enum { readonly isTooManySubAccounts: boolean; readonly isNotFound: boolean; @@ -4859,7 +4945,7 @@ declare module "@polkadot/types/lookup" { | "NotExpired"; } - /** @name PalletMultisigMultisig (400) */ + /** @name PalletMultisigMultisig (405) */ interface PalletMultisigMultisig extends Struct { readonly when: PalletMultisigTimepoint; readonly deposit: u128; @@ -4867,7 +4953,7 @@ declare module "@polkadot/types/lookup" { readonly approvals: Vec; } - /** @name PalletMultisigError (402) */ + /** @name PalletMultisigError (407) */ interface PalletMultisigError extends Enum { readonly isMinimumThreshold: boolean; readonly isAlreadyApproved: boolean; @@ -4900,18 +4986,18 @@ declare module "@polkadot/types/lookup" { | "AlreadyStored"; } - /** @name TpTraitsParathreadParams (406) */ + /** @name TpTraitsParathreadParams (410) */ interface TpTraitsParathreadParams extends Struct { readonly slotFrequency: TpTraitsSlotFrequency; } - /** @name PalletRegistrarDepositInfo (412) */ + /** @name PalletRegistrarDepositInfo (416) */ interface PalletRegistrarDepositInfo extends Struct { readonly creator: AccountId32; readonly deposit: u128; } - /** @name PalletRegistrarError (413) */ + /** @name PalletRegistrarError (417) */ interface PalletRegistrarError extends Enum { readonly isParaIdAlreadyRegistered: boolean; readonly isParaIdNotRegistered: boolean; @@ -4938,7 +5024,7 @@ declare module "@polkadot/types/lookup" { | "NotParaCreator"; } - /** @name PalletConfigurationHostConfiguration (414) */ + /** @name PalletConfigurationHostConfiguration (418) */ interface PalletConfigurationHostConfiguration extends Struct { readonly maxCollators: u32; readonly minOrchestratorCollators: u32; @@ -4950,26 +5036,26 @@ declare module "@polkadot/types/lookup" { readonly targetContainerChainFullness: Perbill; } - /** @name PalletConfigurationError (417) */ + /** @name PalletConfigurationError (421) */ interface PalletConfigurationError extends Enum { readonly isInvalidNewValue: boolean; readonly type: "InvalidNewValue"; } - /** @name DpCollatorAssignmentAssignedCollatorsAccountId32 (418) */ + /** @name DpCollatorAssignmentAssignedCollatorsAccountId32 (422) */ interface DpCollatorAssignmentAssignedCollatorsAccountId32 extends Struct { readonly orchestratorChain: Vec; readonly containerChains: BTreeMap>; } - /** @name PalletAuthorNotingContainerChainBlockInfo (423) */ + /** @name PalletAuthorNotingContainerChainBlockInfo (427) */ interface PalletAuthorNotingContainerChainBlockInfo extends Struct { readonly blockNumber: u32; readonly author: AccountId32; readonly latestSlotNumber: u64; } - /** @name PalletAuthorNotingError (424) */ + /** @name PalletAuthorNotingError (428) */ interface PalletAuthorNotingError extends Enum { readonly isFailedReading: boolean; readonly isFailedDecodingHeader: boolean; @@ -4988,13 +5074,13 @@ declare module "@polkadot/types/lookup" { | "NonAuraDigest"; } - /** @name DpCollatorAssignmentAssignedCollatorsPublic (425) */ + /** @name DpCollatorAssignmentAssignedCollatorsPublic (429) */ interface DpCollatorAssignmentAssignedCollatorsPublic extends Struct { readonly orchestratorChain: Vec; readonly containerChains: BTreeMap>; } - /** @name PalletServicesPaymentError (430) */ + /** @name PalletServicesPaymentError (434) */ interface PalletServicesPaymentError extends Enum { readonly isInsufficientFundsToPurchaseCredits: boolean; readonly isInsufficientCredits: boolean; @@ -5002,13 +5088,22 @@ declare module "@polkadot/types/lookup" { readonly type: "InsufficientFundsToPurchaseCredits" | "InsufficientCredits" | "CreditPriceTooExpensive"; } - /** @name PalletDataPreserversError (431) */ + /** @name PalletDataPreserversRegisteredProfile (435) */ + interface PalletDataPreserversRegisteredProfile extends Struct { + readonly account: AccountId32; + readonly deposit: u128; + readonly profile: PalletDataPreserversProfile; + } + + /** @name PalletDataPreserversError (436) */ interface PalletDataPreserversError extends Enum { readonly isNoBootNodes: boolean; - readonly type: "NoBootNodes"; + readonly isUnknownProfileId: boolean; + readonly isNextProfileIdShouldBeAvailable: boolean; + readonly type: "NoBootNodes" | "UnknownProfileId" | "NextProfileIdShouldBeAvailable"; } - /** @name PalletInvulnerablesError (433) */ + /** @name PalletInvulnerablesError (438) */ interface PalletInvulnerablesError extends Enum { readonly isTooManyInvulnerables: boolean; readonly isAlreadyInvulnerable: boolean; @@ -5023,10 +5118,10 @@ declare module "@polkadot/types/lookup" { | "UnableToDeriveCollatorId"; } - /** @name SpCoreCryptoKeyTypeId (438) */ + /** @name SpCoreCryptoKeyTypeId (443) */ interface SpCoreCryptoKeyTypeId extends U8aFixed {} - /** @name PalletSessionError (439) */ + /** @name PalletSessionError (444) */ interface PalletSessionError extends Enum { readonly isInvalidProof: boolean; readonly isNoAssociatedValidatorId: boolean; @@ -5036,7 +5131,7 @@ declare module "@polkadot/types/lookup" { readonly type: "InvalidProof" | "NoAssociatedValidatorId" | "DuplicatedKey" | "NoKeys" | "NoAccount"; } - /** @name PalletAuthorInherentError (443) */ + /** @name PalletAuthorInherentError (448) */ interface PalletAuthorInherentError extends Enum { readonly isAuthorAlreadySet: boolean; readonly isNoAccountId: boolean; @@ -5044,13 +5139,13 @@ declare module "@polkadot/types/lookup" { readonly type: "AuthorAlreadySet" | "NoAccountId" | "CannotBeAuthor"; } - /** @name PalletPooledStakingCandidateEligibleCandidate (445) */ + /** @name PalletPooledStakingCandidateEligibleCandidate (450) */ interface PalletPooledStakingCandidateEligibleCandidate extends Struct { readonly candidate: AccountId32; readonly stake: u128; } - /** @name PalletPooledStakingPoolsKey (448) */ + /** @name PalletPooledStakingPoolsKey (453) */ interface PalletPooledStakingPoolsKey extends Enum { readonly isCandidateTotalStake: boolean; readonly isJoiningShares: boolean; @@ -5120,7 +5215,7 @@ declare module "@polkadot/types/lookup" { | "LeavingSharesHeldStake"; } - /** @name PalletPooledStakingError (450) */ + /** @name PalletPooledStakingError (455) */ interface PalletPooledStakingError extends Enum { readonly isInvalidPalletSetting: boolean; readonly isDisabledFeature: boolean; @@ -5154,13 +5249,13 @@ declare module "@polkadot/types/lookup" { | "SwapResultsInZeroShares"; } - /** @name PalletInflationRewardsChainsToRewardValue (451) */ + /** @name PalletInflationRewardsChainsToRewardValue (456) */ interface PalletInflationRewardsChainsToRewardValue extends Struct { readonly paraIds: Vec; readonly rewardsPerChain: u128; } - /** @name PalletTreasuryProposal (452) */ + /** @name PalletTreasuryProposal (457) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -5168,7 +5263,7 @@ declare module "@polkadot/types/lookup" { readonly bond: u128; } - /** @name PalletTreasurySpendStatus (454) */ + /** @name PalletTreasurySpendStatus (459) */ interface PalletTreasurySpendStatus extends Struct { readonly assetKind: Null; readonly amount: u128; @@ -5178,7 +5273,7 @@ declare module "@polkadot/types/lookup" { readonly status: PalletTreasuryPaymentState; } - /** @name PalletTreasuryPaymentState (455) */ + /** @name PalletTreasuryPaymentState (460) */ interface PalletTreasuryPaymentState extends Enum { readonly isPending: boolean; readonly isAttempted: boolean; @@ -5189,10 +5284,10 @@ declare module "@polkadot/types/lookup" { readonly type: "Pending" | "Attempted" | "Failed"; } - /** @name FrameSupportPalletId (457) */ + /** @name FrameSupportPalletId (462) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (458) */ + /** @name PalletTreasuryError (463) */ interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; @@ -5221,7 +5316,7 @@ declare module "@polkadot/types/lookup" { | "Inconclusive"; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (462) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (467) */ interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -5230,21 +5325,21 @@ declare module "@polkadot/types/lookup" { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (463) */ + /** @name CumulusPalletXcmpQueueOutboundState (468) */ interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: "Ok" | "Suspended"; } - /** @name CumulusPalletXcmpQueueQueueConfigData (465) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (470) */ interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; readonly resumeThreshold: u32; } - /** @name CumulusPalletXcmpQueueError (466) */ + /** @name CumulusPalletXcmpQueueError (471) */ interface CumulusPalletXcmpQueueError extends Enum { readonly isBadQueueConfig: boolean; readonly isAlreadySuspended: boolean; @@ -5252,7 +5347,7 @@ declare module "@polkadot/types/lookup" { readonly type: "BadQueueConfig" | "AlreadySuspended" | "AlreadyResumed"; } - /** @name CumulusPalletDmpQueueMigrationState (467) */ + /** @name CumulusPalletDmpQueueMigrationState (472) */ interface CumulusPalletDmpQueueMigrationState extends Enum { readonly isNotStarted: boolean; readonly isStartedExport: boolean; @@ -5280,7 +5375,7 @@ declare module "@polkadot/types/lookup" { | "Completed"; } - /** @name PalletXcmQueryStatus (470) */ + /** @name PalletXcmQueryStatus (475) */ interface PalletXcmQueryStatus extends Enum { readonly isPending: boolean; readonly asPending: { @@ -5302,7 +5397,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Pending" | "VersionNotifier" | "Ready"; } - /** @name XcmVersionedResponse (474) */ + /** @name XcmVersionedResponse (479) */ interface XcmVersionedResponse extends Enum { readonly isV2: boolean; readonly asV2: XcmV2Response; @@ -5311,7 +5406,7 @@ declare module "@polkadot/types/lookup" { readonly type: "V2" | "V3"; } - /** @name PalletXcmVersionMigrationStage (480) */ + /** @name PalletXcmVersionMigrationStage (485) */ interface PalletXcmVersionMigrationStage extends Enum { readonly isMigrateSupportedVersion: boolean; readonly isMigrateVersionNotifiers: boolean; @@ -5325,14 +5420,14 @@ declare module "@polkadot/types/lookup" { | "MigrateAndNotifyOldTargets"; } - /** @name XcmVersionedAssetId (482) */ + /** @name XcmVersionedAssetId (487) */ interface XcmVersionedAssetId extends Enum { readonly isV3: boolean; readonly asV3: XcmV3MultiassetAssetId; readonly type: "V3"; } - /** @name PalletXcmRemoteLockedFungibleRecord (483) */ + /** @name PalletXcmRemoteLockedFungibleRecord (488) */ interface PalletXcmRemoteLockedFungibleRecord extends Struct { readonly amount: u128; readonly owner: XcmVersionedMultiLocation; @@ -5340,7 +5435,7 @@ declare module "@polkadot/types/lookup" { readonly consumers: Vec>; } - /** @name PalletXcmError (490) */ + /** @name PalletXcmError (495) */ interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -5395,7 +5490,7 @@ declare module "@polkadot/types/lookup" { | "LocalExecutionIncomplete"; } - /** @name PalletAssetsAssetDetails (491) */ + /** @name PalletAssetsAssetDetails (496) */ interface PalletAssetsAssetDetails extends Struct { readonly owner: AccountId32; readonly issuer: AccountId32; @@ -5411,7 +5506,7 @@ declare module "@polkadot/types/lookup" { readonly status: PalletAssetsAssetStatus; } - /** @name PalletAssetsAssetStatus (492) */ + /** @name PalletAssetsAssetStatus (497) */ interface PalletAssetsAssetStatus extends Enum { readonly isLive: boolean; readonly isFrozen: boolean; @@ -5419,7 +5514,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Live" | "Frozen" | "Destroying"; } - /** @name PalletAssetsAssetAccount (494) */ + /** @name PalletAssetsAssetAccount (499) */ interface PalletAssetsAssetAccount extends Struct { readonly balance: u128; readonly status: PalletAssetsAccountStatus; @@ -5427,7 +5522,7 @@ declare module "@polkadot/types/lookup" { readonly extra: Null; } - /** @name PalletAssetsAccountStatus (495) */ + /** @name PalletAssetsAccountStatus (500) */ interface PalletAssetsAccountStatus extends Enum { readonly isLiquid: boolean; readonly isFrozen: boolean; @@ -5435,7 +5530,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Liquid" | "Frozen" | "Blocked"; } - /** @name PalletAssetsExistenceReason (496) */ + /** @name PalletAssetsExistenceReason (501) */ interface PalletAssetsExistenceReason extends Enum { readonly isConsumer: boolean; readonly isSufficient: boolean; @@ -5447,13 +5542,13 @@ declare module "@polkadot/types/lookup" { readonly type: "Consumer" | "Sufficient" | "DepositHeld" | "DepositRefunded" | "DepositFrom"; } - /** @name PalletAssetsApproval (498) */ + /** @name PalletAssetsApproval (503) */ interface PalletAssetsApproval extends Struct { readonly amount: u128; readonly deposit: u128; } - /** @name PalletAssetsAssetMetadata (499) */ + /** @name PalletAssetsAssetMetadata (504) */ interface PalletAssetsAssetMetadata extends Struct { readonly deposit: u128; readonly name: Bytes; @@ -5462,7 +5557,7 @@ declare module "@polkadot/types/lookup" { readonly isFrozen: bool; } - /** @name PalletAssetsError (501) */ + /** @name PalletAssetsError (506) */ interface PalletAssetsError extends Enum { readonly isBalanceLow: boolean; readonly isNoAccount: boolean; @@ -5507,14 +5602,14 @@ declare module "@polkadot/types/lookup" { | "CallbackFailed"; } - /** @name PalletForeignAssetCreatorError (502) */ + /** @name PalletForeignAssetCreatorError (507) */ interface PalletForeignAssetCreatorError extends Enum { readonly isAssetAlreadyExists: boolean; readonly isAssetDoesNotExist: boolean; readonly type: "AssetAlreadyExists" | "AssetDoesNotExist"; } - /** @name PalletAssetRateError (503) */ + /** @name PalletAssetRateError (508) */ interface PalletAssetRateError extends Enum { readonly isUnknownAssetKind: boolean; readonly isAlreadyExists: boolean; @@ -5522,7 +5617,7 @@ declare module "@polkadot/types/lookup" { readonly type: "UnknownAssetKind" | "AlreadyExists" | "Overflow"; } - /** @name PalletMessageQueueBookState (504) */ + /** @name PalletMessageQueueBookState (509) */ interface PalletMessageQueueBookState extends Struct { readonly begin: u32; readonly end: u32; @@ -5532,13 +5627,13 @@ declare module "@polkadot/types/lookup" { readonly size_: u64; } - /** @name PalletMessageQueueNeighbours (506) */ + /** @name PalletMessageQueueNeighbours (511) */ interface PalletMessageQueueNeighbours extends Struct { readonly prev: CumulusPrimitivesCoreAggregateMessageOrigin; readonly next: CumulusPrimitivesCoreAggregateMessageOrigin; } - /** @name PalletMessageQueuePage (508) */ + /** @name PalletMessageQueuePage (513) */ interface PalletMessageQueuePage extends Struct { readonly remaining: u32; readonly remainingSize: u32; @@ -5548,7 +5643,7 @@ declare module "@polkadot/types/lookup" { readonly heap: Bytes; } - /** @name PalletMessageQueueError (510) */ + /** @name PalletMessageQueueError (515) */ interface PalletMessageQueueError extends Enum { readonly isNotReapable: boolean; readonly isNoPage: boolean; @@ -5571,14 +5666,14 @@ declare module "@polkadot/types/lookup" { | "RecursiveDisallowed"; } - /** @name PalletXcmCoreBuyerInFlightCoreBuyingOrder (511) */ + /** @name PalletXcmCoreBuyerInFlightCoreBuyingOrder (516) */ interface PalletXcmCoreBuyerInFlightCoreBuyingOrder extends Struct { readonly paraId: u32; readonly queryId: u64; readonly ttl: u32; } - /** @name PalletXcmCoreBuyerError (512) */ + /** @name PalletXcmCoreBuyerError (517) */ interface PalletXcmCoreBuyerError extends Enum { readonly isInvalidProof: boolean; readonly isErrorValidatingXCM: boolean; @@ -5611,27 +5706,27 @@ declare module "@polkadot/types/lookup" { | "BlockProductionPending"; } - /** @name FrameSystemExtensionsCheckNonZeroSender (517) */ + /** @name FrameSystemExtensionsCheckNonZeroSender (522) */ type FrameSystemExtensionsCheckNonZeroSender = Null; - /** @name FrameSystemExtensionsCheckSpecVersion (518) */ + /** @name FrameSystemExtensionsCheckSpecVersion (523) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckTxVersion (519) */ + /** @name FrameSystemExtensionsCheckTxVersion (524) */ type FrameSystemExtensionsCheckTxVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (520) */ + /** @name FrameSystemExtensionsCheckGenesis (525) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (523) */ + /** @name FrameSystemExtensionsCheckNonce (528) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (524) */ + /** @name FrameSystemExtensionsCheckWeight (529) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTransactionPaymentChargeTransactionPayment (525) */ + /** @name PalletTransactionPaymentChargeTransactionPayment (530) */ interface PalletTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name DanceboxRuntimeRuntime (526) */ + /** @name DanceboxRuntimeRuntime (531) */ type DanceboxRuntimeRuntime = Null; } // declare module diff --git a/typescript-api/src/flashbox/interfaces/augment-api-consts.ts b/typescript-api/src/flashbox/interfaces/augment-api-consts.ts index 1c84f0710..ca98306cc 100644 --- a/typescript-api/src/flashbox/interfaces/augment-api-consts.ts +++ b/typescript-api/src/flashbox/interfaces/augment-api-consts.ts @@ -62,6 +62,7 @@ declare module "@polkadot/api-base/types/consts" { dataPreservers: { maxBootNodes: u32 & AugmentedConst; maxBootNodeUrlLen: u32 & AugmentedConst; + maxParaIdsVecLen: u32 & AugmentedConst; /** Generic const */ [key: string]: Codec; }; diff --git a/typescript-api/src/flashbox/interfaces/augment-api-errors.ts b/typescript-api/src/flashbox/interfaces/augment-api-errors.ts index f3bd96d59..b1e02373f 100644 --- a/typescript-api/src/flashbox/interfaces/augment-api-errors.ts +++ b/typescript-api/src/flashbox/interfaces/augment-api-errors.ts @@ -64,8 +64,10 @@ declare module "@polkadot/api-base/types/errors" { [key: string]: AugmentedError; }; dataPreservers: { + NextProfileIdShouldBeAvailable: AugmentedError; /** This container chain does not have any boot nodes */ NoBootNodes: AugmentedError; + UnknownProfileId: AugmentedError; /** Generic error */ [key: string]: AugmentedError; }; diff --git a/typescript-api/src/flashbox/interfaces/augment-api-events.ts b/typescript-api/src/flashbox/interfaces/augment-api-events.ts index 4c5caafcb..3908edeaf 100644 --- a/typescript-api/src/flashbox/interfaces/augment-api-events.ts +++ b/typescript-api/src/flashbox/interfaces/augment-api-events.ts @@ -124,6 +124,21 @@ declare module "@polkadot/api-base/types/events" { dataPreservers: { /** The list of boot_nodes changed. */ BootNodesChanged: AugmentedEvent; + ProfileCreated: AugmentedEvent< + ApiType, + [account: AccountId32, profileId: u64, deposit: u128], + { account: AccountId32; profileId: u64; deposit: u128 } + >; + ProfileDeleted: AugmentedEvent< + ApiType, + [profileId: u64, releasedDeposit: u128], + { profileId: u64; releasedDeposit: u128 } + >; + ProfileUpdated: AugmentedEvent< + ApiType, + [profileId: u64, oldDeposit: u128, newDeposit: u128], + { profileId: u64; oldDeposit: u128; newDeposit: u128 } + >; /** Generic event */ [key: string]: AugmentedEvent; }; diff --git a/typescript-api/src/flashbox/interfaces/augment-api-query.ts b/typescript-api/src/flashbox/interfaces/augment-api-query.ts index ca5b5b6e7..3e0c3fcd5 100644 --- a/typescript-api/src/flashbox/interfaces/augment-api-query.ts +++ b/typescript-api/src/flashbox/interfaces/augment-api-query.ts @@ -31,6 +31,7 @@ import type { PalletBalancesIdAmountRuntimeHoldReason, PalletBalancesReserveData, PalletConfigurationHostConfiguration, + PalletDataPreserversRegisteredProfile, PalletIdentityAuthorityProperties, PalletIdentityRegistrarInfo, PalletIdentityRegistration, @@ -244,6 +245,13 @@ declare module "@polkadot/api-base/types/storage" { dataPreservers: { bootNodes: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; + nextProfileId: AugmentedQuery Observable, []> & QueryableStorageEntry; + profiles: AugmentedQuery< + ApiType, + (arg: u64 | AnyNumber | Uint8Array) => Observable>, + [u64] + > & + QueryableStorageEntry; /** Generic query */ [key: string]: QueryableStorageEntry; }; diff --git a/typescript-api/src/flashbox/interfaces/augment-api-tx.ts b/typescript-api/src/flashbox/interfaces/augment-api-tx.ts index cb03e2f26..4892f8c84 100644 --- a/typescript-api/src/flashbox/interfaces/augment-api-tx.ts +++ b/typescript-api/src/flashbox/interfaces/augment-api-tx.ts @@ -21,6 +21,7 @@ import type { FlashboxRuntimeProxyType, FlashboxRuntimeSessionKeys, FlashboxRuntimeStreamPaymentAssetId, + PalletDataPreserversProfile, PalletIdentityJudgement, PalletIdentityLegacyIdentityInfo, PalletMultisigTimepoint, @@ -248,6 +249,51 @@ declare module "@polkadot/api-base/types/submittable" { [key: string]: SubmittableExtrinsicFunction; }; dataPreservers: { + /** See [`Pallet::create_profile`]. */ + createProfile: AugmentedSubmittable< + ( + profile: + | PalletDataPreserversProfile + | { url?: any; paraIds?: any; mode?: any } + | string + | Uint8Array + ) => SubmittableExtrinsic, + [PalletDataPreserversProfile] + >; + /** See [`Pallet::delete_profile`]. */ + deleteProfile: AugmentedSubmittable< + (profileId: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, + [u64] + >; + /** See [`Pallet::force_create_profile`]. */ + forceCreateProfile: AugmentedSubmittable< + ( + profile: + | PalletDataPreserversProfile + | { url?: any; paraIds?: any; mode?: any } + | string + | Uint8Array, + forAccount: AccountId32 | string | Uint8Array + ) => SubmittableExtrinsic, + [PalletDataPreserversProfile, AccountId32] + >; + /** See [`Pallet::force_delete_profile`]. */ + forceDeleteProfile: AugmentedSubmittable< + (profileId: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, + [u64] + >; + /** See [`Pallet::force_update_profile`]. */ + forceUpdateProfile: AugmentedSubmittable< + ( + profileId: u64 | AnyNumber | Uint8Array, + profile: + | PalletDataPreserversProfile + | { url?: any; paraIds?: any; mode?: any } + | string + | Uint8Array + ) => SubmittableExtrinsic, + [u64, PalletDataPreserversProfile] + >; /** See [`Pallet::set_boot_nodes`]. */ setBootNodes: AugmentedSubmittable< ( @@ -256,6 +302,18 @@ declare module "@polkadot/api-base/types/submittable" { ) => SubmittableExtrinsic, [u32, Vec] >; + /** See [`Pallet::update_profile`]. */ + updateProfile: AugmentedSubmittable< + ( + profileId: u64 | AnyNumber | Uint8Array, + profile: + | PalletDataPreserversProfile + | { url?: any; paraIds?: any; mode?: any } + | string + | Uint8Array + ) => SubmittableExtrinsic, + [u64, PalletDataPreserversProfile] + >; /** Generic tx */ [key: string]: SubmittableExtrinsicFunction; }; diff --git a/typescript-api/src/flashbox/interfaces/lookup.ts b/typescript-api/src/flashbox/interfaces/lookup.ts index 881632ce5..2d2b67fdd 100644 --- a/typescript-api/src/flashbox/interfaces/lookup.ts +++ b/typescript-api/src/flashbox/interfaces/lookup.ts @@ -649,6 +649,20 @@ export default { BootNodesChanged: { paraId: "u32", }, + ProfileCreated: { + account: "AccountId32", + profileId: "u64", + deposit: "u128", + }, + ProfileUpdated: { + profileId: "u64", + oldDeposit: "u128", + newDeposit: "u128", + }, + ProfileDeleted: { + profileId: "u64", + releasedDeposit: "u128", + }, }, }, /** Lookup68: pallet_invulnerables::pallet::Event */ @@ -1604,9 +1618,53 @@ export default { paraId: "u32", bootNodes: "Vec", }, + create_profile: { + profile: "PalletDataPreserversProfile", + }, + update_profile: { + profileId: "u64", + profile: "PalletDataPreserversProfile", + }, + delete_profile: { + profileId: "u64", + }, + force_create_profile: { + profile: "PalletDataPreserversProfile", + forAccount: "AccountId32", + }, + force_update_profile: { + profileId: "u64", + profile: "PalletDataPreserversProfile", + }, + force_delete_profile: { + profileId: "u64", + }, + }, + }, + /** Lookup229: pallet_data_preservers::pallet::Profile */ + PalletDataPreserversProfile: { + url: "Bytes", + paraIds: "PalletDataPreserversParaIdsFilter", + mode: "PalletDataPreserversProfileMode", + }, + /** Lookup230: pallet_data_preservers::pallet::ParaIdsFilter */ + PalletDataPreserversParaIdsFilter: { + _enum: { + AnyParaId: "Null", + Whitelist: "Vec", + Blacklist: "Vec", + }, + }, + /** Lookup233: pallet_data_preservers::pallet::ProfileMode */ + PalletDataPreserversProfileMode: { + _enum: { + Bootnode: "Null", + Rpc: { + supportsEthereumRpcs: "bool", + }, }, }, - /** Lookup229: pallet_invulnerables::pallet::Call */ + /** Lookup234: pallet_invulnerables::pallet::Call */ PalletInvulnerablesCall: { _enum: { __Unused0: "Null", @@ -1618,7 +1676,7 @@ export default { }, }, }, - /** Lookup230: pallet_session::pallet::Call */ + /** Lookup235: pallet_session::pallet::Call */ PalletSessionCall: { _enum: { set_keys: { @@ -1631,19 +1689,19 @@ export default { purge_keys: "Null", }, }, - /** Lookup231: flashbox_runtime::SessionKeys */ + /** Lookup236: flashbox_runtime::SessionKeys */ FlashboxRuntimeSessionKeys: { nimbus: "NimbusPrimitivesNimbusCryptoPublic", }, - /** Lookup232: nimbus_primitives::nimbus_crypto::Public */ + /** Lookup237: nimbus_primitives::nimbus_crypto::Public */ NimbusPrimitivesNimbusCryptoPublic: "SpCoreSr25519Public", - /** Lookup233: sp_core::sr25519::Public */ + /** Lookup238: sp_core::sr25519::Public */ SpCoreSr25519Public: "[u8;32]", - /** Lookup234: pallet_author_inherent::pallet::Call */ + /** Lookup239: pallet_author_inherent::pallet::Call */ PalletAuthorInherentCall: { _enum: ["kick_off_authorship_validation"], }, - /** Lookup235: pallet_treasury::pallet::Call */ + /** Lookup240: pallet_treasury::pallet::Call */ PalletTreasuryCall: { _enum: { propose_spend: { @@ -1680,7 +1738,7 @@ export default { }, }, }, - /** Lookup236: pallet_root_testing::pallet::Call */ + /** Lookup241: pallet_root_testing::pallet::Call */ PalletRootTestingCall: { _enum: { fill_block: { @@ -1689,27 +1747,27 @@ export default { trigger_defensive: "Null", }, }, - /** Lookup237: pallet_sudo::pallet::Error */ + /** Lookup242: pallet_sudo::pallet::Error */ PalletSudoError: { _enum: ["RequireSudo"], }, - /** Lookup238: pallet_utility::pallet::Error */ + /** Lookup243: pallet_utility::pallet::Error */ PalletUtilityError: { _enum: ["TooManyCalls"], }, - /** Lookup241: pallet_proxy::ProxyDefinition */ + /** Lookup246: pallet_proxy::ProxyDefinition */ PalletProxyProxyDefinition: { delegate: "AccountId32", proxyType: "FlashboxRuntimeProxyType", delay: "u32", }, - /** Lookup245: pallet_proxy::Announcement */ + /** Lookup250: pallet_proxy::Announcement */ PalletProxyAnnouncement: { real: "AccountId32", callHash: "H256", height: "u32", }, - /** Lookup247: pallet_proxy::pallet::Error */ + /** Lookup252: pallet_proxy::pallet::Error */ PalletProxyError: { _enum: [ "TooMany", @@ -1722,39 +1780,39 @@ export default { "NoSelfProxy", ], }, - /** Lookup248: pallet_migrations::pallet::Error */ + /** Lookup253: pallet_migrations::pallet::Error */ PalletMigrationsError: { _enum: ["PreimageMissing", "WrongUpperBound", "PreimageIsTooBig", "PreimageAlreadyExists"], }, - /** Lookup249: pallet_maintenance_mode::pallet::Error */ + /** Lookup254: pallet_maintenance_mode::pallet::Error */ PalletMaintenanceModeError: { _enum: ["AlreadyInMaintenanceMode", "NotInMaintenanceMode"], }, - /** Lookup250: pallet_tx_pause::pallet::Error */ + /** Lookup255: pallet_tx_pause::pallet::Error */ PalletTxPauseError: { _enum: ["IsPaused", "IsUnpaused", "Unpausable", "NotFound"], }, - /** Lookup252: pallet_balances::types::BalanceLock */ + /** Lookup257: pallet_balances::types::BalanceLock */ PalletBalancesBalanceLock: { id: "[u8;8]", amount: "u128", reasons: "PalletBalancesReasons", }, - /** Lookup253: pallet_balances::types::Reasons */ + /** Lookup258: pallet_balances::types::Reasons */ PalletBalancesReasons: { _enum: ["Fee", "Misc", "All"], }, - /** Lookup256: pallet_balances::types::ReserveData */ + /** Lookup261: pallet_balances::types::ReserveData */ PalletBalancesReserveData: { id: "[u8;8]", amount: "u128", }, - /** Lookup259: pallet_balances::types::IdAmount */ + /** Lookup264: pallet_balances::types::IdAmount */ PalletBalancesIdAmountRuntimeHoldReason: { id: "FlashboxRuntimeRuntimeHoldReason", amount: "u128", }, - /** Lookup260: flashbox_runtime::RuntimeHoldReason */ + /** Lookup265: flashbox_runtime::RuntimeHoldReason */ FlashboxRuntimeRuntimeHoldReason: { _enum: { __Unused0: "Null", @@ -1770,18 +1828,37 @@ export default { __Unused10: "Null", __Unused11: "Null", StreamPayment: "PalletStreamPaymentHoldReason", + __Unused13: "Null", + __Unused14: "Null", + __Unused15: "Null", + __Unused16: "Null", + __Unused17: "Null", + __Unused18: "Null", + __Unused19: "Null", + __Unused20: "Null", + __Unused21: "Null", + __Unused22: "Null", + __Unused23: "Null", + __Unused24: "Null", + __Unused25: "Null", + __Unused26: "Null", + DataPreservers: "PalletDataPreserversHoldReason", }, }, - /** Lookup261: pallet_stream_payment::pallet::HoldReason */ + /** Lookup266: pallet_stream_payment::pallet::HoldReason */ PalletStreamPaymentHoldReason: { _enum: ["StreamPayment", "StreamOpened"], }, - /** Lookup264: pallet_balances::types::IdAmount */ + /** Lookup267: pallet_data_preservers::pallet::HoldReason */ + PalletDataPreserversHoldReason: { + _enum: ["ProfileDeposit"], + }, + /** Lookup270: pallet_balances::types::IdAmount */ PalletBalancesIdAmountRuntimeFreezeReason: { id: "FlashboxRuntimeRuntimeFreezeReason", amount: "u128", }, - /** Lookup265: flashbox_runtime::RuntimeFreezeReason */ + /** Lookup271: flashbox_runtime::RuntimeFreezeReason */ FlashboxRuntimeRuntimeFreezeReason: { _enum: { __Unused0: "Null", @@ -1799,11 +1876,11 @@ export default { StreamPayment: "PalletStreamPaymentFreezeReason", }, }, - /** Lookup266: pallet_stream_payment::pallet::FreezeReason */ + /** Lookup272: pallet_stream_payment::pallet::FreezeReason */ PalletStreamPaymentFreezeReason: { _enum: ["StreamPayment"], }, - /** Lookup268: pallet_balances::pallet::Error */ + /** Lookup274: pallet_balances::pallet::Error */ PalletBalancesError: { _enum: [ "VestingBalance", @@ -1818,12 +1895,12 @@ export default { "TooManyFreezes", ], }, - /** Lookup269: pallet_transaction_payment::Releases */ + /** Lookup275: pallet_transaction_payment::Releases */ PalletTransactionPaymentReleases: { _enum: ["V1Ancient", "V2"], }, /** - * Lookup270: pallet_stream_payment::pallet::Stream */ PalletStreamPaymentStream: { @@ -1837,7 +1914,7 @@ export default { openingDeposit: "u128", }, /** - * Lookup272: pallet_stream_payment::pallet::ChangeRequest */ PalletStreamPaymentChangeRequest: { @@ -1846,7 +1923,7 @@ export default { newConfig: "PalletStreamPaymentStreamConfig", depositChange: "Option", }, - /** Lookup274: pallet_stream_payment::pallet::Error */ + /** Lookup280: pallet_stream_payment::pallet::Error */ PalletStreamPaymentError: { _enum: [ "UnknownStreamId", @@ -1866,24 +1943,24 @@ export default { "ImmediateDepositChangeRequiresSameAssetId", ], }, - /** Lookup276: pallet_identity::types::Registration> */ + /** Lookup282: pallet_identity::types::Registration> */ PalletIdentityRegistration: { judgements: "Vec<(u32,PalletIdentityJudgement)>", deposit: "u128", info: "PalletIdentityLegacyIdentityInfo", }, - /** Lookup285: pallet_identity::types::RegistrarInfo */ + /** Lookup291: pallet_identity::types::RegistrarInfo */ PalletIdentityRegistrarInfo: { account: "AccountId32", fee: "u128", fields: "u64", }, - /** Lookup287: pallet_identity::types::AuthorityProperties> */ + /** Lookup293: pallet_identity::types::AuthorityProperties> */ PalletIdentityAuthorityProperties: { suffix: "Bytes", allocation: "u32", }, - /** Lookup290: pallet_identity::pallet::Error */ + /** Lookup296: pallet_identity::pallet::Error */ PalletIdentityError: { _enum: [ "TooManySubAccounts", @@ -1914,14 +1991,14 @@ export default { "NotExpired", ], }, - /** Lookup292: pallet_multisig::Multisig */ + /** Lookup298: pallet_multisig::Multisig */ PalletMultisigMultisig: { when: "PalletMultisigTimepoint", deposit: "u128", depositor: "AccountId32", approvals: "Vec", }, - /** Lookup294: pallet_multisig::pallet::Error */ + /** Lookup300: pallet_multisig::pallet::Error */ PalletMultisigError: { _enum: [ "MinimumThreshold", @@ -1940,16 +2017,16 @@ export default { "AlreadyStored", ], }, - /** Lookup299: tp_traits::ParathreadParams */ + /** Lookup303: tp_traits::ParathreadParams */ TpTraitsParathreadParams: { slotFrequency: "TpTraitsSlotFrequency", }, - /** Lookup305: pallet_registrar::pallet::DepositInfo */ + /** Lookup309: pallet_registrar::pallet::DepositInfo */ PalletRegistrarDepositInfo: { creator: "AccountId32", deposit: "u128", }, - /** Lookup306: pallet_registrar::pallet::Error */ + /** Lookup310: pallet_registrar::pallet::Error */ PalletRegistrarError: { _enum: [ "ParaIdAlreadyRegistered", @@ -1965,7 +2042,7 @@ export default { "NotParaCreator", ], }, - /** Lookup307: pallet_configuration::HostConfiguration */ + /** Lookup311: pallet_configuration::HostConfiguration */ PalletConfigurationHostConfiguration: { maxCollators: "u32", minOrchestratorCollators: "u32", @@ -1976,22 +2053,22 @@ export default { parathreadsPerCollator: "u32", targetContainerChainFullness: "Perbill", }, - /** Lookup310: pallet_configuration::pallet::Error */ + /** Lookup314: pallet_configuration::pallet::Error */ PalletConfigurationError: { _enum: ["InvalidNewValue"], }, - /** Lookup311: dp_collator_assignment::AssignedCollators */ + /** Lookup315: dp_collator_assignment::AssignedCollators */ DpCollatorAssignmentAssignedCollatorsAccountId32: { orchestratorChain: "Vec", containerChains: "BTreeMap>", }, - /** Lookup316: pallet_author_noting::pallet::ContainerChainBlockInfo */ + /** Lookup320: pallet_author_noting::pallet::ContainerChainBlockInfo */ PalletAuthorNotingContainerChainBlockInfo: { blockNumber: "u32", author: "AccountId32", latestSlotNumber: "u64", }, - /** Lookup317: pallet_author_noting::pallet::Error */ + /** Lookup321: pallet_author_noting::pallet::Error */ PalletAuthorNotingError: { _enum: [ "FailedReading", @@ -2003,20 +2080,26 @@ export default { "NonAuraDigest", ], }, - /** Lookup318: dp_collator_assignment::AssignedCollators */ + /** Lookup322: dp_collator_assignment::AssignedCollators */ DpCollatorAssignmentAssignedCollatorsPublic: { orchestratorChain: "Vec", containerChains: "BTreeMap>", }, - /** Lookup323: pallet_services_payment::pallet::Error */ + /** Lookup327: pallet_services_payment::pallet::Error */ PalletServicesPaymentError: { _enum: ["InsufficientFundsToPurchaseCredits", "InsufficientCredits", "CreditPriceTooExpensive"], }, - /** Lookup324: pallet_data_preservers::pallet::Error */ + /** Lookup328: pallet_data_preservers::pallet::RegisteredProfile */ + PalletDataPreserversRegisteredProfile: { + account: "AccountId32", + deposit: "u128", + profile: "PalletDataPreserversProfile", + }, + /** Lookup329: pallet_data_preservers::pallet::Error */ PalletDataPreserversError: { - _enum: ["NoBootNodes"], + _enum: ["NoBootNodes", "UnknownProfileId", "NextProfileIdShouldBeAvailable"], }, - /** Lookup326: pallet_invulnerables::pallet::Error */ + /** Lookup331: pallet_invulnerables::pallet::Error */ PalletInvulnerablesError: { _enum: [ "TooManyInvulnerables", @@ -2026,29 +2109,29 @@ export default { "UnableToDeriveCollatorId", ], }, - /** Lookup331: sp_core::crypto::KeyTypeId */ + /** Lookup336: sp_core::crypto::KeyTypeId */ SpCoreCryptoKeyTypeId: "[u8;4]", - /** Lookup332: pallet_session::pallet::Error */ + /** Lookup337: pallet_session::pallet::Error */ PalletSessionError: { _enum: ["InvalidProof", "NoAssociatedValidatorId", "DuplicatedKey", "NoKeys", "NoAccount"], }, - /** Lookup336: pallet_author_inherent::pallet::Error */ + /** Lookup341: pallet_author_inherent::pallet::Error */ PalletAuthorInherentError: { _enum: ["AuthorAlreadySet", "NoAccountId", "CannotBeAuthor"], }, - /** Lookup337: pallet_inflation_rewards::pallet::ChainsToRewardValue */ + /** Lookup342: pallet_inflation_rewards::pallet::ChainsToRewardValue */ PalletInflationRewardsChainsToRewardValue: { paraIds: "Vec", rewardsPerChain: "u128", }, - /** Lookup338: pallet_treasury::Proposal */ + /** Lookup343: pallet_treasury::Proposal */ PalletTreasuryProposal: { proposer: "AccountId32", value: "u128", beneficiary: "AccountId32", bond: "u128", }, - /** Lookup340: pallet_treasury::SpendStatus */ + /** Lookup345: pallet_treasury::SpendStatus */ PalletTreasurySpendStatus: { assetKind: "Null", amount: "u128", @@ -2057,7 +2140,7 @@ export default { expireAt: "u32", status: "PalletTreasuryPaymentState", }, - /** Lookup341: pallet_treasury::PaymentState */ + /** Lookup346: pallet_treasury::PaymentState */ PalletTreasuryPaymentState: { _enum: { Pending: "Null", @@ -2067,9 +2150,9 @@ export default { Failed: "Null", }, }, - /** Lookup343: frame_support::PalletId */ + /** Lookup348: frame_support::PalletId */ FrameSupportPalletId: "[u8;8]", - /** Lookup344: pallet_treasury::pallet::Error */ + /** Lookup349: pallet_treasury::pallet::Error */ PalletTreasuryError: { _enum: [ "InsufficientProposersBalance", @@ -2086,20 +2169,20 @@ export default { "Inconclusive", ], }, - /** Lookup349: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender */ + /** Lookup354: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender */ FrameSystemExtensionsCheckNonZeroSender: "Null", - /** Lookup350: frame_system::extensions::check_spec_version::CheckSpecVersion */ + /** Lookup355: frame_system::extensions::check_spec_version::CheckSpecVersion */ FrameSystemExtensionsCheckSpecVersion: "Null", - /** Lookup351: frame_system::extensions::check_tx_version::CheckTxVersion */ + /** Lookup356: frame_system::extensions::check_tx_version::CheckTxVersion */ FrameSystemExtensionsCheckTxVersion: "Null", - /** Lookup352: frame_system::extensions::check_genesis::CheckGenesis */ + /** Lookup357: frame_system::extensions::check_genesis::CheckGenesis */ FrameSystemExtensionsCheckGenesis: "Null", - /** Lookup355: frame_system::extensions::check_nonce::CheckNonce */ + /** Lookup360: frame_system::extensions::check_nonce::CheckNonce */ FrameSystemExtensionsCheckNonce: "Compact", - /** Lookup356: frame_system::extensions::check_weight::CheckWeight */ + /** Lookup361: frame_system::extensions::check_weight::CheckWeight */ FrameSystemExtensionsCheckWeight: "Null", - /** Lookup357: pallet_transaction_payment::ChargeTransactionPayment */ + /** Lookup362: pallet_transaction_payment::ChargeTransactionPayment */ PalletTransactionPaymentChargeTransactionPayment: "Compact", - /** Lookup358: flashbox_runtime::Runtime */ + /** Lookup363: flashbox_runtime::Runtime */ FlashboxRuntimeRuntime: "Null", }; diff --git a/typescript-api/src/flashbox/interfaces/registry.ts b/typescript-api/src/flashbox/interfaces/registry.ts index 2568c3c43..abbf39e15 100644 --- a/typescript-api/src/flashbox/interfaces/registry.ts +++ b/typescript-api/src/flashbox/interfaces/registry.ts @@ -77,6 +77,11 @@ import type { PalletDataPreserversCall, PalletDataPreserversError, PalletDataPreserversEvent, + PalletDataPreserversHoldReason, + PalletDataPreserversParaIdsFilter, + PalletDataPreserversProfile, + PalletDataPreserversProfileMode, + PalletDataPreserversRegisteredProfile, PalletIdentityAuthorityProperties, PalletIdentityCall, PalletIdentityError, @@ -257,6 +262,11 @@ declare module "@polkadot/types/types/registry" { PalletDataPreserversCall: PalletDataPreserversCall; PalletDataPreserversError: PalletDataPreserversError; PalletDataPreserversEvent: PalletDataPreserversEvent; + PalletDataPreserversHoldReason: PalletDataPreserversHoldReason; + PalletDataPreserversParaIdsFilter: PalletDataPreserversParaIdsFilter; + PalletDataPreserversProfile: PalletDataPreserversProfile; + PalletDataPreserversProfileMode: PalletDataPreserversProfileMode; + PalletDataPreserversRegisteredProfile: PalletDataPreserversRegisteredProfile; PalletIdentityAuthorityProperties: PalletIdentityAuthorityProperties; PalletIdentityCall: PalletIdentityCall; PalletIdentityError: PalletIdentityError; diff --git a/typescript-api/src/flashbox/interfaces/types-lookup.ts b/typescript-api/src/flashbox/interfaces/types-lookup.ts index 027e7e620..3c4b814a2 100644 --- a/typescript-api/src/flashbox/interfaces/types-lookup.ts +++ b/typescript-api/src/flashbox/interfaces/types-lookup.ts @@ -933,7 +933,24 @@ declare module "@polkadot/types/lookup" { readonly asBootNodesChanged: { readonly paraId: u32; } & Struct; - readonly type: "BootNodesChanged"; + readonly isProfileCreated: boolean; + readonly asProfileCreated: { + readonly account: AccountId32; + readonly profileId: u64; + readonly deposit: u128; + } & Struct; + readonly isProfileUpdated: boolean; + readonly asProfileUpdated: { + readonly profileId: u64; + readonly oldDeposit: u128; + readonly newDeposit: u128; + } & Struct; + readonly isProfileDeleted: boolean; + readonly asProfileDeleted: { + readonly profileId: u64; + readonly releasedDeposit: u128; + } & Struct; + readonly type: "BootNodesChanged" | "ProfileCreated" | "ProfileUpdated" | "ProfileDeleted"; } /** @name PalletInvulnerablesEvent (68) */ @@ -2102,10 +2119,71 @@ declare module "@polkadot/types/lookup" { readonly paraId: u32; readonly bootNodes: Vec; } & Struct; - readonly type: "SetBootNodes"; + readonly isCreateProfile: boolean; + readonly asCreateProfile: { + readonly profile: PalletDataPreserversProfile; + } & Struct; + readonly isUpdateProfile: boolean; + readonly asUpdateProfile: { + readonly profileId: u64; + readonly profile: PalletDataPreserversProfile; + } & Struct; + readonly isDeleteProfile: boolean; + readonly asDeleteProfile: { + readonly profileId: u64; + } & Struct; + readonly isForceCreateProfile: boolean; + readonly asForceCreateProfile: { + readonly profile: PalletDataPreserversProfile; + readonly forAccount: AccountId32; + } & Struct; + readonly isForceUpdateProfile: boolean; + readonly asForceUpdateProfile: { + readonly profileId: u64; + readonly profile: PalletDataPreserversProfile; + } & Struct; + readonly isForceDeleteProfile: boolean; + readonly asForceDeleteProfile: { + readonly profileId: u64; + } & Struct; + readonly type: + | "SetBootNodes" + | "CreateProfile" + | "UpdateProfile" + | "DeleteProfile" + | "ForceCreateProfile" + | "ForceUpdateProfile" + | "ForceDeleteProfile"; + } + + /** @name PalletDataPreserversProfile (229) */ + interface PalletDataPreserversProfile extends Struct { + readonly url: Bytes; + readonly paraIds: PalletDataPreserversParaIdsFilter; + readonly mode: PalletDataPreserversProfileMode; + } + + /** @name PalletDataPreserversParaIdsFilter (230) */ + interface PalletDataPreserversParaIdsFilter extends Enum { + readonly isAnyParaId: boolean; + readonly isWhitelist: boolean; + readonly asWhitelist: Vec; + readonly isBlacklist: boolean; + readonly asBlacklist: Vec; + readonly type: "AnyParaId" | "Whitelist" | "Blacklist"; + } + + /** @name PalletDataPreserversProfileMode (233) */ + interface PalletDataPreserversProfileMode extends Enum { + readonly isBootnode: boolean; + readonly isRpc: boolean; + readonly asRpc: { + readonly supportsEthereumRpcs: bool; + } & Struct; + readonly type: "Bootnode" | "Rpc"; } - /** @name PalletInvulnerablesCall (229) */ + /** @name PalletInvulnerablesCall (234) */ interface PalletInvulnerablesCall extends Enum { readonly isAddInvulnerable: boolean; readonly asAddInvulnerable: { @@ -2118,7 +2196,7 @@ declare module "@polkadot/types/lookup" { readonly type: "AddInvulnerable" | "RemoveInvulnerable"; } - /** @name PalletSessionCall (230) */ + /** @name PalletSessionCall (235) */ interface PalletSessionCall extends Enum { readonly isSetKeys: boolean; readonly asSetKeys: { @@ -2129,24 +2207,24 @@ declare module "@polkadot/types/lookup" { readonly type: "SetKeys" | "PurgeKeys"; } - /** @name FlashboxRuntimeSessionKeys (231) */ + /** @name FlashboxRuntimeSessionKeys (236) */ interface FlashboxRuntimeSessionKeys extends Struct { readonly nimbus: NimbusPrimitivesNimbusCryptoPublic; } - /** @name NimbusPrimitivesNimbusCryptoPublic (232) */ + /** @name NimbusPrimitivesNimbusCryptoPublic (237) */ interface NimbusPrimitivesNimbusCryptoPublic extends SpCoreSr25519Public {} - /** @name SpCoreSr25519Public (233) */ + /** @name SpCoreSr25519Public (238) */ interface SpCoreSr25519Public extends U8aFixed {} - /** @name PalletAuthorInherentCall (234) */ + /** @name PalletAuthorInherentCall (239) */ interface PalletAuthorInherentCall extends Enum { readonly isKickOffAuthorshipValidation: boolean; readonly type: "KickOffAuthorshipValidation"; } - /** @name PalletTreasuryCall (235) */ + /** @name PalletTreasuryCall (240) */ interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { @@ -2201,7 +2279,7 @@ declare module "@polkadot/types/lookup" { | "VoidSpend"; } - /** @name PalletRootTestingCall (236) */ + /** @name PalletRootTestingCall (241) */ interface PalletRootTestingCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -2211,33 +2289,33 @@ declare module "@polkadot/types/lookup" { readonly type: "FillBlock" | "TriggerDefensive"; } - /** @name PalletSudoError (237) */ + /** @name PalletSudoError (242) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: "RequireSudo"; } - /** @name PalletUtilityError (238) */ + /** @name PalletUtilityError (243) */ interface PalletUtilityError extends Enum { readonly isTooManyCalls: boolean; readonly type: "TooManyCalls"; } - /** @name PalletProxyProxyDefinition (241) */ + /** @name PalletProxyProxyDefinition (246) */ interface PalletProxyProxyDefinition extends Struct { readonly delegate: AccountId32; readonly proxyType: FlashboxRuntimeProxyType; readonly delay: u32; } - /** @name PalletProxyAnnouncement (245) */ + /** @name PalletProxyAnnouncement (250) */ interface PalletProxyAnnouncement extends Struct { readonly real: AccountId32; readonly callHash: H256; readonly height: u32; } - /** @name PalletProxyError (247) */ + /** @name PalletProxyError (252) */ interface PalletProxyError extends Enum { readonly isTooMany: boolean; readonly isNotFound: boolean; @@ -2258,7 +2336,7 @@ declare module "@polkadot/types/lookup" { | "NoSelfProxy"; } - /** @name PalletMigrationsError (248) */ + /** @name PalletMigrationsError (253) */ interface PalletMigrationsError extends Enum { readonly isPreimageMissing: boolean; readonly isWrongUpperBound: boolean; @@ -2267,14 +2345,14 @@ declare module "@polkadot/types/lookup" { readonly type: "PreimageMissing" | "WrongUpperBound" | "PreimageIsTooBig" | "PreimageAlreadyExists"; } - /** @name PalletMaintenanceModeError (249) */ + /** @name PalletMaintenanceModeError (254) */ interface PalletMaintenanceModeError extends Enum { readonly isAlreadyInMaintenanceMode: boolean; readonly isNotInMaintenanceMode: boolean; readonly type: "AlreadyInMaintenanceMode" | "NotInMaintenanceMode"; } - /** @name PalletTxPauseError (250) */ + /** @name PalletTxPauseError (255) */ interface PalletTxPauseError extends Enum { readonly isIsPaused: boolean; readonly isIsUnpaused: boolean; @@ -2283,14 +2361,14 @@ declare module "@polkadot/types/lookup" { readonly type: "IsPaused" | "IsUnpaused" | "Unpausable" | "NotFound"; } - /** @name PalletBalancesBalanceLock (252) */ + /** @name PalletBalancesBalanceLock (257) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (253) */ + /** @name PalletBalancesReasons (258) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -2298,52 +2376,60 @@ declare module "@polkadot/types/lookup" { readonly type: "Fee" | "Misc" | "All"; } - /** @name PalletBalancesReserveData (256) */ + /** @name PalletBalancesReserveData (261) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name PalletBalancesIdAmountRuntimeHoldReason (259) */ + /** @name PalletBalancesIdAmountRuntimeHoldReason (264) */ interface PalletBalancesIdAmountRuntimeHoldReason extends Struct { readonly id: FlashboxRuntimeRuntimeHoldReason; readonly amount: u128; } - /** @name FlashboxRuntimeRuntimeHoldReason (260) */ + /** @name FlashboxRuntimeRuntimeHoldReason (265) */ interface FlashboxRuntimeRuntimeHoldReason extends Enum { readonly isStreamPayment: boolean; readonly asStreamPayment: PalletStreamPaymentHoldReason; - readonly type: "StreamPayment"; + readonly isDataPreservers: boolean; + readonly asDataPreservers: PalletDataPreserversHoldReason; + readonly type: "StreamPayment" | "DataPreservers"; } - /** @name PalletStreamPaymentHoldReason (261) */ + /** @name PalletStreamPaymentHoldReason (266) */ interface PalletStreamPaymentHoldReason extends Enum { readonly isStreamPayment: boolean; readonly isStreamOpened: boolean; readonly type: "StreamPayment" | "StreamOpened"; } - /** @name PalletBalancesIdAmountRuntimeFreezeReason (264) */ + /** @name PalletDataPreserversHoldReason (267) */ + interface PalletDataPreserversHoldReason extends Enum { + readonly isProfileDeposit: boolean; + readonly type: "ProfileDeposit"; + } + + /** @name PalletBalancesIdAmountRuntimeFreezeReason (270) */ interface PalletBalancesIdAmountRuntimeFreezeReason extends Struct { readonly id: FlashboxRuntimeRuntimeFreezeReason; readonly amount: u128; } - /** @name FlashboxRuntimeRuntimeFreezeReason (265) */ + /** @name FlashboxRuntimeRuntimeFreezeReason (271) */ interface FlashboxRuntimeRuntimeFreezeReason extends Enum { readonly isStreamPayment: boolean; readonly asStreamPayment: PalletStreamPaymentFreezeReason; readonly type: "StreamPayment"; } - /** @name PalletStreamPaymentFreezeReason (266) */ + /** @name PalletStreamPaymentFreezeReason (272) */ interface PalletStreamPaymentFreezeReason extends Enum { readonly isStreamPayment: boolean; readonly type: "StreamPayment"; } - /** @name PalletBalancesError (268) */ + /** @name PalletBalancesError (274) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -2368,14 +2454,14 @@ declare module "@polkadot/types/lookup" { | "TooManyFreezes"; } - /** @name PalletTransactionPaymentReleases (269) */ + /** @name PalletTransactionPaymentReleases (275) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: "V1Ancient" | "V2"; } - /** @name PalletStreamPaymentStream (270) */ + /** @name PalletStreamPaymentStream (276) */ interface PalletStreamPaymentStream extends Struct { readonly source: AccountId32; readonly target: AccountId32; @@ -2387,7 +2473,7 @@ declare module "@polkadot/types/lookup" { readonly openingDeposit: u128; } - /** @name PalletStreamPaymentChangeRequest (272) */ + /** @name PalletStreamPaymentChangeRequest (278) */ interface PalletStreamPaymentChangeRequest extends Struct { readonly requester: PalletStreamPaymentParty; readonly kind: PalletStreamPaymentChangeKind; @@ -2395,7 +2481,7 @@ declare module "@polkadot/types/lookup" { readonly depositChange: Option; } - /** @name PalletStreamPaymentError (274) */ + /** @name PalletStreamPaymentError (280) */ interface PalletStreamPaymentError extends Enum { readonly isUnknownStreamId: boolean; readonly isStreamIdOverflow: boolean; @@ -2430,27 +2516,27 @@ declare module "@polkadot/types/lookup" { | "ImmediateDepositChangeRequiresSameAssetId"; } - /** @name PalletIdentityRegistration (276) */ + /** @name PalletIdentityRegistration (282) */ interface PalletIdentityRegistration extends Struct { readonly judgements: Vec>; readonly deposit: u128; readonly info: PalletIdentityLegacyIdentityInfo; } - /** @name PalletIdentityRegistrarInfo (285) */ + /** @name PalletIdentityRegistrarInfo (291) */ interface PalletIdentityRegistrarInfo extends Struct { readonly account: AccountId32; readonly fee: u128; readonly fields: u64; } - /** @name PalletIdentityAuthorityProperties (287) */ + /** @name PalletIdentityAuthorityProperties (293) */ interface PalletIdentityAuthorityProperties extends Struct { readonly suffix: Bytes; readonly allocation: u32; } - /** @name PalletIdentityError (290) */ + /** @name PalletIdentityError (296) */ interface PalletIdentityError extends Enum { readonly isTooManySubAccounts: boolean; readonly isNotFound: boolean; @@ -2507,7 +2593,7 @@ declare module "@polkadot/types/lookup" { | "NotExpired"; } - /** @name PalletMultisigMultisig (292) */ + /** @name PalletMultisigMultisig (298) */ interface PalletMultisigMultisig extends Struct { readonly when: PalletMultisigTimepoint; readonly deposit: u128; @@ -2515,7 +2601,7 @@ declare module "@polkadot/types/lookup" { readonly approvals: Vec; } - /** @name PalletMultisigError (294) */ + /** @name PalletMultisigError (300) */ interface PalletMultisigError extends Enum { readonly isMinimumThreshold: boolean; readonly isAlreadyApproved: boolean; @@ -2548,18 +2634,18 @@ declare module "@polkadot/types/lookup" { | "AlreadyStored"; } - /** @name TpTraitsParathreadParams (299) */ + /** @name TpTraitsParathreadParams (303) */ interface TpTraitsParathreadParams extends Struct { readonly slotFrequency: TpTraitsSlotFrequency; } - /** @name PalletRegistrarDepositInfo (305) */ + /** @name PalletRegistrarDepositInfo (309) */ interface PalletRegistrarDepositInfo extends Struct { readonly creator: AccountId32; readonly deposit: u128; } - /** @name PalletRegistrarError (306) */ + /** @name PalletRegistrarError (310) */ interface PalletRegistrarError extends Enum { readonly isParaIdAlreadyRegistered: boolean; readonly isParaIdNotRegistered: boolean; @@ -2586,7 +2672,7 @@ declare module "@polkadot/types/lookup" { | "NotParaCreator"; } - /** @name PalletConfigurationHostConfiguration (307) */ + /** @name PalletConfigurationHostConfiguration (311) */ interface PalletConfigurationHostConfiguration extends Struct { readonly maxCollators: u32; readonly minOrchestratorCollators: u32; @@ -2598,26 +2684,26 @@ declare module "@polkadot/types/lookup" { readonly targetContainerChainFullness: Perbill; } - /** @name PalletConfigurationError (310) */ + /** @name PalletConfigurationError (314) */ interface PalletConfigurationError extends Enum { readonly isInvalidNewValue: boolean; readonly type: "InvalidNewValue"; } - /** @name DpCollatorAssignmentAssignedCollatorsAccountId32 (311) */ + /** @name DpCollatorAssignmentAssignedCollatorsAccountId32 (315) */ interface DpCollatorAssignmentAssignedCollatorsAccountId32 extends Struct { readonly orchestratorChain: Vec; readonly containerChains: BTreeMap>; } - /** @name PalletAuthorNotingContainerChainBlockInfo (316) */ + /** @name PalletAuthorNotingContainerChainBlockInfo (320) */ interface PalletAuthorNotingContainerChainBlockInfo extends Struct { readonly blockNumber: u32; readonly author: AccountId32; readonly latestSlotNumber: u64; } - /** @name PalletAuthorNotingError (317) */ + /** @name PalletAuthorNotingError (321) */ interface PalletAuthorNotingError extends Enum { readonly isFailedReading: boolean; readonly isFailedDecodingHeader: boolean; @@ -2636,13 +2722,13 @@ declare module "@polkadot/types/lookup" { | "NonAuraDigest"; } - /** @name DpCollatorAssignmentAssignedCollatorsPublic (318) */ + /** @name DpCollatorAssignmentAssignedCollatorsPublic (322) */ interface DpCollatorAssignmentAssignedCollatorsPublic extends Struct { readonly orchestratorChain: Vec; readonly containerChains: BTreeMap>; } - /** @name PalletServicesPaymentError (323) */ + /** @name PalletServicesPaymentError (327) */ interface PalletServicesPaymentError extends Enum { readonly isInsufficientFundsToPurchaseCredits: boolean; readonly isInsufficientCredits: boolean; @@ -2650,13 +2736,22 @@ declare module "@polkadot/types/lookup" { readonly type: "InsufficientFundsToPurchaseCredits" | "InsufficientCredits" | "CreditPriceTooExpensive"; } - /** @name PalletDataPreserversError (324) */ + /** @name PalletDataPreserversRegisteredProfile (328) */ + interface PalletDataPreserversRegisteredProfile extends Struct { + readonly account: AccountId32; + readonly deposit: u128; + readonly profile: PalletDataPreserversProfile; + } + + /** @name PalletDataPreserversError (329) */ interface PalletDataPreserversError extends Enum { readonly isNoBootNodes: boolean; - readonly type: "NoBootNodes"; + readonly isUnknownProfileId: boolean; + readonly isNextProfileIdShouldBeAvailable: boolean; + readonly type: "NoBootNodes" | "UnknownProfileId" | "NextProfileIdShouldBeAvailable"; } - /** @name PalletInvulnerablesError (326) */ + /** @name PalletInvulnerablesError (331) */ interface PalletInvulnerablesError extends Enum { readonly isTooManyInvulnerables: boolean; readonly isAlreadyInvulnerable: boolean; @@ -2671,10 +2766,10 @@ declare module "@polkadot/types/lookup" { | "UnableToDeriveCollatorId"; } - /** @name SpCoreCryptoKeyTypeId (331) */ + /** @name SpCoreCryptoKeyTypeId (336) */ interface SpCoreCryptoKeyTypeId extends U8aFixed {} - /** @name PalletSessionError (332) */ + /** @name PalletSessionError (337) */ interface PalletSessionError extends Enum { readonly isInvalidProof: boolean; readonly isNoAssociatedValidatorId: boolean; @@ -2684,7 +2779,7 @@ declare module "@polkadot/types/lookup" { readonly type: "InvalidProof" | "NoAssociatedValidatorId" | "DuplicatedKey" | "NoKeys" | "NoAccount"; } - /** @name PalletAuthorInherentError (336) */ + /** @name PalletAuthorInherentError (341) */ interface PalletAuthorInherentError extends Enum { readonly isAuthorAlreadySet: boolean; readonly isNoAccountId: boolean; @@ -2692,13 +2787,13 @@ declare module "@polkadot/types/lookup" { readonly type: "AuthorAlreadySet" | "NoAccountId" | "CannotBeAuthor"; } - /** @name PalletInflationRewardsChainsToRewardValue (337) */ + /** @name PalletInflationRewardsChainsToRewardValue (342) */ interface PalletInflationRewardsChainsToRewardValue extends Struct { readonly paraIds: Vec; readonly rewardsPerChain: u128; } - /** @name PalletTreasuryProposal (338) */ + /** @name PalletTreasuryProposal (343) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -2706,7 +2801,7 @@ declare module "@polkadot/types/lookup" { readonly bond: u128; } - /** @name PalletTreasurySpendStatus (340) */ + /** @name PalletTreasurySpendStatus (345) */ interface PalletTreasurySpendStatus extends Struct { readonly assetKind: Null; readonly amount: u128; @@ -2716,7 +2811,7 @@ declare module "@polkadot/types/lookup" { readonly status: PalletTreasuryPaymentState; } - /** @name PalletTreasuryPaymentState (341) */ + /** @name PalletTreasuryPaymentState (346) */ interface PalletTreasuryPaymentState extends Enum { readonly isPending: boolean; readonly isAttempted: boolean; @@ -2727,10 +2822,10 @@ declare module "@polkadot/types/lookup" { readonly type: "Pending" | "Attempted" | "Failed"; } - /** @name FrameSupportPalletId (343) */ + /** @name FrameSupportPalletId (348) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (344) */ + /** @name PalletTreasuryError (349) */ interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; @@ -2759,27 +2854,27 @@ declare module "@polkadot/types/lookup" { | "Inconclusive"; } - /** @name FrameSystemExtensionsCheckNonZeroSender (349) */ + /** @name FrameSystemExtensionsCheckNonZeroSender (354) */ type FrameSystemExtensionsCheckNonZeroSender = Null; - /** @name FrameSystemExtensionsCheckSpecVersion (350) */ + /** @name FrameSystemExtensionsCheckSpecVersion (355) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckTxVersion (351) */ + /** @name FrameSystemExtensionsCheckTxVersion (356) */ type FrameSystemExtensionsCheckTxVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (352) */ + /** @name FrameSystemExtensionsCheckGenesis (357) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (355) */ + /** @name FrameSystemExtensionsCheckNonce (360) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (356) */ + /** @name FrameSystemExtensionsCheckWeight (361) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTransactionPaymentChargeTransactionPayment (357) */ + /** @name PalletTransactionPaymentChargeTransactionPayment (362) */ interface PalletTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name FlashboxRuntimeRuntime (358) */ + /** @name FlashboxRuntimeRuntime (363) */ type FlashboxRuntimeRuntime = Null; } // declare module