difftreelog
add rpc methods + tests
in: master
17 files changed
client/rpc/src/lib.rsdiffbeforeafterboth--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -262,6 +262,14 @@
#[method(name = "unique_totalStakingLocked")]
fn total_staking_locked(&self, staker: CrossAccountId, at: Option<BlockHash>)
-> Result<String>;
+
+ /// Return the total amount locked by staking tokens.
+ #[method(name = "unique_pendingUnstake")]
+ fn pending_unstake(
+ &self,
+ staker: Option<CrossAccountId>,
+ at: Option<BlockHash>,
+ ) -> Result<String>;
}
mod rmrk_unique_rpc {
@@ -548,6 +556,7 @@
.map(|(b, a)| (b, a.to_string()))
.collect::<Vec<_>>(), unique_api);
pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), unique_api);
+ pass_method!(pending_unstake(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), unique_api);
}
#[allow(deprecated)]
node/cli/src/service.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617// std18use std::sync::Arc;19use std::sync::Mutex;20use std::collections::BTreeMap;21use std::time::Duration;22use std::pin::Pin;23use fc_rpc_core::types::FeeHistoryCache;24use futures::{25 Stream, StreamExt,26 stream::select,27 task::{Context, Poll},28};29use tokio::time::Interval;3031use unique_rpc::overrides_handle;3233use serde::{Serialize, Deserialize};3435// Cumulus Imports36use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion};37use cumulus_client_consensus_common::ParachainConsensus;38use cumulus_client_service::{39 prepare_node_config, start_collator, start_full_node, StartCollatorParams, StartFullNodeParams,40};41use cumulus_client_cli::CollatorOptions;42use cumulus_client_network::BlockAnnounceValidator;43use cumulus_primitives_core::ParaId;44use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain;45use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult};46use cumulus_relay_chain_rpc_interface::RelayChainRPCInterface;4748// Substrate Imports49use sc_client_api::ExecutorProvider;50use sc_executor::NativeElseWasmExecutor;51use sc_executor::NativeExecutionDispatch;52use sc_network::NetworkService;53use sc_service::{BasePath, Configuration, PartialComponents, TaskManager};54use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};55use sp_keystore::SyncCryptoStorePtr;56use sp_runtime::traits::BlakeTwo256;57use substrate_prometheus_endpoint::Registry;58use sc_client_api::BlockchainEvents;5960use polkadot_service::CollatorPair;6162// Frontier Imports63use fc_rpc_core::types::FilterPool;64use fc_mapping_sync::{MappingSyncWorker, SyncStrategy};6566use unique_runtime_common::types::{67 AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block, BlockNumber,68};6970// RMRK71use up_data_structs::{72 RmrkCollectionInfo, RmrkInstanceInfo, RmrkResourceInfo, RmrkPropertyInfo, RmrkBaseInfo,73 RmrkPartType, RmrkTheme,74};7576/// Unique native executor instance.77#[cfg(feature = "unique-runtime")]78pub struct UniqueRuntimeExecutor;7980#[cfg(feature = "quartz-runtime")]81/// Quartz native executor instance.82pub struct QuartzRuntimeExecutor;8384/// Opal native executor instance.85pub struct OpalRuntimeExecutor;8687#[cfg(feature = "unique-runtime")]88pub type DefaultRuntimeExecutor = UniqueRuntimeExecutor;8990#[cfg(all(not(feature = "unique-runtime"), feature = "quartz-runtime"))]91pub type DefaultRuntimeExecutor = QuartzRuntimeExecutor;9293#[cfg(all(not(feature = "unique-runtime"), not(feature = "quartz-runtime")))]94pub type DefaultRuntimeExecutor = OpalRuntimeExecutor;9596#[cfg(feature = "unique-runtime")]97impl NativeExecutionDispatch for UniqueRuntimeExecutor {98 type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;99100 fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {101 unique_runtime::api::dispatch(method, data)102 }103104 fn native_version() -> sc_executor::NativeVersion {105 unique_runtime::native_version()106 }107}108109#[cfg(feature = "quartz-runtime")]110impl NativeExecutionDispatch for QuartzRuntimeExecutor {111 type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;112113 fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {114 quartz_runtime::api::dispatch(method, data)115 }116117 fn native_version() -> sc_executor::NativeVersion {118 quartz_runtime::native_version()119 }120}121122impl NativeExecutionDispatch for OpalRuntimeExecutor {123 type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;124125 fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {126 opal_runtime::api::dispatch(method, data)127 }128129 fn native_version() -> sc_executor::NativeVersion {130 opal_runtime::native_version()131 }132}133134pub struct AutosealInterval {135 interval: Interval,136}137138impl AutosealInterval {139 pub fn new(config: &Configuration, interval: Duration) -> Self {140 let _tokio_runtime = config.tokio_handle.enter();141 let interval = tokio::time::interval(interval);142143 Self { interval }144 }145}146147impl Stream for AutosealInterval {148 type Item = tokio::time::Instant;149150 fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {151 self.interval.poll_tick(cx).map(Some)152 }153}154155pub fn open_frontier_backend(config: &Configuration) -> Result<Arc<fc_db::Backend<Block>>, String> {156 let config_dir = config157 .base_path158 .as_ref()159 .map(|base_path| base_path.config_dir(config.chain_spec.id()))160 .unwrap_or_else(|| {161 BasePath::from_project("", "", "unique").config_dir(config.chain_spec.id())162 });163 let database_dir = config_dir.join("frontier").join("db");164165 Ok(Arc::new(fc_db::Backend::<Block>::new(166 &fc_db::DatabaseSettings {167 source: fc_db::DatabaseSource::RocksDb {168 path: database_dir,169 cache_size: 0,170 },171 },172 )?))173}174175type FullClient<RuntimeApi, ExecutorDispatch> =176 sc_service::TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<ExecutorDispatch>>;177type FullBackend = sc_service::TFullBackend<Block>;178type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;179180/// Starts a `ServiceBuilder` for a full service.181///182/// Use this macro if you don't actually need the full service, but just the builder in order to183/// be able to perform chain operations.184#[allow(clippy::type_complexity)]185pub fn new_partial<RuntimeApi, ExecutorDispatch, BIQ>(186 config: &Configuration,187 build_import_queue: BIQ,188) -> Result<189 PartialComponents<190 FullClient<RuntimeApi, ExecutorDispatch>,191 FullBackend,192 FullSelectChain,193 sc_consensus::DefaultImportQueue<Block, FullClient<RuntimeApi, ExecutorDispatch>>,194 sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, ExecutorDispatch>>,195 (196 Option<Telemetry>,197 Option<FilterPool>,198 Arc<fc_db::Backend<Block>>,199 Option<TelemetryWorkerHandle>,200 FeeHistoryCache,201 ),202 >,203 sc_service::Error,204>205where206 sc_client_api::StateBackendFor<FullBackend, Block>: sp_api::StateBackend<BlakeTwo256>,207 RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>208 + Send209 + Sync210 + 'static,211 RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>,212 ExecutorDispatch: NativeExecutionDispatch + 'static,213 BIQ: FnOnce(214 Arc<FullClient<RuntimeApi, ExecutorDispatch>>,215 &Configuration,216 Option<TelemetryHandle>,217 &TaskManager,218 ) -> Result<219 sc_consensus::DefaultImportQueue<Block, FullClient<RuntimeApi, ExecutorDispatch>>,220 sc_service::Error,221 >,222{223 let _telemetry = config224 .telemetry_endpoints225 .clone()226 .filter(|x| !x.is_empty())227 .map(|endpoints| -> Result<_, sc_telemetry::Error> {228 let worker = TelemetryWorker::new(16)?;229 let telemetry = worker.handle().new_telemetry(endpoints);230 Ok((worker, telemetry))231 })232 .transpose()?;233234 let telemetry = config235 .telemetry_endpoints236 .clone()237 .filter(|x| !x.is_empty())238 .map(|endpoints| -> Result<_, sc_telemetry::Error> {239 let worker = TelemetryWorker::new(16)?;240 let telemetry = worker.handle().new_telemetry(endpoints);241 Ok((worker, telemetry))242 })243 .transpose()?;244245 let executor = NativeElseWasmExecutor::<ExecutorDispatch>::new(246 config.wasm_method,247 config.default_heap_pages,248 config.max_runtime_instances,249 config.runtime_cache_size,250 );251252 let (client, backend, keystore_container, task_manager) =253 sc_service::new_full_parts::<Block, RuntimeApi, _>(254 config,255 telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),256 executor,257 )?;258 let client = Arc::new(client);259260 let telemetry_worker_handle = telemetry.as_ref().map(|(worker, _)| worker.handle());261262 let telemetry = telemetry.map(|(worker, telemetry)| {263 task_manager264 .spawn_handle()265 .spawn("telemetry", None, worker.run());266 telemetry267 });268269 let select_chain = sc_consensus::LongestChain::new(backend.clone());270271 let transaction_pool = sc_transaction_pool::BasicPool::new_full(272 config.transaction_pool.clone(),273 config.role.is_authority().into(),274 config.prometheus_registry(),275 task_manager.spawn_essential_handle(),276 client.clone(),277 );278279 let filter_pool: Option<FilterPool> = Some(Arc::new(Mutex::new(BTreeMap::new())));280281 let frontier_backend = open_frontier_backend(config)?;282283 let import_queue = build_import_queue(284 client.clone(),285 config,286 telemetry.as_ref().map(|telemetry| telemetry.handle()),287 &task_manager,288 )?;289 let fee_history_cache: FeeHistoryCache = Arc::new(Mutex::new(BTreeMap::new()));290291 let params = PartialComponents {292 backend,293 client,294 import_queue,295 keystore_container,296 task_manager,297 transaction_pool,298 select_chain,299 other: (300 telemetry,301 filter_pool,302 frontier_backend,303 telemetry_worker_handle,304 fee_history_cache,305 ),306 };307308 Ok(params)309}310311async fn build_relay_chain_interface(312 polkadot_config: Configuration,313 parachain_config: &Configuration,314 telemetry_worker_handle: Option<TelemetryWorkerHandle>,315 task_manager: &mut TaskManager,316 collator_options: CollatorOptions,317 hwbench: Option<sc_sysinfo::HwBench>,318) -> RelayChainResult<(319 Arc<(dyn RelayChainInterface + 'static)>,320 Option<CollatorPair>,321)> {322 match collator_options.relay_chain_rpc_url {323 Some(relay_chain_url) => Ok((324 Arc::new(RelayChainRPCInterface::new(relay_chain_url).await?) as Arc<_>,325 None,326 )),327 None => build_inprocess_relay_chain(328 polkadot_config,329 parachain_config,330 telemetry_worker_handle,331 task_manager,332 hwbench,333 ),334 }335}336337/// Start a node with the given parachain `Configuration` and relay chain `Configuration`.338///339/// This is the actual implementation that is abstract over the executor and the runtime api.340#[sc_tracing::logging::prefix_logs_with("Parachain")]341async fn start_node_impl<Runtime, RuntimeApi, ExecutorDispatch, BIQ, BIC>(342 parachain_config: Configuration,343 polkadot_config: Configuration,344 collator_options: CollatorOptions,345 id: ParaId,346 build_import_queue: BIQ,347 build_consensus: BIC,348 hwbench: Option<sc_sysinfo::HwBench>,349) -> sc_service::error::Result<(TaskManager, Arc<FullClient<RuntimeApi, ExecutorDispatch>>)>350where351 sc_client_api::StateBackendFor<FullBackend, Block>: sp_api::StateBackend<BlakeTwo256>,352 Runtime: RuntimeInstance + Send + Sync + 'static,353 <Runtime as RuntimeInstance>::CrossAccountId: Serialize,354 for<'de> <Runtime as RuntimeInstance>::CrossAccountId: Deserialize<'de>,355 RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>356 + Send357 + Sync358 + 'static,359 RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>360 + fp_rpc::EthereumRuntimeRPCApi<Block>361 + fp_rpc::ConvertTransactionRuntimeApi<Block>362 + sp_session::SessionKeys<Block>363 + sp_block_builder::BlockBuilder<Block>364 + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>365 + sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>366 + up_rpc::UniqueApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>367 + rmrk_rpc::RmrkApi<368 Block,369 AccountId,370 RmrkCollectionInfo<AccountId>,371 RmrkInstanceInfo<AccountId>,372 RmrkResourceInfo,373 RmrkPropertyInfo,374 RmrkBaseInfo<AccountId>,375 RmrkPartType,376 RmrkTheme,377 > + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>378 + sp_api::Metadata<Block>379 + sp_offchain::OffchainWorkerApi<Block>380 + cumulus_primitives_core::CollectCollationInfo<Block>,381 ExecutorDispatch: NativeExecutionDispatch + 'static,382 BIQ: FnOnce(383 Arc<FullClient<RuntimeApi, ExecutorDispatch>>,384 &Configuration,385 Option<TelemetryHandle>,386 &TaskManager,387 ) -> Result<388 sc_consensus::DefaultImportQueue<Block, FullClient<RuntimeApi, ExecutorDispatch>>,389 sc_service::Error,390 >,391 BIC: FnOnce(392 Arc<FullClient<RuntimeApi, ExecutorDispatch>>,393 Option<&Registry>,394 Option<TelemetryHandle>,395 &TaskManager,396 Arc<dyn RelayChainInterface>,397 Arc<sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, ExecutorDispatch>>>,398 Arc<NetworkService<Block, Hash>>,399 SyncCryptoStorePtr,400 bool,401 ) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,402{403 let parachain_config = prepare_node_config(parachain_config);404405 let params =406 new_partial::<RuntimeApi, ExecutorDispatch, BIQ>(¶chain_config, build_import_queue)?;407 let (mut telemetry, filter_pool, frontier_backend, telemetry_worker_handle, fee_history_cache) =408 params.other;409410 let client = params.client.clone();411 let backend = params.backend.clone();412 let mut task_manager = params.task_manager;413414 let (relay_chain_interface, collator_key) = build_relay_chain_interface(415 polkadot_config,416 ¶chain_config,417 telemetry_worker_handle,418 &mut task_manager,419 collator_options.clone(),420 hwbench.clone(),421 )422 .await423 .map_err(|e| match e {424 RelayChainError::ServiceError(polkadot_service::Error::Sub(x)) => x,425 s => s.to_string().into(),426 })?;427428 let block_announce_validator = BlockAnnounceValidator::new(relay_chain_interface.clone(), id);429430 let force_authoring = parachain_config.force_authoring;431 let validator = parachain_config.role.is_authority();432 let prometheus_registry = parachain_config.prometheus_registry().cloned();433 let transaction_pool = params.transaction_pool.clone();434 let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue);435436 let (network, system_rpc_tx, start_network) =437 sc_service::build_network(sc_service::BuildNetworkParams {438 config: ¶chain_config,439 client: client.clone(),440 transaction_pool: transaction_pool.clone(),441 spawn_handle: task_manager.spawn_handle(),442 import_queue: import_queue.clone(),443 block_announce_validator_builder: Some(Box::new(|_| {444 Box::new(block_announce_validator)445 })),446 warp_sync: None,447 })?;448449 let rpc_client = client.clone();450 let rpc_pool = transaction_pool.clone();451 let select_chain = params.select_chain.clone();452 let rpc_network = network.clone();453454 let rpc_frontier_backend = frontier_backend.clone();455456 let block_data_cache = Arc::new(fc_rpc::EthBlockDataCacheTask::new(457 task_manager.spawn_handle(),458 overrides_handle::<_, _, Runtime>(client.clone()),459 50,460 50,461 prometheus_registry.clone(),462 ));463464 task_manager.spawn_essential_handle().spawn(465 "frontier-mapping-sync-worker",466 None,467 MappingSyncWorker::new(468 client.import_notification_stream(),469 Duration::new(6, 0),470 client.clone(),471 backend.clone(),472 frontier_backend.clone(),473 3,474 0,475 SyncStrategy::Normal,476 )477 .for_each(|()| futures::future::ready(())),478 );479480 let rpc_builder = Box::new(move |deny_unsafe, subscription_task_executor| {481 let full_deps = unique_rpc::FullDeps {482 backend: rpc_frontier_backend.clone(),483 deny_unsafe,484 client: rpc_client.clone(),485 pool: rpc_pool.clone(),486 graph: rpc_pool.pool().clone(),487 // TODO: Unhardcode488 enable_dev_signer: false,489 filter_pool: filter_pool.clone(),490 network: rpc_network.clone(),491 select_chain: select_chain.clone(),492 is_authority: validator,493 // TODO: Unhardcode494 max_past_logs: 10000,495 block_data_cache: block_data_cache.clone(),496 fee_history_cache: fee_history_cache.clone(),497 // TODO: Unhardcode498 fee_history_limit: 2048,499 };500501 unique_rpc::create_full::<_, _, _, _, Runtime, RuntimeApi, _>(502 full_deps,503 subscription_task_executor,504 )505 .map_err(Into::into)506 });507508 sc_service::spawn_tasks(sc_service::SpawnTasksParams {509 rpc_builder,510 client: client.clone(),511 transaction_pool: transaction_pool.clone(),512 task_manager: &mut task_manager,513 config: parachain_config,514 keystore: params.keystore_container.sync_keystore(),515 backend: backend.clone(),516 network: network.clone(),517 system_rpc_tx,518 telemetry: telemetry.as_mut(),519 })?;520521 if let Some(hwbench) = hwbench {522 sc_sysinfo::print_hwbench(&hwbench);523524 if let Some(ref mut telemetry) = telemetry {525 let telemetry_handle = telemetry.handle();526 task_manager.spawn_handle().spawn(527 "telemetry_hwbench",528 None,529 sc_sysinfo::initialize_hwbench_telemetry(telemetry_handle, hwbench),530 );531 }532 }533534 let announce_block = {535 let network = network.clone();536 Arc::new(move |hash, data| network.announce_block(hash, data))537 };538539 let relay_chain_slot_duration = Duration::from_secs(6);540541 if validator {542 let parachain_consensus = build_consensus(543 client.clone(),544 prometheus_registry.as_ref(),545 telemetry.as_ref().map(|t| t.handle()),546 &task_manager,547 relay_chain_interface.clone(),548 transaction_pool,549 network,550 params.keystore_container.sync_keystore(),551 force_authoring,552 )?;553554 let spawner = task_manager.spawn_handle();555556 let params = StartCollatorParams {557 para_id: id,558 block_status: client.clone(),559 announce_block,560 client: client.clone(),561 task_manager: &mut task_manager,562 spawner,563 parachain_consensus,564 import_queue,565 collator_key: collator_key.expect("Command line arguments do not allow this. qed"),566 relay_chain_interface,567 relay_chain_slot_duration,568 };569570 start_collator(params).await?;571 } else {572 let params = StartFullNodeParams {573 client: client.clone(),574 announce_block,575 task_manager: &mut task_manager,576 para_id: id,577 import_queue,578 relay_chain_interface,579 relay_chain_slot_duration,580 collator_options,581 };582583 start_full_node(params)?;584 }585586 start_network.start_network();587588 Ok((task_manager, client))589}590591/// Build the import queue for the the parachain runtime.592pub fn parachain_build_import_queue<RuntimeApi, ExecutorDispatch>(593 client: Arc<FullClient<RuntimeApi, ExecutorDispatch>>,594 config: &Configuration,595 telemetry: Option<TelemetryHandle>,596 task_manager: &TaskManager,597) -> Result<598 sc_consensus::DefaultImportQueue<Block, FullClient<RuntimeApi, ExecutorDispatch>>,599 sc_service::Error,600>601where602 RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>603 + Send604 + Sync605 + 'static,606 RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>607 + sp_block_builder::BlockBuilder<Block>608 + sp_consensus_aura::AuraApi<Block, AuraId>609 + sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>,610 ExecutorDispatch: NativeExecutionDispatch + 'static,611{612 let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;613614 cumulus_client_consensus_aura::import_queue::<615 sp_consensus_aura::sr25519::AuthorityPair,616 _,617 _,618 _,619 _,620 _,621 _,622 >(cumulus_client_consensus_aura::ImportQueueParams {623 block_import: client.clone(),624 client: client.clone(),625 create_inherent_data_providers: move |_, _| async move {626 let time = sp_timestamp::InherentDataProvider::from_system_time();627628 let slot =629 sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(630 *time,631 slot_duration,632 );633634 Ok((time, slot))635 },636 registry: config.prometheus_registry(),637 can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()),638 spawner: &task_manager.spawn_essential_handle(),639 telemetry,640 })641 .map_err(Into::into)642}643644/// Start a normal parachain node.645pub async fn start_node<Runtime, RuntimeApi, ExecutorDispatch>(646 parachain_config: Configuration,647 polkadot_config: Configuration,648 collator_options: CollatorOptions,649 id: ParaId,650 hwbench: Option<sc_sysinfo::HwBench>,651) -> sc_service::error::Result<(TaskManager, Arc<FullClient<RuntimeApi, ExecutorDispatch>>)>652where653 Runtime: RuntimeInstance + Send + Sync + 'static,654 <Runtime as RuntimeInstance>::CrossAccountId: Serialize,655 for<'de> <Runtime as RuntimeInstance>::CrossAccountId: Deserialize<'de>,656 RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>657 + Send658 + Sync659 + 'static,660 RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>661 + fp_rpc::EthereumRuntimeRPCApi<Block>662 + fp_rpc::ConvertTransactionRuntimeApi<Block>663 + sp_session::SessionKeys<Block>664 + sp_block_builder::BlockBuilder<Block>665 + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>666 + sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>667 + up_rpc::UniqueApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>668 + rmrk_rpc::RmrkApi<669 Block,670 AccountId,671 RmrkCollectionInfo<AccountId>,672 RmrkInstanceInfo<AccountId>,673 RmrkResourceInfo,674 RmrkPropertyInfo,675 RmrkBaseInfo<AccountId>,676 RmrkPartType,677 RmrkTheme,678 > + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>679 + sp_api::Metadata<Block>680 + sp_offchain::OffchainWorkerApi<Block>681 + cumulus_primitives_core::CollectCollationInfo<Block>682 + sp_consensus_aura::AuraApi<Block, AuraId>,683 ExecutorDispatch: NativeExecutionDispatch + 'static,684{685 start_node_impl::<Runtime, RuntimeApi, ExecutorDispatch, _, _>(686 parachain_config,687 polkadot_config,688 collator_options,689 id,690 parachain_build_import_queue,691 |client,692 prometheus_registry,693 telemetry,694 task_manager,695 relay_chain_interface,696 transaction_pool,697 sync_oracle,698 keystore,699 force_authoring| {700 let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;701702 let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(703 task_manager.spawn_handle(),704 client.clone(),705 transaction_pool,706 prometheus_registry,707 telemetry.clone(),708 );709710 Ok(AuraConsensus::build::<711 sp_consensus_aura::sr25519::AuthorityPair,712 _,713 _,714 _,715 _,716 _,717 _,718 >(BuildAuraConsensusParams {719 proposer_factory,720 create_inherent_data_providers: move |_, (relay_parent, validation_data)| {721 let relay_chain_interface = relay_chain_interface.clone();722 async move {723 let parachain_inherent =724 cumulus_primitives_parachain_inherent::ParachainInherentData::create_at(725 relay_parent,726 &relay_chain_interface,727 &validation_data,728 id,729 ).await;730731 let time = sp_timestamp::InherentDataProvider::from_system_time();732733 let slot =734 sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(735 *time,736 slot_duration,737 );738739 let parachain_inherent = parachain_inherent.ok_or_else(|| {740 Box::<dyn std::error::Error + Send + Sync>::from(741 "Failed to create parachain inherent",742 )743 })?;744 Ok((time, slot, parachain_inherent))745 }746 },747 block_import: client.clone(),748 para_client: client,749 backoff_authoring_blocks: Option::<()>::None,750 sync_oracle,751 keystore,752 force_authoring,753 slot_duration,754 // We got around 500ms for proposing755 block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32),756 telemetry,757 max_block_proposal_slot_portion: None,758 }))759 },760 hwbench,761 )762 .await763}764765fn dev_build_import_queue<RuntimeApi, ExecutorDispatch>(766 client: Arc<FullClient<RuntimeApi, ExecutorDispatch>>,767 config: &Configuration,768 _: Option<TelemetryHandle>,769 task_manager: &TaskManager,770) -> Result<771 sc_consensus::DefaultImportQueue<Block, FullClient<RuntimeApi, ExecutorDispatch>>,772 sc_service::Error,773>774where775 RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>776 + Send777 + Sync778 + 'static,779 RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>780 + sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>,781 ExecutorDispatch: NativeExecutionDispatch + 'static,782{783 Ok(sc_consensus_manual_seal::import_queue(784 Box::new(client.clone()),785 &task_manager.spawn_essential_handle(),786 config.prometheus_registry(),787 ))788}789790/// Builds a new development service. This service uses instant seal, and mocks791/// the parachain inherent792pub fn start_dev_node<Runtime, RuntimeApi, ExecutorDispatch>(793 config: Configuration,794 autoseal_interval: Duration,795) -> sc_service::error::Result<TaskManager>796where797 Runtime: RuntimeInstance + Send + Sync + 'static,798 <Runtime as RuntimeInstance>::CrossAccountId: Serialize,799 for<'de> <Runtime as RuntimeInstance>::CrossAccountId: Deserialize<'de>,800 RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>801 + Send802 + Sync803 + 'static,804 RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>805 + fp_rpc::EthereumRuntimeRPCApi<Block>806 + fp_rpc::ConvertTransactionRuntimeApi<Block>807 + sp_session::SessionKeys<Block>808 + sp_block_builder::BlockBuilder<Block>809 + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>810 + sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>811 + up_rpc::UniqueApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>812 + rmrk_rpc::RmrkApi<813 Block,814 AccountId,815 RmrkCollectionInfo<AccountId>,816 RmrkInstanceInfo<AccountId>,817 RmrkResourceInfo,818 RmrkPropertyInfo,819 RmrkBaseInfo<AccountId>,820 RmrkPartType,821 RmrkTheme,822 > + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>823 + sp_api::Metadata<Block>824 + sp_offchain::OffchainWorkerApi<Block>825 + cumulus_primitives_core::CollectCollationInfo<Block>826 + sp_consensus_aura::AuraApi<Block, AuraId>,827 ExecutorDispatch: NativeExecutionDispatch + 'static,828{829 use sc_consensus_manual_seal::{run_manual_seal, EngineCommand, ManualSealParams};830 use fc_consensus::FrontierBlockImport;831 use sc_client_api::HeaderBackend;832833 let sc_service::PartialComponents {834 client,835 backend,836 mut task_manager,837 import_queue,838 keystore_container,839 select_chain: maybe_select_chain,840 transaction_pool,841 other:842 (telemetry, filter_pool, frontier_backend, _telemetry_worker_handle, fee_history_cache),843 } = new_partial::<RuntimeApi, ExecutorDispatch, _>(844 &config,845 dev_build_import_queue::<RuntimeApi, ExecutorDispatch>,846 )?;847 let prometheus_registry = config.prometheus_registry().cloned();848849 let block_data_cache = Arc::new(fc_rpc::EthBlockDataCacheTask::new(850 task_manager.spawn_handle(),851 overrides_handle::<_, _, Runtime>(client.clone()),852 50,853 50,854 prometheus_registry.clone(),855 ));856857 let (network, system_rpc_tx, network_starter) =858 sc_service::build_network(sc_service::BuildNetworkParams {859 config: &config,860 client: client.clone(),861 transaction_pool: transaction_pool.clone(),862 spawn_handle: task_manager.spawn_handle(),863 import_queue,864 block_announce_validator_builder: None,865 warp_sync: None,866 })?;867868 if config.offchain_worker.enabled {869 sc_service::build_offchain_workers(870 &config,871 task_manager.spawn_handle(),872 client.clone(),873 network.clone(),874 );875 }876877 let collator = config.role.is_authority();878879 let select_chain = maybe_select_chain.clone();880881 if collator {882 let block_import =883 FrontierBlockImport::new(client.clone(), client.clone(), frontier_backend.clone());884885 let env = sc_basic_authorship::ProposerFactory::new(886 task_manager.spawn_handle(),887 client.clone(),888 transaction_pool.clone(),889 prometheus_registry.as_ref(),890 telemetry.as_ref().map(|x| x.handle()),891 );892893 let transactions_commands_stream: Box<894 dyn Stream<Item = EngineCommand<Hash>> + Send + Sync + Unpin,895 > = Box::new(896 transaction_pool897 .pool()898 .validated_pool()899 .import_notification_stream()900 .map(|_| EngineCommand::SealNewBlock {901 create_empty: true,902 finalize: false,903 parent_hash: None,904 sender: None,905 }),906 );907908 let autoseal_interval = Box::pin(AutosealInterval::new(&config, autoseal_interval));909 let idle_commands_stream: Box<910 dyn Stream<Item = EngineCommand<Hash>> + Send + Sync + Unpin,911 > = Box::new(autoseal_interval.map(|_| EngineCommand::SealNewBlock {912 create_empty: true,913 finalize: false,914 parent_hash: None,915 sender: None,916 }));917918 let commands_stream = select(transactions_commands_stream, idle_commands_stream);919920 let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;921 let client_set_aside_for_cidp = client.clone();922923 task_manager.spawn_essential_handle().spawn_blocking(924 "authorship_task",925 Some("block-authoring"),926 run_manual_seal(ManualSealParams {927 block_import,928 env,929 client: client.clone(),930 pool: transaction_pool.clone(),931 commands_stream,932 select_chain: select_chain.clone(),933 consensus_data_provider: None,934 create_inherent_data_providers: move |block: Hash, ()| {935 let current_para_block = client_set_aside_for_cidp936 .number(block)937 .expect("Header lookup should succeed")938 .expect("Header passed in as parent should be present in backend.");939940 let client_for_xcm = client_set_aside_for_cidp.clone();941 async move {942 let time = sp_timestamp::InherentDataProvider::from_system_time();943944 let mocked_parachain = cumulus_primitives_parachain_inherent::MockValidationDataInherentDataProvider {945 current_para_block,946 relay_offset: 1000,947 relay_blocks_per_para_block: 2,948 xcm_config: cumulus_primitives_parachain_inherent::MockXcmConfig::new(949 &*client_for_xcm,950 block,951 Default::default(),952 Default::default(),953 ),954 raw_downward_messages: vec![],955 raw_horizontal_messages: vec![],956 };957958 let slot =959 sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(960 *time,961 slot_duration,962 );963964 Ok((time, slot, mocked_parachain))965 }966 },967 }),968 );969 }970971 task_manager.spawn_essential_handle().spawn(972 "frontier-mapping-sync-worker",973 Some("block-authoring"),974 MappingSyncWorker::new(975 client.import_notification_stream(),976 Duration::new(6, 0),977 client.clone(),978 backend.clone(),979 frontier_backend.clone(),980 3,981 0,982 SyncStrategy::Normal,983 )984 .for_each(|()| futures::future::ready(())),985 );986987 let rpc_client = client.clone();988 let rpc_pool = transaction_pool.clone();989 let rpc_network = network.clone();990 let rpc_frontier_backend = frontier_backend.clone();991 let rpc_builder = Box::new(move |deny_unsafe, subscription_executor| {992 let full_deps = unique_rpc::FullDeps {993 backend: rpc_frontier_backend.clone(),994 deny_unsafe,995 client: rpc_client.clone(),996 pool: rpc_pool.clone(),997 graph: rpc_pool.pool().clone(),998 // TODO: Unhardcode999 enable_dev_signer: false,1000 filter_pool: filter_pool.clone(),1001 network: rpc_network.clone(),1002 select_chain: select_chain.clone(),1003 is_authority: collator,1004 // TODO: Unhardcode1005 max_past_logs: 10000,1006 block_data_cache: block_data_cache.clone(),1007 fee_history_cache: fee_history_cache.clone(),1008 // TODO: Unhardcode1009 fee_history_limit: 2048,1010 };10111012 unique_rpc::create_full::<_, _, _, _, Runtime, RuntimeApi, _>(1013 full_deps,1014 subscription_executor,1015 )1016 .map_err(Into::into)1017 });10181019 sc_service::spawn_tasks(sc_service::SpawnTasksParams {1020 network,1021 client,1022 keystore: keystore_container.sync_keystore(),1023 task_manager: &mut task_manager,1024 transaction_pool,1025 rpc_builder,1026 backend,1027 system_rpc_tx,1028 config,1029 telemetry: None,1030 })?;10311032 network_starter.start_network();1033 Ok(task_manager)1034}pallets/app-promotion/src/lib.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/lib.rs
+++ b/pallets/app-promotion/src/lib.rs
@@ -31,12 +31,12 @@
#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
-pub mod types;
-
#[cfg(test)]
mod tests;
+pub mod types;
+pub mod weights;
-use sp_std::vec::Vec;
+use sp_std::{vec::Vec, iter::Sum};
use codec::EncodeLike;
use pallet_balances::BalanceLock;
pub use types::ExtendedLockableCurrency;
@@ -48,6 +48,9 @@
},
ensure,
};
+
+use weights::WeightInfo;
+
pub use pallet::*;
use pallet_evm::account::CrossAccountId;
use sp_runtime::{
@@ -79,6 +82,9 @@
type TreasuryAccountId: Get<Self::AccountId>;
+ /// Weight information for extrinsics in this pallet.
+ type WeightInfo: WeightInfo;
+
// The block number provider
type BlockNumberProvider: BlockNumberProvider<BlockNumber = Self::BlockNumber>;
@@ -136,6 +142,7 @@
fn on_initialize(current_block: T::BlockNumber) -> Weight
where
<T as frame_system::Config>::BlockNumber: From<u32>,
+ // <<T as pallet::Config>::Currency as Currency<T::AccountId>>::Balance: Sum,
{
PendingUnstake::<T>::iter()
.filter_map(|((staker, block), amount)| {
@@ -172,7 +179,7 @@
#[pallet::call]
impl<T: Config> Pallet<T> {
- #[pallet::weight(0)]
+ #[pallet::weight(T::WeightInfo::set_admin_address())]
pub fn set_admin_address(origin: OriginFor<T>, admin: T::AccountId) -> DispatchResult {
ensure_root(origin)?;
<Admin<T>>::set(Some(admin));
@@ -180,7 +187,7 @@
Ok(())
}
- #[pallet::weight(0)]
+ #[pallet::weight(T::WeightInfo::start_app_promotion())]
pub fn start_app_promotion(
origin: OriginFor<T>,
promotion_start_relay_block: T::BlockNumber,
@@ -201,7 +208,7 @@
Ok(())
}
- #[pallet::weight(0)]
+ #[pallet::weight(T::WeightInfo::stake())]
pub fn stake(staker: OriginFor<T>, amount: BalanceOf<T>) -> DispatchResult {
let staker_id = ensure_signed(staker)?;
@@ -210,10 +217,16 @@
ensure!(balance >= amount, ArithmeticError::Underflow);
- Self::set_lock_unchecked(&staker_id, amount);
+ <<T as Config>::Currency as Currency<T::AccountId>>::ensure_can_withdraw(
+ &staker_id,
+ amount,
+ WithdrawReasons::all(),
+ balance - amount,
+ )?;
+
+ Self::add_lock_balance(&staker_id, amount)?;
- let block_number =
- <T::BlockNumberProvider as BlockNumberProvider>::current_block_number();
+ let block_number = frame_system::Pallet::<T>::block_number();
<Staked<T>>::insert(
(&staker_id, block_number),
@@ -231,7 +244,7 @@
Ok(())
}
- #[pallet::weight(0)]
+ #[pallet::weight(T::WeightInfo::unstake())]
pub fn unstake(staker: OriginFor<T>, amount: BalanceOf<T>) -> DispatchResult {
let staker_id = ensure_signed(staker)?;
@@ -249,7 +262,7 @@
.ok_or(ArithmeticError::Underflow)?,
);
- let block = <T::BlockNumberProvider>::current_block_number() + WEEK.into();
+ let block = frame_system::Pallet::<T>::block_number() + WEEK.into();
<PendingUnstake<T>>::insert(
(&staker_id, block),
<PendingUnstake<T>>::get((&staker_id, block))
@@ -400,8 +413,8 @@
fn add_lock_balance(staker: &T::AccountId, amount: BalanceOf<T>) -> DispatchResult {
Self::get_locked_balance(staker)
- .map(|l| l.amount)
- .and_then(|b| b.checked_add(&amount))
+ .map_or(<BalanceOf<T>>::default(), |l| l.amount)
+ .checked_add(&amount)
.map(|new_lock| Self::set_lock_unchecked(staker, new_lock))
.ok_or(ArithmeticError::Overflow.into())
}
@@ -437,10 +450,11 @@
pub fn total_staked_by_id_per_block(
staker: impl EncodeLike<T::AccountId>,
) -> Option<Vec<(T::BlockNumber, BalanceOf<T>)>> {
- let staked = Staked::<T>::iter_prefix((staker,))
+ let mut staked = Staked::<T>::iter_prefix((staker,))
.into_iter()
.map(|(block, amount)| (block, amount))
.collect::<Vec<_>>();
+ staked.sort_by_key(|(block, _)| *block);
if !staked.is_empty() {
Some(staked)
} else {
@@ -495,3 +509,14 @@
day_rate * base
}
}
+
+impl<T: Config> Pallet<T>
+where
+ <<T as pallet::Config>::Currency as Currency<T::AccountId>>::Balance: Sum,
+{
+ pub fn cross_id_pending_unstake(staker: Option<T::CrossAccountId>) -> BalanceOf<T> {
+ staker.map_or(PendingUnstake::<T>::iter_values().sum(), |s| {
+ PendingUnstake::<T>::iter_prefix_values((s.as_sub(),)).sum()
+ })
+ }
+}
primitives/rpc/src/lib.rsdiffbeforeafterboth--- a/primitives/rpc/src/lib.rs
+++ b/primitives/rpc/src/lib.rs
@@ -129,5 +129,6 @@
fn total_staked(staker: Option<CrossAccountId>) -> Result<u128>;
fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;
fn total_staking_locked(staker: CrossAccountId) -> Result<u128>;
+ fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128>;
}
}
runtime/common/config/pallets/app_promotion.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/pallets/app_promotion.rs
@@ -0,0 +1,27 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use crate::{
+ runtime_common::config::pallets::{TreasuryAccountId, RelayChainBlockNumberProvider},
+ Runtime, Balances,
+};
+
+impl pallet_app_promotion::Config for Runtime {
+ type Currency = Balances;
+ type WeightInfo = pallet_app_promotion::weights::SubstrateWeight<Self>;
+ type TreasuryAccountId = TreasuryAccountId;
+ type BlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;
+}
runtime/common/config/pallets/mod.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -40,6 +40,9 @@
#[cfg(feature = "scheduler")]
pub mod scheduler;
+#[cfg(feature = "app-promotion")]
+pub mod app_promotion;
+
parameter_types! {
pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating();
pub const CollectionCreationPrice: Balance = 2 * UNIQUE;
runtime/common/construct_runtime/mod.rsdiffbeforeafterboth--- a/runtime/common/construct_runtime/mod.rs
+++ b/runtime/common/construct_runtime/mod.rs
@@ -77,6 +77,9 @@
#[runtimes(opal)]
RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
+ #[runtimes(opal)]
+ Promotion: pallet_app_promotion::{Pallet, Call, Storage} = 73,
+
// Frontier
EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
runtime/common/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -190,7 +190,6 @@
fn total_staked(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {
Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked(staker).unwrap_or_default())
- // Ok(0)
}
fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>, DispatchError> {
@@ -198,9 +197,12 @@
}
fn total_staking_locked(staker: CrossAccountId) -> Result<u128, DispatchError> {
- // Ok(0)
Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_locked_balance(staker))
}
+
+ fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {
+ Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_pending_unstake(staker))
+ }
}
impl rmrk_rpc::RmrkApi<
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -124,11 +124,12 @@
"orml-vesting/std",
]
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-opal-runtime = ['refungible', 'scheduler', 'rmrk']
+opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion']
refungible = []
scheduler = []
rmrk = []
+app-promotion = []
################################################################################
# Substrate Dependencies
tests/src/app-promotion.test.tsdiffbeforeafterboth--- a/tests/src/app-promotion.test.ts
+++ b/tests/src/app-promotion.test.ts
@@ -15,7 +15,7 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
import {default as usingApi, submitTransactionAsync} from './substrate/substrate-api';
-import {IKeyringPair} from '@polkadot/types/types';
+import {IKeyringPair, ITuple} from '@polkadot/types/types';
import {
createMultipleItemsExpectSuccess,
@@ -33,26 +33,38 @@
U128_MAX,
burnFromExpectSuccess,
UNIQUE,
+ getModuleNames,
+ Pallets,
+ getBlockNumber,
} from './util/helpers';
-import chai from 'chai';
+import chai, {use} from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import getBalance from './substrate/get-balance';
-import { unique } from './interfaces/definitions';
+import getBalance, {getBalanceSingle} from './substrate/get-balance';
+import {unique} from './interfaces/definitions';
+import {usingPlaygrounds} from './util/playgrounds';
+import {default as waitNewBlocks} from './substrate/wait-new-blocks';
+
+import BN from 'bn.js';
+import {mnemonicGenerate} from '@polkadot/util-crypto';
+import {UniqueHelper} from './util/playgrounds/unique';
chai.use(chaiAsPromised);
const expect = chai.expect;
let alice: IKeyringPair;
let bob: IKeyringPair;
let palletAdmin: IKeyringPair;
+let nominal: bigint;
describe('integration test: AppPromotion', () => {
- before(async () => {
- await usingApi(async (api, privateKeyWrapper) => {
+ before(async function() {
+ await usingPlaygrounds(async (helper, privateKeyWrapper) => {
+ if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip();
alice = privateKeyWrapper('//Alice');
bob = privateKeyWrapper('//Bob');
palletAdmin = privateKeyWrapper('//palletAdmin');
- const tx = api.tx.sudo.sudo(api.tx.promotion.setAdminAddress(palletAdmin.addressRaw));
+ const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(palletAdmin.addressRaw));
+ nominal = helper.balance.getOneTokenNominal();
await submitTransactionAsync(alice, tx);
});
});
@@ -69,22 +81,110 @@
// assert: query appPromotion.staked(Alice) equal [100, 200]
// assert: query appPromotion.totalStaked() increased by 200
- await usingApi(async (api, privateKeyWrapper) => {
- await submitTransactionAsync(alice, api.tx.balances.transfer(bob.addressRaw, 10n * UNIQUE));
- const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alice.address, bob.address]);
+ await usingPlaygrounds(async (helper, privateKeyWrapper) => {
+ const totalStakedBefore = (await helper.api!.rpc.unique.totalStaked()).toBigInt();
+ const staker = await createUser();
+
+ const firstStakedBlock = await helper.chain.getLatestBlockNumber();
+
+ await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled;
+ expect((await helper.api!.rpc.unique.totalStakingLocked(normalizeAccountId(staker))).toBigInt()).to.be.equal(nominal);
+ expect(9n * nominal - await helper.balance.getSubstrate(staker.address) <= nominal / 2n).to.be.true;
+ expect((await helper.api!.rpc.unique.totalStaked(normalizeAccountId(staker))).toBigInt()).to.be.equal(nominal);
+ expect((await helper.api!.rpc.unique.totalStaked()).toBigInt()).to.be.equal(totalStakedBefore + nominal);
- console.log(`alice: ${alicesBalanceBefore} \n bob: ${bobsBalanceBefore}`);
+ await waitNewBlocks(helper.api!, 1);
+ const secondStakedBlock = await helper.chain.getLatestBlockNumber();
- await submitTransactionAsync(alice, api.tx.promotion.stake(1n * UNIQUE));
- await submitTransactionAsync(bob, api.tx.promotion.stake(1n * UNIQUE));
- const alice_total_staked = (await (api.rpc.unique.totalStaked(normalizeAccountId(alice)))).toBigInt();
- const bob_total_staked = (await api.rpc.unique.totalStaked(normalizeAccountId(bob))).toBigInt();
-
- console.log(`alice staked: ${alice_total_staked} \n bob staked: ${bob_total_staked}, total staked: ${(await api.rpc.unique.totalStaked()).toBigInt()}`);
+ await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled;
+ expect((await helper.api!.rpc.unique.totalStakingLocked(normalizeAccountId(staker))).toBigInt()).to.be.equal(3n * nominal);
+
+ const stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([block, amount]) => [block.toBigInt(), amount.toBigInt()]);
+ expect(stakedPerBlock.map((x) => x[1])).to.be.deep.equal([nominal, 2n * nominal]);
+ });
+ });
+
+ it('will throws if stake amount is more than total free balance', async () => {
+ // arrange: Alice balance = 1000
+ // assert: Alice calls appPromotion.stake(1000) throws /// because Alice needs some fee
+
+ // act: Alice calls appPromotion.stake(700)
+ // assert: Alice calls appPromotion.stake(400) throws /// because Alice has ~300 free QTZ and 700 locked
+
+ await usingPlaygrounds(async helper => {
+ const staker = await createUser();
+ await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.rejected;
+ await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(7n * nominal))).to.be.eventually.fulfilled;
+ await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(4n * nominal))).to.be.eventually.rejected;
});
});
+
+ it.skip('for different accounts in one block is possible', async () => {
+ // arrange: Alice, Bob, Charlie, Dave balance = 1000
+ // arrange: Alice, Bob, Charlie, Dave calls appPromotion.stake(100) in the same time
+
+ // assert: query appPromotion.staked(Alice/Bob/Charlie/Dave) equal [100]
+ await usingPlaygrounds(async helper => {
+ const crowd = await creteAccounts([10n, 10n, 10n, 10n], alice, helper);
+ // const promises = crowd.map(async user => submitTransactionAsync(user, helper.api!.tx.promotion.stake(nominal)));
+ // await expect(Promise.all(promises)).to.be.eventually.fulfilled;
+ });
+ });
+
+});
+
+describe.skip('unstake balance extrinsic', () => {
+ before(async function() {
+ await usingPlaygrounds(async (helper, privateKeyWrapper) => {
+ if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip();
+ alice = privateKeyWrapper('//Alice');
+ bob = privateKeyWrapper('//Bob');
+ palletAdmin = privateKeyWrapper('//palletAdmin');
+ const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(palletAdmin.addressRaw));
+ nominal = helper.balance.getOneTokenNominal();
+ await submitTransactionAsync(alice, tx);
+ });
+ });
+ it('will change balance state to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => {
+ // arrange: Alice balance = 1000
+ // arrange: Alice calls appPromotion.stake(Alice, 500)
+
+ // act: Alice calls appPromotion.unstake(300)
+ // assert: Alice reserved balance to equal 300
+ // assert: query appPromotion.staked(Alice) equal [200] /// 500 - 300
+ // assert: query appPromotion.pendingUnstake(Alice) to equal [300]
+ // assert: query appPromotion.totalStaked() decreased by 300
+ });
+});
+
+
+
+async function createUser(amount?: bigint) {
+ return await usingPlaygrounds(async (helper, privateKeyWrapper) => {
+ const user: IKeyringPair = privateKeyWrapper(`//Alice+${(new Date()).getTime()}`);
+ await helper.balance.transferToSubstrate(alice, user.address, amount ? amount : 10n * helper.balance.getOneTokenNominal());
+ return user;
+ });
+}
+
+const creteAccounts = async (balances: bigint[], donor: IKeyringPair, helper: UniqueHelper) => {
+ let nonce = await helper.chain.getNonce(donor.address);
+ const tokenNominal = helper.balance.getOneTokenNominal();
+ const transactions = [];
+ const accounts = [];
+ for (const balance of balances) {
+ const recepient = helper.util.fromSeed(mnemonicGenerate());
+ accounts.push(recepient);
+ if (balance !== 0n){
+ const tx = helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, balance * tokenNominal]);
+ transactions.push(helper.signTransaction(donor, tx, 'account generation', {nonce}));
+ nonce++;
+ }
+ }
-});
\ No newline at end of file
+ await Promise.all(transactions);
+ return accounts;
+};
\ No newline at end of file
tests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-rpc.ts
+++ b/tests/src/interfaces/augment-api-rpc.ts
@@ -703,6 +703,10 @@
**/
nextSponsored: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u64>>>;
/**
+ * Returns the total amount of unstaked tokens
+ **/
+ pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
+ /**
* Get property permissions, optionally limited to the provided keys
**/
propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsPropertyKeyPermission>>>;
tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -5,1266 +5,8 @@
export default {
/**
- * Lookup3: frame_system::AccountInfo<Index, pallet_balances::AccountData<Balance>>
- **/
- FrameSystemAccountInfo: {
- nonce: 'u32',
- consumers: 'u32',
- providers: 'u32',
- sufficients: 'u32',
- data: 'PalletBalancesAccountData'
- },
- /**
- * Lookup5: pallet_balances::AccountData<Balance>
- **/
- PalletBalancesAccountData: {
- free: 'u128',
- reserved: 'u128',
- miscFrozen: 'u128',
- feeFrozen: 'u128'
- },
- /**
- * Lookup7: frame_support::weights::PerDispatchClass<T>
- **/
- FrameSupportWeightsPerDispatchClassU64: {
- normal: 'u64',
- operational: 'u64',
- mandatory: 'u64'
- },
- /**
- * Lookup11: sp_runtime::generic::digest::Digest
- **/
- SpRuntimeDigest: {
- logs: 'Vec<SpRuntimeDigestDigestItem>'
- },
- /**
- * Lookup13: sp_runtime::generic::digest::DigestItem
- **/
- SpRuntimeDigestDigestItem: {
- _enum: {
- Other: 'Bytes',
- __Unused1: 'Null',
- __Unused2: 'Null',
- __Unused3: 'Null',
- Consensus: '([u8;4],Bytes)',
- Seal: '([u8;4],Bytes)',
- PreRuntime: '([u8;4],Bytes)',
- __Unused7: 'Null',
- RuntimeEnvironmentUpdated: 'Null'
- }
- },
- /**
- * Lookup16: frame_system::EventRecord<opal_runtime::Event, primitive_types::H256>
- **/
- FrameSystemEventRecord: {
- phase: 'FrameSystemPhase',
- event: 'Event',
- topics: 'Vec<H256>'
- },
- /**
- * Lookup18: frame_system::pallet::Event<T>
- **/
- FrameSystemEvent: {
- _enum: {
- ExtrinsicSuccess: {
- dispatchInfo: 'FrameSupportWeightsDispatchInfo',
- },
- ExtrinsicFailed: {
- dispatchError: 'SpRuntimeDispatchError',
- dispatchInfo: 'FrameSupportWeightsDispatchInfo',
- },
- CodeUpdated: 'Null',
- NewAccount: {
- account: 'AccountId32',
- },
- KilledAccount: {
- account: 'AccountId32',
- },
- Remarked: {
- _alias: {
- hash_: 'hash',
- },
- sender: 'AccountId32',
- hash_: 'H256'
- }
- }
- },
- /**
- * Lookup19: frame_support::weights::DispatchInfo
- **/
- FrameSupportWeightsDispatchInfo: {
- weight: 'u64',
- class: 'FrameSupportWeightsDispatchClass',
- paysFee: 'FrameSupportWeightsPays'
- },
- /**
- * Lookup20: frame_support::weights::DispatchClass
- **/
- FrameSupportWeightsDispatchClass: {
- _enum: ['Normal', 'Operational', 'Mandatory']
- },
- /**
- * Lookup21: frame_support::weights::Pays
- **/
- FrameSupportWeightsPays: {
- _enum: ['Yes', 'No']
- },
- /**
- * Lookup22: sp_runtime::DispatchError
- **/
- SpRuntimeDispatchError: {
- _enum: {
- Other: 'Null',
- CannotLookup: 'Null',
- BadOrigin: 'Null',
- Module: 'SpRuntimeModuleError',
- ConsumerRemaining: 'Null',
- NoProviders: 'Null',
- TooManyConsumers: 'Null',
- Token: 'SpRuntimeTokenError',
- Arithmetic: 'SpRuntimeArithmeticError',
- Transactional: 'SpRuntimeTransactionalError'
- }
- },
- /**
- * Lookup23: sp_runtime::ModuleError
- **/
- SpRuntimeModuleError: {
- index: 'u8',
- error: '[u8;4]'
- },
- /**
- * Lookup24: sp_runtime::TokenError
- **/
- SpRuntimeTokenError: {
- _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported']
- },
- /**
- * Lookup25: sp_runtime::ArithmeticError
- **/
- SpRuntimeArithmeticError: {
- _enum: ['Underflow', 'Overflow', 'DivisionByZero']
- },
- /**
- * Lookup26: sp_runtime::TransactionalError
- **/
- SpRuntimeTransactionalError: {
- _enum: ['LimitReached', 'NoLayer']
- },
- /**
- * Lookup27: cumulus_pallet_parachain_system::pallet::Event<T>
- **/
- CumulusPalletParachainSystemEvent: {
- _enum: {
- ValidationFunctionStored: 'Null',
- ValidationFunctionApplied: {
- relayChainBlockNum: 'u32',
- },
- ValidationFunctionDiscarded: 'Null',
- UpgradeAuthorized: {
- codeHash: 'H256',
- },
- DownwardMessagesReceived: {
- count: 'u32',
- },
- DownwardMessagesProcessed: {
- weightUsed: 'u64',
- dmqHead: 'H256'
- }
- }
- },
- /**
- * Lookup28: pallet_balances::pallet::Event<T, I>
- **/
- PalletBalancesEvent: {
- _enum: {
- Endowed: {
- account: 'AccountId32',
- freeBalance: 'u128',
- },
- DustLost: {
- account: 'AccountId32',
- amount: 'u128',
- },
- Transfer: {
- from: 'AccountId32',
- to: 'AccountId32',
- amount: 'u128',
- },
- BalanceSet: {
- who: 'AccountId32',
- free: 'u128',
- reserved: 'u128',
- },
- Reserved: {
- who: 'AccountId32',
- amount: 'u128',
- },
- Unreserved: {
- who: 'AccountId32',
- amount: 'u128',
- },
- ReserveRepatriated: {
- from: 'AccountId32',
- to: 'AccountId32',
- amount: 'u128',
- destinationStatus: 'FrameSupportTokensMiscBalanceStatus',
- },
- Deposit: {
- who: 'AccountId32',
- amount: 'u128',
- },
- Withdraw: {
- who: 'AccountId32',
- amount: 'u128',
- },
- Slashed: {
- who: 'AccountId32',
- amount: 'u128'
- }
- }
- },
- /**
- * Lookup29: frame_support::traits::tokens::misc::BalanceStatus
- **/
- FrameSupportTokensMiscBalanceStatus: {
- _enum: ['Free', 'Reserved']
- },
- /**
- * Lookup30: pallet_transaction_payment::pallet::Event<T>
- **/
- PalletTransactionPaymentEvent: {
- _enum: {
- TransactionFeePaid: {
- who: 'AccountId32',
- actualFee: 'u128',
- tip: 'u128'
- }
- }
- },
- /**
- * Lookup31: pallet_treasury::pallet::Event<T, I>
- **/
- PalletTreasuryEvent: {
- _enum: {
- Proposed: {
- proposalIndex: 'u32',
- },
- Spending: {
- budgetRemaining: 'u128',
- },
- Awarded: {
- proposalIndex: 'u32',
- award: 'u128',
- account: 'AccountId32',
- },
- Rejected: {
- proposalIndex: 'u32',
- slashed: 'u128',
- },
- Burnt: {
- burntFunds: 'u128',
- },
- Rollover: {
- rolloverBalance: 'u128',
- },
- Deposit: {
- value: 'u128',
- },
- SpendApproved: {
- proposalIndex: 'u32',
- amount: 'u128',
- beneficiary: 'AccountId32'
- }
- }
- },
- /**
- * Lookup32: pallet_sudo::pallet::Event<T>
- **/
- PalletSudoEvent: {
- _enum: {
- Sudid: {
- sudoResult: 'Result<Null, SpRuntimeDispatchError>',
- },
- KeyChanged: {
- oldSudoer: 'Option<AccountId32>',
- },
- SudoAsDone: {
- sudoResult: 'Result<Null, SpRuntimeDispatchError>'
- }
- }
- },
- /**
- * Lookup36: orml_vesting::module::Event<T>
- **/
- OrmlVestingModuleEvent: {
- _enum: {
- VestingScheduleAdded: {
- from: 'AccountId32',
- to: 'AccountId32',
- vestingSchedule: 'OrmlVestingVestingSchedule',
- },
- Claimed: {
- who: 'AccountId32',
- amount: 'u128',
- },
- VestingSchedulesUpdated: {
- who: 'AccountId32'
- }
- }
- },
- /**
- * Lookup37: orml_vesting::VestingSchedule<BlockNumber, Balance>
- **/
- OrmlVestingVestingSchedule: {
- start: 'u32',
- period: 'u32',
- periodCount: 'u32',
- perPeriod: 'Compact<u128>'
- },
- /**
- * Lookup39: cumulus_pallet_xcmp_queue::pallet::Event<T>
- **/
- CumulusPalletXcmpQueueEvent: {
- _enum: {
- Success: {
- messageHash: 'Option<H256>',
- weight: 'u64',
- },
- Fail: {
- messageHash: 'Option<H256>',
- error: 'XcmV2TraitsError',
- weight: 'u64',
- },
- BadVersion: {
- messageHash: 'Option<H256>',
- },
- BadFormat: {
- messageHash: 'Option<H256>',
- },
- UpwardMessageSent: {
- messageHash: 'Option<H256>',
- },
- XcmpMessageSent: {
- messageHash: 'Option<H256>',
- },
- OverweightEnqueued: {
- sender: 'u32',
- sentAt: 'u32',
- index: 'u64',
- required: 'u64',
- },
- OverweightServiced: {
- index: 'u64',
- used: 'u64'
- }
- }
- },
- /**
- * Lookup41: xcm::v2::traits::Error
- **/
- XcmV2TraitsError: {
- _enum: {
- Overflow: 'Null',
- Unimplemented: 'Null',
- UntrustedReserveLocation: 'Null',
- UntrustedTeleportLocation: 'Null',
- MultiLocationFull: 'Null',
- MultiLocationNotInvertible: 'Null',
- BadOrigin: 'Null',
- InvalidLocation: 'Null',
- AssetNotFound: 'Null',
- FailedToTransactAsset: 'Null',
- NotWithdrawable: 'Null',
- LocationCannotHold: 'Null',
- ExceedsMaxMessageSize: 'Null',
- DestinationUnsupported: 'Null',
- Transport: 'Null',
- Unroutable: 'Null',
- UnknownClaim: 'Null',
- FailedToDecode: 'Null',
- MaxWeightInvalid: 'Null',
- NotHoldingFees: 'Null',
- TooExpensive: 'Null',
- Trap: 'u64',
- UnhandledXcmVersion: 'Null',
- WeightLimitReached: 'u64',
- Barrier: 'Null',
- WeightNotComputable: 'Null'
- }
- },
- /**
- * Lookup43: pallet_xcm::pallet::Event<T>
- **/
- PalletXcmEvent: {
- _enum: {
- Attempted: 'XcmV2TraitsOutcome',
- Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)',
- UnexpectedResponse: '(XcmV1MultiLocation,u64)',
- ResponseReady: '(u64,XcmV2Response)',
- Notified: '(u64,u8,u8)',
- NotifyOverweight: '(u64,u8,u8,u64,u64)',
- NotifyDispatchError: '(u64,u8,u8)',
- NotifyDecodeFailed: '(u64,u8,u8)',
- InvalidResponder: '(XcmV1MultiLocation,u64,Option<XcmV1MultiLocation>)',
- InvalidResponderVersion: '(XcmV1MultiLocation,u64)',
- ResponseTaken: 'u64',
- AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)',
- VersionChangeNotified: '(XcmV1MultiLocation,u32)',
- SupportedVersionChanged: '(XcmV1MultiLocation,u32)',
- NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)',
- NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)'
- }
- },
- /**
- * Lookup44: xcm::v2::traits::Outcome
- **/
- XcmV2TraitsOutcome: {
- _enum: {
- Complete: 'u64',
- Incomplete: '(u64,XcmV2TraitsError)',
- Error: 'XcmV2TraitsError'
- }
- },
- /**
- * Lookup45: xcm::v1::multilocation::MultiLocation
- **/
- XcmV1MultiLocation: {
- parents: 'u8',
- interior: 'XcmV1MultilocationJunctions'
- },
- /**
- * Lookup46: xcm::v1::multilocation::Junctions
- **/
- XcmV1MultilocationJunctions: {
- _enum: {
- Here: 'Null',
- X1: 'XcmV1Junction',
- X2: '(XcmV1Junction,XcmV1Junction)',
- X3: '(XcmV1Junction,XcmV1Junction,XcmV1Junction)',
- X4: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)',
- X5: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)',
- X6: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)',
- X7: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)',
- X8: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)'
- }
- },
- /**
- * Lookup47: xcm::v1::junction::Junction
- **/
- XcmV1Junction: {
- _enum: {
- Parachain: 'Compact<u32>',
- AccountId32: {
- network: 'XcmV0JunctionNetworkId',
- id: '[u8;32]',
- },
- AccountIndex64: {
- network: 'XcmV0JunctionNetworkId',
- index: 'Compact<u64>',
- },
- AccountKey20: {
- network: 'XcmV0JunctionNetworkId',
- key: '[u8;20]',
- },
- PalletInstance: 'u8',
- GeneralIndex: 'Compact<u128>',
- GeneralKey: 'Bytes',
- OnlyChild: 'Null',
- Plurality: {
- id: 'XcmV0JunctionBodyId',
- part: 'XcmV0JunctionBodyPart'
- }
- }
- },
- /**
- * Lookup49: xcm::v0::junction::NetworkId
- **/
- XcmV0JunctionNetworkId: {
- _enum: {
- Any: 'Null',
- Named: 'Bytes',
- Polkadot: 'Null',
- Kusama: 'Null'
- }
- },
- /**
- * Lookup53: xcm::v0::junction::BodyId
- **/
- XcmV0JunctionBodyId: {
- _enum: {
- Unit: 'Null',
- Named: 'Bytes',
- Index: 'Compact<u32>',
- Executive: 'Null',
- Technical: 'Null',
- Legislative: 'Null',
- Judicial: 'Null'
- }
- },
- /**
- * Lookup54: xcm::v0::junction::BodyPart
- **/
- XcmV0JunctionBodyPart: {
- _enum: {
- Voice: 'Null',
- Members: {
- count: 'Compact<u32>',
- },
- Fraction: {
- nom: 'Compact<u32>',
- denom: 'Compact<u32>',
- },
- AtLeastProportion: {
- nom: 'Compact<u32>',
- denom: 'Compact<u32>',
- },
- MoreThanProportion: {
- nom: 'Compact<u32>',
- denom: 'Compact<u32>'
- }
- }
- },
- /**
- * Lookup55: xcm::v2::Xcm<Call>
- **/
- XcmV2Xcm: 'Vec<XcmV2Instruction>',
- /**
- * Lookup57: xcm::v2::Instruction<Call>
- **/
- XcmV2Instruction: {
- _enum: {
- WithdrawAsset: 'XcmV1MultiassetMultiAssets',
- ReserveAssetDeposited: 'XcmV1MultiassetMultiAssets',
- ReceiveTeleportedAsset: 'XcmV1MultiassetMultiAssets',
- QueryResponse: {
- queryId: 'Compact<u64>',
- response: 'XcmV2Response',
- maxWeight: 'Compact<u64>',
- },
- TransferAsset: {
- assets: 'XcmV1MultiassetMultiAssets',
- beneficiary: 'XcmV1MultiLocation',
- },
- TransferReserveAsset: {
- assets: 'XcmV1MultiassetMultiAssets',
- dest: 'XcmV1MultiLocation',
- xcm: 'XcmV2Xcm',
- },
- Transact: {
- originType: 'XcmV0OriginKind',
- requireWeightAtMost: 'Compact<u64>',
- call: 'XcmDoubleEncoded',
- },
- HrmpNewChannelOpenRequest: {
- sender: 'Compact<u32>',
- maxMessageSize: 'Compact<u32>',
- maxCapacity: 'Compact<u32>',
- },
- HrmpChannelAccepted: {
- recipient: 'Compact<u32>',
- },
- HrmpChannelClosing: {
- initiator: 'Compact<u32>',
- sender: 'Compact<u32>',
- recipient: 'Compact<u32>',
- },
- ClearOrigin: 'Null',
- DescendOrigin: 'XcmV1MultilocationJunctions',
- ReportError: {
- queryId: 'Compact<u64>',
- dest: 'XcmV1MultiLocation',
- maxResponseWeight: 'Compact<u64>',
- },
- DepositAsset: {
- assets: 'XcmV1MultiassetMultiAssetFilter',
- maxAssets: 'Compact<u32>',
- beneficiary: 'XcmV1MultiLocation',
- },
- DepositReserveAsset: {
- assets: 'XcmV1MultiassetMultiAssetFilter',
- maxAssets: 'Compact<u32>',
- dest: 'XcmV1MultiLocation',
- xcm: 'XcmV2Xcm',
- },
- ExchangeAsset: {
- give: 'XcmV1MultiassetMultiAssetFilter',
- receive: 'XcmV1MultiassetMultiAssets',
- },
- InitiateReserveWithdraw: {
- assets: 'XcmV1MultiassetMultiAssetFilter',
- reserve: 'XcmV1MultiLocation',
- xcm: 'XcmV2Xcm',
- },
- InitiateTeleport: {
- assets: 'XcmV1MultiassetMultiAssetFilter',
- dest: 'XcmV1MultiLocation',
- xcm: 'XcmV2Xcm',
- },
- QueryHolding: {
- queryId: 'Compact<u64>',
- dest: 'XcmV1MultiLocation',
- assets: 'XcmV1MultiassetMultiAssetFilter',
- maxResponseWeight: 'Compact<u64>',
- },
- BuyExecution: {
- fees: 'XcmV1MultiAsset',
- weightLimit: 'XcmV2WeightLimit',
- },
- RefundSurplus: 'Null',
- SetErrorHandler: 'XcmV2Xcm',
- SetAppendix: 'XcmV2Xcm',
- ClearError: 'Null',
- ClaimAsset: {
- assets: 'XcmV1MultiassetMultiAssets',
- ticket: 'XcmV1MultiLocation',
- },
- Trap: 'Compact<u64>',
- SubscribeVersion: {
- queryId: 'Compact<u64>',
- maxResponseWeight: 'Compact<u64>',
- },
- UnsubscribeVersion: 'Null'
- }
- },
- /**
- * Lookup58: xcm::v1::multiasset::MultiAssets
- **/
- XcmV1MultiassetMultiAssets: 'Vec<XcmV1MultiAsset>',
- /**
- * Lookup60: xcm::v1::multiasset::MultiAsset
- **/
- XcmV1MultiAsset: {
- id: 'XcmV1MultiassetAssetId',
- fun: 'XcmV1MultiassetFungibility'
- },
- /**
- * Lookup61: xcm::v1::multiasset::AssetId
- **/
- XcmV1MultiassetAssetId: {
- _enum: {
- Concrete: 'XcmV1MultiLocation',
- Abstract: 'Bytes'
- }
- },
- /**
- * Lookup62: xcm::v1::multiasset::Fungibility
- **/
- XcmV1MultiassetFungibility: {
- _enum: {
- Fungible: 'Compact<u128>',
- NonFungible: 'XcmV1MultiassetAssetInstance'
- }
- },
- /**
- * Lookup63: xcm::v1::multiasset::AssetInstance
- **/
- XcmV1MultiassetAssetInstance: {
- _enum: {
- Undefined: 'Null',
- Index: 'Compact<u128>',
- Array4: '[u8;4]',
- Array8: '[u8;8]',
- Array16: '[u8;16]',
- Array32: '[u8;32]',
- Blob: 'Bytes'
- }
- },
- /**
- * Lookup66: xcm::v2::Response
- **/
- XcmV2Response: {
- _enum: {
- Null: 'Null',
- Assets: 'XcmV1MultiassetMultiAssets',
- ExecutionResult: 'Option<(u32,XcmV2TraitsError)>',
- Version: 'u32'
- }
- },
- /**
- * Lookup69: xcm::v0::OriginKind
- **/
- XcmV0OriginKind: {
- _enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm']
- },
- /**
- * Lookup70: xcm::double_encoded::DoubleEncoded<T>
- **/
- XcmDoubleEncoded: {
- encoded: 'Bytes'
- },
- /**
- * Lookup71: xcm::v1::multiasset::MultiAssetFilter
- **/
- XcmV1MultiassetMultiAssetFilter: {
- _enum: {
- Definite: 'XcmV1MultiassetMultiAssets',
- Wild: 'XcmV1MultiassetWildMultiAsset'
- }
- },
- /**
- * Lookup72: xcm::v1::multiasset::WildMultiAsset
- **/
- XcmV1MultiassetWildMultiAsset: {
- _enum: {
- All: 'Null',
- AllOf: {
- id: 'XcmV1MultiassetAssetId',
- fun: 'XcmV1MultiassetWildFungibility'
- }
- }
- },
- /**
- * Lookup73: xcm::v1::multiasset::WildFungibility
- **/
- XcmV1MultiassetWildFungibility: {
- _enum: ['Fungible', 'NonFungible']
- },
- /**
- * Lookup74: xcm::v2::WeightLimit
- **/
- XcmV2WeightLimit: {
- _enum: {
- Unlimited: 'Null',
- Limited: 'Compact<u64>'
- }
- },
- /**
- * Lookup76: xcm::VersionedMultiAssets
- **/
- XcmVersionedMultiAssets: {
- _enum: {
- V0: 'Vec<XcmV0MultiAsset>',
- V1: 'XcmV1MultiassetMultiAssets'
- }
- },
- /**
- * Lookup78: xcm::v0::multi_asset::MultiAsset
- **/
- XcmV0MultiAsset: {
- _enum: {
- None: 'Null',
- All: 'Null',
- AllFungible: 'Null',
- AllNonFungible: 'Null',
- AllAbstractFungible: {
- id: 'Bytes',
- },
- AllAbstractNonFungible: {
- class: 'Bytes',
- },
- AllConcreteFungible: {
- id: 'XcmV0MultiLocation',
- },
- AllConcreteNonFungible: {
- class: 'XcmV0MultiLocation',
- },
- AbstractFungible: {
- id: 'Bytes',
- amount: 'Compact<u128>',
- },
- AbstractNonFungible: {
- class: 'Bytes',
- instance: 'XcmV1MultiassetAssetInstance',
- },
- ConcreteFungible: {
- id: 'XcmV0MultiLocation',
- amount: 'Compact<u128>',
- },
- ConcreteNonFungible: {
- class: 'XcmV0MultiLocation',
- instance: 'XcmV1MultiassetAssetInstance'
- }
- }
- },
- /**
- * Lookup79: xcm::v0::multi_location::MultiLocation
- **/
- XcmV0MultiLocation: {
- _enum: {
- Null: 'Null',
- X1: 'XcmV0Junction',
- X2: '(XcmV0Junction,XcmV0Junction)',
- X3: '(XcmV0Junction,XcmV0Junction,XcmV0Junction)',
- X4: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)',
- X5: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)',
- X6: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)',
- X7: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)',
- X8: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)'
- }
- },
- /**
- * Lookup80: xcm::v0::junction::Junction
- **/
- XcmV0Junction: {
- _enum: {
- Parent: 'Null',
- Parachain: 'Compact<u32>',
- AccountId32: {
- network: 'XcmV0JunctionNetworkId',
- id: '[u8;32]',
- },
- AccountIndex64: {
- network: 'XcmV0JunctionNetworkId',
- index: 'Compact<u64>',
- },
- AccountKey20: {
- network: 'XcmV0JunctionNetworkId',
- key: '[u8;20]',
- },
- PalletInstance: 'u8',
- GeneralIndex: 'Compact<u128>',
- GeneralKey: 'Bytes',
- OnlyChild: 'Null',
- Plurality: {
- id: 'XcmV0JunctionBodyId',
- part: 'XcmV0JunctionBodyPart'
- }
- }
- },
- /**
- * Lookup81: xcm::VersionedMultiLocation
- **/
- XcmVersionedMultiLocation: {
- _enum: {
- V0: 'XcmV0MultiLocation',
- V1: 'XcmV1MultiLocation'
- }
- },
- /**
- * Lookup82: cumulus_pallet_xcm::pallet::Event<T>
- **/
- CumulusPalletXcmEvent: {
- _enum: {
- InvalidFormat: '[u8;8]',
- UnsupportedVersion: '[u8;8]',
- ExecutedDownward: '([u8;8],XcmV2TraitsOutcome)'
- }
- },
- /**
- * Lookup83: cumulus_pallet_dmp_queue::pallet::Event<T>
- **/
- CumulusPalletDmpQueueEvent: {
- _enum: {
- InvalidFormat: {
- messageId: '[u8;32]',
- },
- UnsupportedVersion: {
- messageId: '[u8;32]',
- },
- ExecutedDownward: {
- messageId: '[u8;32]',
- outcome: 'XcmV2TraitsOutcome',
- },
- WeightExhausted: {
- messageId: '[u8;32]',
- remainingWeight: 'u64',
- requiredWeight: 'u64',
- },
- OverweightEnqueued: {
- messageId: '[u8;32]',
- overweightIndex: 'u64',
- requiredWeight: 'u64',
- },
- OverweightServiced: {
- overweightIndex: 'u64',
- weightUsed: 'u64'
- }
- }
- },
- /**
- * Lookup84: pallet_unique::RawEvent<sp_core::crypto::AccountId32, pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
- **/
- PalletUniqueRawEvent: {
- _enum: {
- CollectionSponsorRemoved: 'u32',
- CollectionAdminAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)',
- CollectionOwnedChanged: '(u32,AccountId32)',
- CollectionSponsorSet: '(u32,AccountId32)',
- SponsorshipConfirmed: '(u32,AccountId32)',
- CollectionAdminRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)',
- AllowListAddressRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)',
- AllowListAddressAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)',
- CollectionLimitSet: 'u32',
- CollectionPermissionSet: 'u32'
- }
- },
- /**
- * Lookup85: pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>
- **/
- PalletEvmAccountBasicCrossAccountIdRepr: {
- _enum: {
- Substrate: 'AccountId32',
- Ethereum: 'H160'
- }
- },
- /**
- * Lookup88: pallet_unique_scheduler::pallet::Event<T>
- **/
- PalletUniqueSchedulerEvent: {
- _enum: {
- Scheduled: {
- when: 'u32',
- index: 'u32',
- },
- Canceled: {
- when: 'u32',
- index: 'u32',
- },
- Dispatched: {
- task: '(u32,u32)',
- id: 'Option<[u8;16]>',
- result: 'Result<Null, SpRuntimeDispatchError>',
- },
- CallLookupFailed: {
- task: '(u32,u32)',
- id: 'Option<[u8;16]>',
- error: 'FrameSupportScheduleLookupError'
- }
- }
- },
- /**
- * Lookup91: frame_support::traits::schedule::LookupError
- **/
- FrameSupportScheduleLookupError: {
- _enum: ['Unknown', 'BadFormat']
- },
- /**
- * Lookup92: pallet_common::pallet::Event<T>
- **/
- PalletCommonEvent: {
- _enum: {
- CollectionCreated: '(u32,u8,AccountId32)',
- CollectionDestroyed: 'u32',
- ItemCreated: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)',
- ItemDestroyed: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)',
- Transfer: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)',
- Approved: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)',
- CollectionPropertySet: '(u32,Bytes)',
- CollectionPropertyDeleted: '(u32,Bytes)',
- TokenPropertySet: '(u32,u32,Bytes)',
- TokenPropertyDeleted: '(u32,u32,Bytes)',
- PropertyPermissionSet: '(u32,Bytes)'
- }
- },
- /**
- * Lookup95: pallet_structure::pallet::Event<T>
- **/
- PalletStructureEvent: {
- _enum: {
- Executed: 'Result<Null, SpRuntimeDispatchError>'
- }
- },
- /**
- * Lookup96: pallet_rmrk_core::pallet::Event<T>
- **/
- PalletRmrkCoreEvent: {
- _enum: {
- CollectionCreated: {
- issuer: 'AccountId32',
- collectionId: 'u32',
- },
- CollectionDestroyed: {
- issuer: 'AccountId32',
- collectionId: 'u32',
- },
- IssuerChanged: {
- oldIssuer: 'AccountId32',
- newIssuer: 'AccountId32',
- collectionId: 'u32',
- },
- CollectionLocked: {
- issuer: 'AccountId32',
- collectionId: 'u32',
- },
- NftMinted: {
- owner: 'AccountId32',
- collectionId: 'u32',
- nftId: 'u32',
- },
- NFTBurned: {
- owner: 'AccountId32',
- nftId: 'u32',
- },
- NFTSent: {
- sender: 'AccountId32',
- recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple',
- collectionId: 'u32',
- nftId: 'u32',
- approvalRequired: 'bool',
- },
- NFTAccepted: {
- sender: 'AccountId32',
- recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple',
- collectionId: 'u32',
- nftId: 'u32',
- },
- NFTRejected: {
- sender: 'AccountId32',
- collectionId: 'u32',
- nftId: 'u32',
- },
- PropertySet: {
- collectionId: 'u32',
- maybeNftId: 'Option<u32>',
- key: 'Bytes',
- value: 'Bytes',
- },
- ResourceAdded: {
- nftId: 'u32',
- resourceId: 'u32',
- },
- ResourceRemoval: {
- nftId: 'u32',
- resourceId: 'u32',
- },
- ResourceAccepted: {
- nftId: 'u32',
- resourceId: 'u32',
- },
- ResourceRemovalAccepted: {
- nftId: 'u32',
- resourceId: 'u32',
- },
- PrioritySet: {
- collectionId: 'u32',
- nftId: 'u32'
- }
- }
- },
- /**
- * Lookup97: rmrk_traits::nft::AccountIdOrCollectionNftTuple<sp_core::crypto::AccountId32>
- **/
- RmrkTraitsNftAccountIdOrCollectionNftTuple: {
- _enum: {
- AccountId: 'AccountId32',
- CollectionAndNftTuple: '(u32,u32)'
- }
- },
- /**
- * Lookup102: pallet_rmrk_equip::pallet::Event<T>
- **/
- PalletRmrkEquipEvent: {
- _enum: {
- BaseCreated: {
- issuer: 'AccountId32',
- baseId: 'u32',
- },
- EquippablesUpdated: {
- baseId: 'u32',
- slotId: 'u32'
- }
- }
- },
- /**
- * Lookup103: pallet_evm::pallet::Event<T>
- **/
- PalletEvmEvent: {
- _enum: {
- Log: 'EthereumLog',
- Created: 'H160',
- CreatedFailed: 'H160',
- Executed: 'H160',
- ExecutedFailed: 'H160',
- BalanceDeposit: '(AccountId32,H160,U256)',
- BalanceWithdraw: '(AccountId32,H160,U256)'
- }
- },
- /**
- * Lookup104: ethereum::log::Log
- **/
- EthereumLog: {
- address: 'H160',
- topics: 'Vec<H256>',
- data: 'Bytes'
- },
- /**
- * Lookup108: pallet_ethereum::pallet::Event
- **/
- PalletEthereumEvent: {
- _enum: {
- Executed: '(H160,H160,H256,EvmCoreErrorExitReason)'
- }
- },
- /**
- * Lookup109: evm_core::error::ExitReason
- **/
- EvmCoreErrorExitReason: {
- _enum: {
- Succeed: 'EvmCoreErrorExitSucceed',
- Error: 'EvmCoreErrorExitError',
- Revert: 'EvmCoreErrorExitRevert',
- Fatal: 'EvmCoreErrorExitFatal'
- }
- },
- /**
- * Lookup110: evm_core::error::ExitSucceed
- **/
- EvmCoreErrorExitSucceed: {
- _enum: ['Stopped', 'Returned', 'Suicided']
- },
- /**
- * Lookup111: evm_core::error::ExitError
- **/
- EvmCoreErrorExitError: {
- _enum: {
- StackUnderflow: 'Null',
- StackOverflow: 'Null',
- InvalidJump: 'Null',
- InvalidRange: 'Null',
- DesignatedInvalid: 'Null',
- CallTooDeep: 'Null',
- CreateCollision: 'Null',
- CreateContractLimit: 'Null',
- OutOfOffset: 'Null',
- OutOfGas: 'Null',
- OutOfFund: 'Null',
- PCUnderflow: 'Null',
- CreateEmpty: 'Null',
- Other: 'Text',
- InvalidCode: 'Null'
- }
- },
- /**
- * Lookup114: evm_core::error::ExitRevert
- **/
- EvmCoreErrorExitRevert: {
- _enum: ['Reverted']
- },
- /**
- * Lookup115: evm_core::error::ExitFatal
- **/
- EvmCoreErrorExitFatal: {
- _enum: {
- NotSupported: 'Null',
- UnhandledInterrupt: 'Null',
- CallErrorAsFatal: 'EvmCoreErrorExitError',
- Other: 'Text'
- }
- },
- /**
- * Lookup116: frame_system::Phase
- **/
- FrameSystemPhase: {
- _enum: {
- ApplyExtrinsic: 'u32',
- Finalization: 'Null',
- Initialization: 'Null'
- }
- },
- /**
- * Lookup118: frame_system::LastRuntimeUpgradeInfo
- **/
- FrameSystemLastRuntimeUpgradeInfo: {
- specVersion: 'Compact<u32>',
- specName: 'Text'
- },
- /**
- * Lookup119: frame_system::pallet::Call<T>
- **/
- FrameSystemCall: {
- _enum: {
- fill_block: {
- ratio: 'Perbill',
- },
- remark: {
- remark: 'Bytes',
- },
- set_heap_pages: {
- pages: 'u64',
- },
- set_code: {
- code: 'Bytes',
- },
- set_code_without_checks: {
- code: 'Bytes',
- },
- set_storage: {
- items: 'Vec<(Bytes,Bytes)>',
- },
- kill_storage: {
- _alias: {
- keys_: 'keys',
- },
- keys_: 'Vec<Bytes>',
- },
- kill_prefix: {
- prefix: 'Bytes',
- subkeys: 'u32',
- },
- remark_with_event: {
- remark: 'Bytes'
- }
- }
- },
- /**
- * Lookup124: frame_system::limits::BlockWeights
- **/
- FrameSystemLimitsBlockWeights: {
- baseBlock: 'u64',
- maxBlock: 'u64',
- perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass'
- },
- /**
- * Lookup125: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
- **/
- FrameSupportWeightsPerDispatchClassWeightsPerClass: {
- normal: 'FrameSystemLimitsWeightsPerClass',
- operational: 'FrameSystemLimitsWeightsPerClass',
- mandatory: 'FrameSystemLimitsWeightsPerClass'
- },
- /**
- * Lookup126: frame_system::limits::WeightsPerClass
- **/
- FrameSystemLimitsWeightsPerClass: {
- baseExtrinsic: 'u64',
- maxExtrinsic: 'Option<u64>',
- maxTotal: 'Option<u64>',
- reserved: 'Option<u64>'
- },
- /**
- * Lookup128: frame_system::limits::BlockLength
+ * Lookup2: polkadot_primitives::v2::PersistedValidationData<primitive_types::H256, N>
**/
- FrameSystemLimitsBlockLength: {
- max: 'FrameSupportWeightsPerDispatchClassU32'
- },
- /**
- * Lookup129: frame_support::weights::PerDispatchClass<T>
- **/
- FrameSupportWeightsPerDispatchClassU32: {
- normal: 'u32',
- operational: 'u32',
- mandatory: 'u32'
- },
- /**
- * Lookup130: frame_support::weights::RuntimeDbWeight
- **/
- FrameSupportWeightsRuntimeDbWeight: {
- read: 'u64',
- write: 'u64'
- },
- /**
- * Lookup131: sp_version::RuntimeVersion
- **/
- SpVersionRuntimeVersion: {
- specName: 'Text',
- implName: 'Text',
- authoringVersion: 'u32',
- specVersion: 'u32',
- implVersion: 'u32',
- apis: 'Vec<([u8;8],u32)>',
- transactionVersion: 'u32',
- stateVersion: 'u8'
- },
- /**
- * Lookup136: frame_system::pallet::Error<T>
- **/
- FrameSystemError: {
- _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered']
- },
- /**
- * Lookup137: polkadot_primitives::v2::PersistedValidationData<primitive_types::H256, N>
- **/
PolkadotPrimitivesV2PersistedValidationData: {
parentHead: 'Bytes',
relayParentNumber: 'u32',
@@ -1272,19 +14,19 @@
maxPovSize: 'u32'
},
/**
- * Lookup140: polkadot_primitives::v2::UpgradeRestriction
+ * Lookup9: polkadot_primitives::v2::UpgradeRestriction
**/
PolkadotPrimitivesV2UpgradeRestriction: {
_enum: ['Present']
},
/**
- * Lookup141: sp_trie::storage_proof::StorageProof
+ * Lookup10: sp_trie::storage_proof::StorageProof
**/
SpTrieStorageProof: {
trieNodes: 'BTreeSet<Bytes>'
},
/**
- * Lookup143: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot
+ * Lookup13: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot
**/
CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: {
dmqMqcHead: 'H256',
@@ -1293,7 +35,7 @@
egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>'
},
/**
- * Lookup146: polkadot_primitives::v2::AbridgedHrmpChannel
+ * Lookup18: polkadot_primitives::v2::AbridgedHrmpChannel
**/
PolkadotPrimitivesV2AbridgedHrmpChannel: {
maxCapacity: 'u32',
@@ -1304,7 +46,7 @@
mqcHead: 'Option<H256>'
},
/**
- * Lookup147: polkadot_primitives::v2::AbridgedHostConfiguration
+ * Lookup20: polkadot_primitives::v2::AbridgedHostConfiguration
**/
PolkadotPrimitivesV2AbridgedHostConfiguration: {
maxCodeSize: 'u32',
@@ -1318,14 +60,14 @@
validationUpgradeDelay: 'u32'
},
/**
- * Lookup153: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
+ * Lookup26: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
**/
PolkadotCorePrimitivesOutboundHrmpMessage: {
recipient: 'u32',
data: 'Bytes'
},
/**
- * Lookup154: cumulus_pallet_parachain_system::pallet::Call<T>
+ * Lookup28: cumulus_pallet_parachain_system::pallet::Call<T>
**/
CumulusPalletParachainSystemCall: {
_enum: {
@@ -1344,7 +86,7 @@
}
},
/**
- * Lookup155: cumulus_primitives_parachain_inherent::ParachainInherentData
+ * Lookup29: cumulus_primitives_parachain_inherent::ParachainInherentData
**/
CumulusPrimitivesParachainInherentParachainInherentData: {
validationData: 'PolkadotPrimitivesV2PersistedValidationData',
@@ -1353,27 +95,58 @@
horizontalMessages: 'BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>'
},
/**
- * Lookup157: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
+ * Lookup31: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundDownwardMessage: {
sentAt: 'u32',
msg: 'Bytes'
},
/**
- * Lookup160: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
+ * Lookup34: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundHrmpMessage: {
sentAt: 'u32',
data: 'Bytes'
},
/**
- * Lookup163: cumulus_pallet_parachain_system::pallet::Error<T>
+ * Lookup37: cumulus_pallet_parachain_system::pallet::Event<T>
+ **/
+ CumulusPalletParachainSystemEvent: {
+ _enum: {
+ ValidationFunctionStored: 'Null',
+ ValidationFunctionApplied: {
+ relayChainBlockNum: 'u32',
+ },
+ ValidationFunctionDiscarded: 'Null',
+ UpgradeAuthorized: {
+ codeHash: 'H256',
+ },
+ DownwardMessagesReceived: {
+ count: 'u32',
+ },
+ DownwardMessagesProcessed: {
+ weightUsed: 'u64',
+ dmqHead: 'H256'
+ }
+ }
+ },
+ /**
+ * Lookup38: cumulus_pallet_parachain_system::pallet::Error<T>
**/
CumulusPalletParachainSystemError: {
_enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized']
},
/**
- * Lookup165: pallet_balances::BalanceLock<Balance>
+ * Lookup41: pallet_balances::AccountData<Balance>
+ **/
+ PalletBalancesAccountData: {
+ free: 'u128',
+ reserved: 'u128',
+ miscFrozen: 'u128',
+ feeFrozen: 'u128'
+ },
+ /**
+ * Lookup43: pallet_balances::BalanceLock<Balance>
**/
PalletBalancesBalanceLock: {
id: '[u8;8]',
@@ -1381,13 +154,13 @@
reasons: 'PalletBalancesReasons'
},
/**
- * Lookup166: pallet_balances::Reasons
+ * Lookup45: pallet_balances::Reasons
**/
PalletBalancesReasons: {
_enum: ['Fee', 'Misc', 'All']
},
/**
- * Lookup169: pallet_balances::ReserveData<ReserveIdentifier, Balance>
+ * Lookup48: pallet_balances::ReserveData<ReserveIdentifier, Balance>
**/
PalletBalancesReserveData: {
id: '[u8;16]',
@@ -2706,13 +1479,13 @@
_enum: ['Unknown', 'OverLimit']
},
/**
- * Lookup347: pallet_unique::Error<T>
+ * Lookup346: pallet_unique::Error<T>
**/
PalletUniqueError: {
_enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection']
},
/**
- * Lookup350: pallet_unique_scheduler::ScheduledV3<frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32>
+ * Lookup349: pallet_unique_scheduler::ScheduledV3<frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32>
**/
PalletUniqueSchedulerScheduledV3: {
maybeId: 'Option<[u8;16]>',
@@ -2722,7 +1495,7 @@
origin: 'OpalRuntimeOriginCaller'
},
/**
- * Lookup351: opal_runtime::OriginCaller
+ * Lookup350: opal_runtime::OriginCaller
**/
OpalRuntimeOriginCaller: {
_enum: {
@@ -2831,7 +1604,7 @@
}
},
/**
- * Lookup352: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
+ * Lookup351: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
**/
FrameSupportDispatchRawOrigin: {
_enum: {
@@ -2841,7 +1614,7 @@
}
},
/**
- * Lookup353: pallet_xcm::pallet::Origin
+ * Lookup352: pallet_xcm::pallet::Origin
**/
PalletXcmOrigin: {
_enum: {
@@ -2850,7 +1623,7 @@
}
},
/**
- * Lookup354: cumulus_pallet_xcm::pallet::Origin
+ * Lookup353: cumulus_pallet_xcm::pallet::Origin
**/
CumulusPalletXcmOrigin: {
_enum: {
@@ -2859,7 +1632,7 @@
}
},
/**
- * Lookup355: pallet_ethereum::RawOrigin
+ * Lookup354: pallet_ethereum::RawOrigin
**/
PalletEthereumRawOrigin: {
_enum: {
@@ -2867,17 +1640,17 @@
}
},
/**
- * Lookup356: sp_core::Void
+ * Lookup355: sp_core::Void
**/
SpCoreVoid: 'Null',
/**
- * Lookup357: pallet_unique_scheduler::pallet::Error<T>
+ * Lookup356: pallet_unique_scheduler::pallet::Error<T>
**/
PalletUniqueSchedulerError: {
_enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange']
},
/**
- * Lookup358: up_data_structs::Collection<sp_core::crypto::AccountId32>
+ * Lookup357: up_data_structs::Collection<sp_core::crypto::AccountId32>
**/
UpDataStructsCollection: {
owner: 'AccountId32',
@@ -2891,7 +1664,7 @@
externalCollection: 'bool'
},
/**
- * Lookup359: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
+ * Lookup358: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
**/
UpDataStructsSponsorshipState: {
_enum: {
@@ -2901,7 +1674,7 @@
}
},
/**
- * Lookup360: up_data_structs::Properties
+ * Lookup359: up_data_structs::Properties
**/
UpDataStructsProperties: {
map: 'UpDataStructsPropertiesMapBoundedVec',
@@ -2909,7 +1682,7 @@
spaceLimit: 'u32'
},
/**
- * Lookup361: up_data_structs::PropertiesMap<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup360: up_data_structs::PropertiesMap<frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsPropertiesMapBoundedVec: 'BTreeMap<Bytes, Bytes>',
/**
@@ -2917,7 +1690,7 @@
**/
UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap<Bytes, UpDataStructsPropertyPermission>',
/**
- * Lookup373: up_data_structs::CollectionStats
+ * Lookup372: up_data_structs::CollectionStats
**/
UpDataStructsCollectionStats: {
created: 'u32',
@@ -2925,18 +1698,18 @@
alive: 'u32'
},
/**
- * Lookup374: up_data_structs::TokenChild
+ * Lookup373: up_data_structs::TokenChild
**/
UpDataStructsTokenChild: {
token: 'u32',
collection: 'u32'
},
/**
- * Lookup375: PhantomType::up_data_structs<T>
+ * Lookup374: PhantomType::up_data_structs<T>
**/
PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]',
/**
- * Lookup377: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup376: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsTokenData: {
properties: 'Vec<UpDataStructsProperty>',
@@ -2944,7 +1717,7 @@
pieces: 'u128'
},
/**
- * Lookup379: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
+ * Lookup378: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
**/
UpDataStructsRpcCollection: {
owner: 'AccountId32',
@@ -2960,7 +1733,7 @@
readOnly: 'bool'
},
/**
- * Lookup380: rmrk_traits::collection::CollectionInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
+ * Lookup379: rmrk_traits::collection::CollectionInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
**/
RmrkTraitsCollectionCollectionInfo: {
issuer: 'AccountId32',
@@ -2970,7 +1743,7 @@
nftsCount: 'u32'
},
/**
- * Lookup381: rmrk_traits::nft::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup380: rmrk_traits::nft::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsNftNftInfo: {
owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple',
@@ -2980,14 +1753,14 @@
pending: 'bool'
},
/**
- * Lookup383: rmrk_traits::nft::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
+ * Lookup382: rmrk_traits::nft::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
**/
RmrkTraitsNftRoyaltyInfo: {
recipient: 'AccountId32',
amount: 'Permill'
},
/**
- * Lookup384: rmrk_traits::resource::ResourceInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup383: rmrk_traits::resource::ResourceInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceResourceInfo: {
id: 'u32',
@@ -2996,14 +1769,14 @@
pendingRemoval: 'bool'
},
/**
- * Lookup385: rmrk_traits::property::PropertyInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup384: rmrk_traits::property::PropertyInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPropertyPropertyInfo: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup386: rmrk_traits::base::BaseInfo<sp_core::crypto::AccountId32, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup385: rmrk_traits::base::BaseInfo<sp_core::crypto::AccountId32, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsBaseBaseInfo: {
issuer: 'AccountId32',
@@ -3011,80 +1784,80 @@
symbol: 'Bytes'
},
/**
- * Lookup387: rmrk_traits::nft::NftChild
+ * Lookup386: rmrk_traits::nft::NftChild
**/
RmrkTraitsNftNftChild: {
collectionId: 'u32',
nftId: 'u32'
},
/**
- * Lookup389: pallet_common::pallet::Error<T>
+ * Lookup388: pallet_common::pallet::Error<T>
**/
PalletCommonError: {
_enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal']
},
/**
- * Lookup391: pallet_fungible::pallet::Error<T>
+ * Lookup390: pallet_fungible::pallet::Error<T>
**/
PalletFungibleError: {
_enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup392: pallet_refungible::ItemData
+ * Lookup391: pallet_refungible::ItemData
**/
PalletRefungibleItemData: {
constData: 'Bytes'
},
/**
- * Lookup397: pallet_refungible::pallet::Error<T>
+ * Lookup394: pallet_refungible::pallet::Error<T>
**/
PalletRefungibleError: {
_enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup398: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup395: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
PalletNonfungibleItemData: {
owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
},
/**
- * Lookup400: up_data_structs::PropertyScope
+ * Lookup397: up_data_structs::PropertyScope
**/
UpDataStructsPropertyScope: {
_enum: ['None', 'Rmrk', 'Eth']
},
/**
- * Lookup402: pallet_nonfungible::pallet::Error<T>
+ * Lookup399: pallet_nonfungible::pallet::Error<T>
**/
PalletNonfungibleError: {
_enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren']
},
/**
- * Lookup403: pallet_structure::pallet::Error<T>
+ * Lookup400: pallet_structure::pallet::Error<T>
**/
PalletStructureError: {
_enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound']
},
/**
- * Lookup404: pallet_rmrk_core::pallet::Error<T>
+ * Lookup401: pallet_rmrk_core::pallet::Error<T>
**/
PalletRmrkCoreError: {
_enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId']
},
/**
- * Lookup406: pallet_rmrk_equip::pallet::Error<T>
+ * Lookup403: pallet_rmrk_equip::pallet::Error<T>
**/
PalletRmrkEquipError: {
_enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart']
},
/**
- * Lookup409: pallet_evm::pallet::Error<T>
+ * Lookup406: pallet_evm::pallet::Error<T>
**/
PalletEvmError: {
_enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce']
},
/**
- * Lookup412: fp_rpc::TransactionStatus
+ * Lookup409: fp_rpc::TransactionStatus
**/
FpRpcTransactionStatus: {
transactionHash: 'H256',
@@ -3096,11 +1869,11 @@
logsBloom: 'EthbloomBloom'
},
/**
- * Lookup414: ethbloom::Bloom
+ * Lookup411: ethbloom::Bloom
**/
EthbloomBloom: '[u8;256]',
/**
- * Lookup416: ethereum::receipt::ReceiptV3
+ * Lookup413: ethereum::receipt::ReceiptV3
**/
EthereumReceiptReceiptV3: {
_enum: {
@@ -3110,7 +1883,7 @@
}
},
/**
- * Lookup417: ethereum::receipt::EIP658ReceiptData
+ * Lookup414: ethereum::receipt::EIP658ReceiptData
**/
EthereumReceiptEip658ReceiptData: {
statusCode: 'u8',
@@ -3119,7 +1892,7 @@
logs: 'Vec<EthereumLog>'
},
/**
- * Lookup418: ethereum::block::Block<ethereum::transaction::TransactionV2>
+ * Lookup415: ethereum::block::Block<ethereum::transaction::TransactionV2>
**/
EthereumBlock: {
header: 'EthereumHeader',
@@ -3127,7 +1900,7 @@
ommers: 'Vec<EthereumHeader>'
},
/**
- * Lookup419: ethereum::header::Header
+ * Lookup416: ethereum::header::Header
**/
EthereumHeader: {
parentHash: 'H256',
@@ -3147,41 +1920,41 @@
nonce: 'EthereumTypesHashH64'
},
/**
- * Lookup420: ethereum_types::hash::H64
+ * Lookup417: ethereum_types::hash::H64
**/
EthereumTypesHashH64: '[u8;8]',
/**
- * Lookup425: pallet_ethereum::pallet::Error<T>
+ * Lookup422: pallet_ethereum::pallet::Error<T>
**/
PalletEthereumError: {
_enum: ['InvalidSignature', 'PreLogExists']
},
/**
- * Lookup426: pallet_evm_coder_substrate::pallet::Error<T>
+ * Lookup423: pallet_evm_coder_substrate::pallet::Error<T>
**/
PalletEvmCoderSubstrateError: {
_enum: ['OutOfGas', 'OutOfFund']
},
/**
- * Lookup427: pallet_evm_contract_helpers::SponsoringModeT
+ * Lookup424: pallet_evm_contract_helpers::SponsoringModeT
**/
PalletEvmContractHelpersSponsoringModeT: {
_enum: ['Disabled', 'Allowlisted', 'Generous']
},
/**
- * Lookup429: pallet_evm_contract_helpers::pallet::Error<T>
+ * Lookup426: pallet_evm_contract_helpers::pallet::Error<T>
**/
PalletEvmContractHelpersError: {
_enum: ['NoPermission']
},
/**
- * Lookup430: pallet_evm_migration::pallet::Error<T>
+ * Lookup427: pallet_evm_migration::pallet::Error<T>
**/
PalletEvmMigrationError: {
_enum: ['AccountNotEmpty', 'AccountIsNotMigrating']
},
/**
- * Lookup432: sp_runtime::MultiSignature
+ * Lookup429: sp_runtime::MultiSignature
**/
SpRuntimeMultiSignature: {
_enum: {
@@ -3191,43 +1964,43 @@
}
},
/**
- * Lookup433: sp_core::ed25519::Signature
+ * Lookup430: sp_core::ed25519::Signature
**/
SpCoreEd25519Signature: '[u8;64]',
/**
- * Lookup435: sp_core::sr25519::Signature
+ * Lookup434: sp_core::sr25519::Signature
**/
SpCoreSr25519Signature: '[u8;64]',
/**
- * Lookup436: sp_core::ecdsa::Signature
+ * Lookup435: sp_core::ecdsa::Signature
**/
SpCoreEcdsaSignature: '[u8;65]',
/**
- * Lookup439: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
+ * Lookup438: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
**/
FrameSystemExtensionsCheckSpecVersion: 'Null',
/**
- * Lookup440: frame_system::extensions::check_genesis::CheckGenesis<T>
+ * Lookup439: frame_system::extensions::check_genesis::CheckGenesis<T>
**/
FrameSystemExtensionsCheckGenesis: 'Null',
/**
- * Lookup443: frame_system::extensions::check_nonce::CheckNonce<T>
+ * Lookup442: frame_system::extensions::check_nonce::CheckNonce<T>
**/
FrameSystemExtensionsCheckNonce: 'Compact<u32>',
/**
- * Lookup444: frame_system::extensions::check_weight::CheckWeight<T>
+ * Lookup443: frame_system::extensions::check_weight::CheckWeight<T>
**/
FrameSystemExtensionsCheckWeight: 'Null',
/**
- * Lookup445: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
+ * Lookup444: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
**/
PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
/**
- * Lookup446: opal_runtime::Runtime
+ * Lookup445: opal_runtime::Runtime
**/
OpalRuntimeRuntime: 'Null',
/**
- * Lookup447: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
+ * Lookup444: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
**/
PalletEthereumFakeTransactionFinalizer: 'Null'
};
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -1393,28 +1393,7 @@
readonly type: 'StartInflation';
}
- /** @name PalletAppPromotionCall (148) */
- export interface PalletAppPromotionCall extends Enum {
- readonly isSetAdminAddress: boolean;
- readonly asSetAdminAddress: {
- readonly admin: AccountId32;
- } & Struct;
- readonly isStartAppPromotion: boolean;
- readonly asStartAppPromotion: {
- readonly promotionStartRelayBlock: u32;
- } & Struct;
- readonly isStake: boolean;
- readonly asStake: {
- readonly amount: u128;
- } & Struct;
- readonly isUnstake: boolean;
- readonly asUnstake: {
- readonly amount: u128;
- } & Struct;
- readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake';
- }
-
- /** @name PalletUniqueCall (149) */
+ /** @name PalletUniqueCall (148) */
export interface PalletUniqueCall extends Enum {
readonly isCreateCollection: boolean;
readonly asCreateCollection: {
@@ -1629,164 +1608,28 @@
readonly nftId: u32;
readonly resourceId: u32;
} & Struct;
- readonly isResourceRemovalAccepted: boolean;
- readonly asResourceRemovalAccepted: {
- readonly nftId: u32;
- readonly resourceId: u32;
- } & Struct;
- readonly isPrioritySet: boolean;
- readonly asPrioritySet: {
+ readonly isCreateMultipleItemsEx: boolean;
+ readonly asCreateMultipleItemsEx: {
readonly collectionId: u32;
- readonly nftId: u32;
- } & Struct;
- readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet';
- }
-
-<<<<<<< HEAD
- /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (97) */
- interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {
- readonly isAccountId: boolean;
- readonly asAccountId: AccountId32;
- readonly isCollectionAndNftTuple: boolean;
- readonly asCollectionAndNftTuple: ITuple<[u32, u32]>;
- readonly type: 'AccountId' | 'CollectionAndNftTuple';
- }
-
- /** @name PalletRmrkEquipEvent (102) */
- interface PalletRmrkEquipEvent extends Enum {
- readonly isBaseCreated: boolean;
- readonly asBaseCreated: {
- readonly issuer: AccountId32;
- readonly baseId: u32;
+ readonly data: UpDataStructsCreateItemExData;
} & Struct;
- readonly isEquippablesUpdated: boolean;
- readonly asEquippablesUpdated: {
- readonly baseId: u32;
- readonly slotId: u32;
- } & Struct;
- readonly type: 'BaseCreated' | 'EquippablesUpdated';
- }
-
- /** @name PalletEvmEvent (103) */
- interface PalletEvmEvent extends Enum {
- readonly isLog: boolean;
- readonly asLog: EthereumLog;
- readonly isCreated: boolean;
- readonly asCreated: H160;
- readonly isCreatedFailed: boolean;
- readonly asCreatedFailed: H160;
- readonly isExecuted: boolean;
- readonly asExecuted: H160;
- readonly isExecutedFailed: boolean;
- readonly asExecutedFailed: H160;
- readonly isBalanceDeposit: boolean;
- readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>;
- readonly isBalanceWithdraw: boolean;
- readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>;
- readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw';
- }
-
- /** @name EthereumLog (104) */
- interface EthereumLog extends Struct {
- readonly address: H160;
- readonly topics: Vec<H256>;
- readonly data: Bytes;
- }
-
- /** @name PalletEthereumEvent (108) */
- interface PalletEthereumEvent extends Enum {
- readonly isExecuted: boolean;
- readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>;
- readonly type: 'Executed';
- }
-
- /** @name EvmCoreErrorExitReason (109) */
- interface EvmCoreErrorExitReason extends Enum {
- readonly isSucceed: boolean;
- readonly asSucceed: EvmCoreErrorExitSucceed;
- readonly isError: boolean;
- readonly asError: EvmCoreErrorExitError;
- readonly isRevert: boolean;
- readonly asRevert: EvmCoreErrorExitRevert;
- readonly isFatal: boolean;
- readonly asFatal: EvmCoreErrorExitFatal;
- readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';
- }
-
- /** @name EvmCoreErrorExitSucceed (110) */
- interface EvmCoreErrorExitSucceed extends Enum {
- readonly isStopped: boolean;
- readonly isReturned: boolean;
- readonly isSuicided: boolean;
- readonly type: 'Stopped' | 'Returned' | 'Suicided';
- }
-
- /** @name EvmCoreErrorExitError (111) */
- interface EvmCoreErrorExitError extends Enum {
- readonly isStackUnderflow: boolean;
- readonly isStackOverflow: boolean;
- readonly isInvalidJump: boolean;
- readonly isInvalidRange: boolean;
- readonly isDesignatedInvalid: boolean;
- readonly isCallTooDeep: boolean;
- readonly isCreateCollision: boolean;
- readonly isCreateContractLimit: boolean;
- readonly isOutOfOffset: boolean;
- readonly isOutOfGas: boolean;
- readonly isOutOfFund: boolean;
- readonly isPcUnderflow: boolean;
- readonly isCreateEmpty: boolean;
- readonly isOther: boolean;
- readonly asOther: Text;
- readonly isInvalidCode: boolean;
- readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode';
- }
-
- /** @name EvmCoreErrorExitRevert (114) */
- interface EvmCoreErrorExitRevert extends Enum {
- readonly isReverted: boolean;
- readonly type: 'Reverted';
- }
-
- /** @name EvmCoreErrorExitFatal (115) */
- interface EvmCoreErrorExitFatal extends Enum {
- readonly isNotSupported: boolean;
- readonly isUnhandledInterrupt: boolean;
- readonly isCallErrorAsFatal: boolean;
- readonly asCallErrorAsFatal: EvmCoreErrorExitError;
- readonly isOther: boolean;
- readonly asOther: Text;
- readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';
- }
-
- /** @name FrameSystemPhase (116) */
- interface FrameSystemPhase extends Enum {
- readonly isApplyExtrinsic: boolean;
- readonly asApplyExtrinsic: u32;
- readonly isFinalization: boolean;
- readonly isInitialization: boolean;
- readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';
- }
-
- /** @name FrameSystemLastRuntimeUpgradeInfo (118) */
- interface FrameSystemLastRuntimeUpgradeInfo extends Struct {
- readonly specVersion: Compact<u32>;
- readonly specName: Text;
- }
-
- /** @name FrameSystemCall (119) */
- interface FrameSystemCall extends Enum {
- readonly isFillBlock: boolean;
- readonly asFillBlock: {
- readonly ratio: Perbill;
+ readonly isSetTransfersEnabledFlag: boolean;
+ readonly asSetTransfersEnabledFlag: {
+ readonly collectionId: u32;
+ readonly value: bool;
} & Struct;
- readonly isRemark: boolean;
- readonly asRemark: {
- readonly remark: Bytes;
+ readonly isBurnItem: boolean;
+ readonly asBurnItem: {
+ readonly collectionId: u32;
+ readonly itemId: u32;
+ readonly value: u128;
} & Struct;
- readonly isSetHeapPages: boolean;
- readonly asSetHeapPages: {
- readonly pages: u64;
+ readonly isBurnFrom: boolean;
+ readonly asBurnFrom: {
+ readonly collectionId: u32;
+ readonly from: PalletEvmAccountBasicCrossAccountIdRepr;
+ readonly itemId: u32;
+ readonly value: u128;
} & Struct;
readonly isSetCode: boolean;
readonly asSetCode: {
@@ -1813,21 +1656,7 @@
readonly asRemarkWithEvent: {
readonly remark: Bytes;
} & Struct;
- readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent';
- }
-
- /** @name FrameSystemLimitsBlockWeights (124) */
- interface FrameSystemLimitsBlockWeights extends Struct {
- readonly baseBlock: u64;
- readonly maxBlock: u64;
- readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;
- }
-
- /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (125) */
- interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct {
- readonly normal: FrameSystemLimitsWeightsPerClass;
- readonly operational: FrameSystemLimitsWeightsPerClass;
- readonly mandatory: FrameSystemLimitsWeightsPerClass;
+ readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition';
}
/** @name UpDataStructsCollectionMode (155) */
@@ -1839,7 +1668,7 @@
readonly type: 'Nft' | 'Fungible' | 'ReFungible';
}
- /** @name UpDataStructsCreateCollectionData (156) */
+ /** @name UpDataStructsCreateCollectionData (155) */
export interface UpDataStructsCreateCollectionData extends Struct {
readonly mode: UpDataStructsCollectionMode;
readonly access: Option<UpDataStructsAccessMode>;
@@ -1853,14 +1682,14 @@
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsAccessMode (158) */
+ /** @name UpDataStructsAccessMode (157) */
export interface UpDataStructsAccessMode extends Enum {
readonly isNormal: boolean;
readonly isAllowList: boolean;
readonly type: 'Normal' | 'AllowList';
}
- /** @name UpDataStructsCollectionLimits (161) */
+ /** @name UpDataStructsCollectionLimits (160) */
export interface UpDataStructsCollectionLimits extends Struct {
readonly accountTokenOwnershipLimit: Option<u32>;
readonly sponsoredDataSize: Option<u32>;
@@ -1873,7 +1702,7 @@
readonly transfersEnabled: Option<bool>;
}
- /** @name UpDataStructsSponsoringRateLimit (163) */
+ /** @name UpDataStructsSponsoringRateLimit (162) */
export interface UpDataStructsSponsoringRateLimit extends Enum {
readonly isSponsoringDisabled: boolean;
readonly isBlocks: boolean;
@@ -1881,43 +1710,43 @@
readonly type: 'SponsoringDisabled' | 'Blocks';
}
- /** @name UpDataStructsCollectionPermissions (166) */
+ /** @name UpDataStructsCollectionPermissions (165) */
export interface UpDataStructsCollectionPermissions extends Struct {
readonly access: Option<UpDataStructsAccessMode>;
readonly mintMode: Option<bool>;
readonly nesting: Option<UpDataStructsNestingPermissions>;
}
- /** @name UpDataStructsNestingPermissions (168) */
+ /** @name UpDataStructsNestingPermissions (167) */
export interface UpDataStructsNestingPermissions extends Struct {
readonly tokenOwner: bool;
readonly collectionAdmin: bool;
readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;
}
- /** @name UpDataStructsOwnerRestrictedSet (170) */
+ /** @name UpDataStructsOwnerRestrictedSet (169) */
export interface UpDataStructsOwnerRestrictedSet extends BTreeSet<u32> {}
- /** @name UpDataStructsPropertyKeyPermission (176) */
+ /** @name UpDataStructsPropertyKeyPermission (175) */
export interface UpDataStructsPropertyKeyPermission extends Struct {
readonly key: Bytes;
readonly permission: UpDataStructsPropertyPermission;
}
- /** @name UpDataStructsPropertyPermission (178) */
+ /** @name UpDataStructsPropertyPermission (177) */
export interface UpDataStructsPropertyPermission extends Struct {
readonly mutable: bool;
readonly collectionAdmin: bool;
readonly tokenOwner: bool;
}
- /** @name UpDataStructsProperty (181) */
+ /** @name UpDataStructsProperty (180) */
export interface UpDataStructsProperty extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
- /** @name PalletEvmAccountBasicCrossAccountIdRepr (184) */
+ /** @name PalletEvmAccountBasicCrossAccountIdRepr (183) */
export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum {
readonly isSubstrate: boolean;
readonly asSubstrate: AccountId32;
@@ -1926,7 +1755,7 @@
readonly type: 'Substrate' | 'Ethereum';
}
- /** @name UpDataStructsCreateItemData (186) */
+ /** @name UpDataStructsCreateItemData (185) */
export interface UpDataStructsCreateItemData extends Enum {
readonly isNft: boolean;
readonly asNft: UpDataStructsCreateNftData;
@@ -1937,17 +1766,17 @@
readonly type: 'Nft' | 'Fungible' | 'ReFungible';
}
- /** @name UpDataStructsCreateNftData (187) */
+ /** @name UpDataStructsCreateNftData (186) */
export interface UpDataStructsCreateNftData extends Struct {
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsCreateFungibleData (188) */
+ /** @name UpDataStructsCreateFungibleData (187) */
export interface UpDataStructsCreateFungibleData extends Struct {
readonly value: u128;
}
- /** @name UpDataStructsCreateReFungibleData (189) */
+ /** @name UpDataStructsCreateReFungibleData (188) */
export interface UpDataStructsCreateReFungibleData extends Struct {
readonly pieces: u128;
readonly properties: Vec<UpDataStructsProperty>;
@@ -2028,7 +1857,7 @@
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name PalletUniqueSchedulerCall (205) */
+ /** @name PalletUniqueSchedulerCall (204) */
export interface PalletUniqueSchedulerCall extends Enum {
readonly isScheduleNamed: boolean;
readonly asScheduleNamed: {
@@ -2053,7 +1882,7 @@
readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter';
}
- /** @name FrameSupportScheduleMaybeHashed (207) */
+ /** @name FrameSupportScheduleMaybeHashed (206) */
export interface FrameSupportScheduleMaybeHashed extends Enum {
readonly isValue: boolean;
readonly asValue: Call;
@@ -2062,13 +1891,13 @@
readonly type: 'Value' | 'Hash';
}
- /** @name PalletTemplateTransactionPaymentCall (208) */
+ /** @name PalletTemplateTransactionPaymentCall (207) */
export type PalletTemplateTransactionPaymentCall = Null;
- /** @name PalletStructureCall (209) */
+ /** @name PalletStructureCall (208) */
export type PalletStructureCall = Null;
- /** @name PalletRmrkCoreCall (210) */
+ /** @name PalletRmrkCoreCall (209) */
export interface PalletRmrkCoreCall extends Enum {
readonly isCreateCollection: boolean;
readonly asCreateCollection: {
@@ -2174,7 +2003,7 @@
readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource';
}
- /** @name RmrkTraitsResourceResourceTypes (216) */
+ /** @name RmrkTraitsResourceResourceTypes (215) */
export interface RmrkTraitsResourceResourceTypes extends Enum {
readonly isBasic: boolean;
readonly asBasic: RmrkTraitsResourceBasicResource;
@@ -2185,7 +2014,7 @@
readonly type: 'Basic' | 'Composable' | 'Slot';
}
- /** @name RmrkTraitsResourceBasicResource (218) */
+ /** @name RmrkTraitsResourceBasicResource (217) */
export interface RmrkTraitsResourceBasicResource extends Struct {
readonly src: Option<Bytes>;
readonly metadata: Option<Bytes>;
@@ -2193,7 +2022,7 @@
readonly thumb: Option<Bytes>;
}
- /** @name RmrkTraitsResourceComposableResource (220) */
+ /** @name RmrkTraitsResourceComposableResource (219) */
export interface RmrkTraitsResourceComposableResource extends Struct {
readonly parts: Vec<u32>;
readonly base: u32;
@@ -2203,7 +2032,7 @@
readonly thumb: Option<Bytes>;
}
- /** @name RmrkTraitsResourceSlotResource (221) */
+ /** @name RmrkTraitsResourceSlotResource (220) */
export interface RmrkTraitsResourceSlotResource extends Struct {
readonly base: u32;
readonly src: Option<Bytes>;
@@ -2213,7 +2042,7 @@
readonly thumb: Option<Bytes>;
}
- /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (223) */
+ /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (222) */
export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {
readonly isAccountId: boolean;
readonly asAccountId: AccountId32;
@@ -2222,7 +2051,7 @@
readonly type: 'AccountId' | 'CollectionAndNftTuple';
}
- /** @name PalletRmrkEquipCall (227) */
+ /** @name PalletRmrkEquipCall (226) */
export interface PalletRmrkEquipCall extends Enum {
readonly isCreateBase: boolean;
readonly asCreateBase: {
@@ -2244,7 +2073,7 @@
readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable';
}
- /** @name RmrkTraitsPartPartType (230) */
+ /** @name RmrkTraitsPartPartType (229) */
export interface RmrkTraitsPartPartType extends Enum {
readonly isFixedPart: boolean;
readonly asFixedPart: RmrkTraitsPartFixedPart;
@@ -2253,14 +2082,14 @@
readonly type: 'FixedPart' | 'SlotPart';
}
- /** @name RmrkTraitsPartFixedPart (232) */
+ /** @name RmrkTraitsPartFixedPart (231) */
export interface RmrkTraitsPartFixedPart extends Struct {
readonly id: u32;
readonly z: u32;
readonly src: Bytes;
}
- /** @name RmrkTraitsPartSlotPart (233) */
+ /** @name RmrkTraitsPartSlotPart (232) */
export interface RmrkTraitsPartSlotPart extends Struct {
readonly id: u32;
readonly equippable: RmrkTraitsPartEquippableList;
@@ -2268,25 +2097,46 @@
readonly z: u32;
}
- /** @name RmrkTraitsPartEquippableList (234) */
+ /** @name RmrkTraitsPartEquippableList (233) */
export interface RmrkTraitsPartEquippableList extends Enum {
readonly isAll: boolean;
readonly type: 'Fee' | 'Misc' | 'All';
}
- /** @name RmrkTraitsTheme (236) */
+ /** @name RmrkTraitsTheme (235) */
export interface RmrkTraitsTheme extends Struct {
readonly name: Bytes;
readonly properties: Vec<RmrkTraitsThemeThemeProperty>;
readonly inherit: bool;
}
- /** @name RmrkTraitsThemeThemeProperty (238) */
+ /** @name RmrkTraitsThemeThemeProperty (237) */
export interface RmrkTraitsThemeThemeProperty extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
+ /** @name PalletAppPromotionCall (239) */
+ export interface PalletAppPromotionCall extends Enum {
+ readonly isSetAdminAddress: boolean;
+ readonly asSetAdminAddress: {
+ readonly admin: AccountId32;
+ } & Struct;
+ readonly isStartAppPromotion: boolean;
+ readonly asStartAppPromotion: {
+ readonly promotionStartRelayBlock: u32;
+ } & Struct;
+ readonly isStake: boolean;
+ readonly asStake: {
+ readonly amount: u128;
+ } & Struct;
+ readonly isUnstake: boolean;
+ readonly asUnstake: {
+ readonly amount: u128;
+ } & Struct;
+ readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake';
+ }
+
/** @name PalletEvmCall (240) */
export interface PalletEvmCall extends Enum {
readonly isWithdraw: boolean;
@@ -3213,7 +3063,7 @@
readonly type: 'Unknown' | 'OverLimit';
}
- /** @name PalletUniqueError (346) */
+ /** @name PalletUniqueError (345) */
export interface PalletUniqueError extends Enum {
readonly isCollectionDecimalPointLimitExceeded: boolean;
readonly isConfirmUnsetSponsorFail: boolean;
@@ -3222,7 +3072,7 @@
readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';
}
- /** @name PalletUniqueSchedulerScheduledV3 (349) */
+ /** @name PalletUniqueSchedulerScheduledV3 (348) */
export interface PalletUniqueSchedulerScheduledV3 extends Struct {
readonly maybeId: Option<U8aFixed>;
readonly priority: u8;
@@ -3231,7 +3081,7 @@
readonly origin: OpalRuntimeOriginCaller;
}
- /** @name OpalRuntimeOriginCaller (350) */
+ /** @name OpalRuntimeOriginCaller (349) */
export interface OpalRuntimeOriginCaller extends Enum {
readonly isVoid: boolean;
readonly isSystem: boolean;
@@ -3246,7 +3096,7 @@
readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum';
}
- /** @name FrameSupportDispatchRawOrigin (351) */
+ /** @name FrameSupportDispatchRawOrigin (350) */
export interface FrameSupportDispatchRawOrigin extends Enum {
readonly isRoot: boolean;
readonly isSigned: boolean;
@@ -3255,7 +3105,7 @@
readonly type: 'Root' | 'Signed' | 'None';
}
- /** @name PalletXcmOrigin (352) */
+ /** @name PalletXcmOrigin (351) */
export interface PalletXcmOrigin extends Enum {
readonly isXcm: boolean;
readonly asXcm: XcmV1MultiLocation;
@@ -3264,7 +3114,7 @@
readonly type: 'Xcm' | 'Response';
}
- /** @name CumulusPalletXcmOrigin (353) */
+ /** @name CumulusPalletXcmOrigin (352) */
export interface CumulusPalletXcmOrigin extends Enum {
readonly isRelay: boolean;
readonly isSiblingParachain: boolean;
@@ -3272,17 +3122,17 @@
readonly type: 'Relay' | 'SiblingParachain';
}
- /** @name PalletEthereumRawOrigin (354) */
+ /** @name PalletEthereumRawOrigin (353) */
export interface PalletEthereumRawOrigin extends Enum {
readonly isEthereumTransaction: boolean;
readonly asEthereumTransaction: H160;
readonly type: 'EthereumTransaction';
}
- /** @name SpCoreVoid (355) */
+ /** @name SpCoreVoid (354) */
export type SpCoreVoid = Null;
- /** @name PalletUniqueSchedulerError (356) */
+ /** @name PalletUniqueSchedulerError (355) */
export interface PalletUniqueSchedulerError extends Enum {
readonly isFailedToSchedule: boolean;
readonly isNotFound: boolean;
@@ -3291,7 +3141,7 @@
readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange';
}
- /** @name UpDataStructsCollection (357) */
+ /** @name UpDataStructsCollection (356) */
export interface UpDataStructsCollection extends Struct {
readonly owner: AccountId32;
readonly mode: UpDataStructsCollectionMode;
@@ -3304,7 +3154,7 @@
readonly externalCollection: bool;
}
- /** @name UpDataStructsSponsorshipState (358) */
+ /** @name UpDataStructsSponsorshipState (357) */
export interface UpDataStructsSponsorshipState extends Enum {
readonly isDisabled: boolean;
readonly isUnconfirmed: boolean;
@@ -3314,43 +3164,43 @@
readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
}
- /** @name UpDataStructsProperties (359) */
+ /** @name UpDataStructsProperties (358) */
export interface UpDataStructsProperties extends Struct {
readonly map: UpDataStructsPropertiesMapBoundedVec;
readonly consumedSpace: u32;
readonly spaceLimit: u32;
}
- /** @name UpDataStructsPropertiesMapBoundedVec (360) */
+ /** @name UpDataStructsPropertiesMapBoundedVec (359) */
export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}
- /** @name UpDataStructsPropertiesMapPropertyPermission (365) */
+ /** @name UpDataStructsPropertiesMapPropertyPermission (364) */
export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}
- /** @name UpDataStructsCollectionStats (372) */
+ /** @name UpDataStructsCollectionStats (371) */
export interface UpDataStructsCollectionStats extends Struct {
readonly created: u32;
readonly destroyed: u32;
readonly alive: u32;
}
- /** @name UpDataStructsTokenChild (373) */
+ /** @name UpDataStructsTokenChild (372) */
export interface UpDataStructsTokenChild extends Struct {
readonly token: u32;
readonly collection: u32;
}
- /** @name PhantomTypeUpDataStructs (374) */
+ /** @name PhantomTypeUpDataStructs (373) */
export interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsPropertyPropertyInfo, RmrkTraitsBaseBaseInfo, RmrkTraitsPartPartType, RmrkTraitsTheme, RmrkTraitsNftNftChild]>> {}
- /** @name UpDataStructsTokenData (376) */
+ /** @name UpDataStructsTokenData (375) */
export interface UpDataStructsTokenData extends Struct {
readonly properties: Vec<UpDataStructsProperty>;
readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;
readonly pieces: u128;
}
- /** @name UpDataStructsRpcCollection (378) */
+ /** @name UpDataStructsRpcCollection (377) */
export interface UpDataStructsRpcCollection extends Struct {
readonly owner: AccountId32;
readonly mode: UpDataStructsCollectionMode;
@@ -3365,7 +3215,7 @@
readonly readOnly: bool;
}
- /** @name RmrkTraitsCollectionCollectionInfo (379) */
+ /** @name RmrkTraitsCollectionCollectionInfo (378) */
export interface RmrkTraitsCollectionCollectionInfo extends Struct {
readonly issuer: AccountId32;
readonly metadata: Bytes;
@@ -3374,7 +3224,7 @@
readonly nftsCount: u32;
}
- /** @name RmrkTraitsNftNftInfo (380) */
+ /** @name RmrkTraitsNftNftInfo (379) */
export interface RmrkTraitsNftNftInfo extends Struct {
readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple;
readonly royalty: Option<RmrkTraitsNftRoyaltyInfo>;
@@ -3383,13 +3233,13 @@
readonly pending: bool;
}
- /** @name RmrkTraitsNftRoyaltyInfo (382) */
+ /** @name RmrkTraitsNftRoyaltyInfo (381) */
export interface RmrkTraitsNftRoyaltyInfo extends Struct {
readonly recipient: AccountId32;
readonly amount: Permill;
}
- /** @name RmrkTraitsResourceResourceInfo (383) */
+ /** @name RmrkTraitsResourceResourceInfo (382) */
export interface RmrkTraitsResourceResourceInfo extends Struct {
readonly id: u32;
readonly resource: RmrkTraitsResourceResourceTypes;
@@ -3397,26 +3247,26 @@
readonly pendingRemoval: bool;
}
- /** @name RmrkTraitsPropertyPropertyInfo (384) */
+ /** @name RmrkTraitsPropertyPropertyInfo (383) */
export interface RmrkTraitsPropertyPropertyInfo extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
- /** @name RmrkTraitsBaseBaseInfo (385) */
+ /** @name RmrkTraitsBaseBaseInfo (384) */
export interface RmrkTraitsBaseBaseInfo extends Struct {
readonly issuer: AccountId32;
readonly baseType: Bytes;
readonly symbol: Bytes;
}
- /** @name RmrkTraitsNftNftChild (386) */
+ /** @name RmrkTraitsNftNftChild (385) */
export interface RmrkTraitsNftNftChild extends Struct {
readonly collectionId: u32;
readonly nftId: u32;
}
- /** @name PalletCommonError (388) */
+ /** @name PalletCommonError (387) */
export interface PalletCommonError extends Enum {
readonly isCollectionNotFound: boolean;
readonly isMustBeTokenOwner: boolean;
@@ -3455,7 +3305,7 @@
readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal';
}
- /** @name PalletFungibleError (390) */
+ /** @name PalletFungibleError (389) */
export interface PalletFungibleError extends Enum {
readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isFungibleItemsHaveNoId: boolean;
@@ -3465,13 +3315,13 @@
readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
}
- /** @name PalletRefungibleItemData (391) */
+ /** @name PalletRefungibleItemData (390) */
export interface PalletRefungibleItemData extends Struct {
readonly constData: Bytes;
}
- /** @name PalletRefungibleError (397) */
- interface PalletRefungibleError extends Enum {
+ /** @name PalletRefungibleError (394) */
+ export interface PalletRefungibleError extends Enum {
readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isWrongRefungiblePieces: boolean;
readonly isRepartitionWhileNotOwningAllPieces: boolean;
@@ -3480,29 +3330,29 @@
readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
}
- /** @name PalletNonfungibleItemData (398) */
- interface PalletNonfungibleItemData extends Struct {
+ /** @name PalletNonfungibleItemData (395) */
+ export interface PalletNonfungibleItemData extends Struct {
readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;
}
- /** @name UpDataStructsPropertyScope (400) */
- interface UpDataStructsPropertyScope extends Enum {
+ /** @name UpDataStructsPropertyScope (397) */
+ export interface UpDataStructsPropertyScope extends Enum {
readonly isNone: boolean;
readonly isRmrk: boolean;
readonly isEth: boolean;
readonly type: 'None' | 'Rmrk' | 'Eth';
}
- /** @name PalletNonfungibleError (402) */
- interface PalletNonfungibleError extends Enum {
+ /** @name PalletNonfungibleError (399) */
+ export interface PalletNonfungibleError extends Enum {
readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isNonfungibleItemsHaveNoAmount: boolean;
readonly isCantBurnNftWithChildren: boolean;
readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';
}
- /** @name PalletStructureError (403) */
- interface PalletStructureError extends Enum {
+ /** @name PalletStructureError (400) */
+ export interface PalletStructureError extends Enum {
readonly isOuroborosDetected: boolean;
readonly isDepthLimit: boolean;
readonly isBreadthLimit: boolean;
@@ -3510,8 +3360,8 @@
readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound';
}
- /** @name PalletRmrkCoreError (404) */
- interface PalletRmrkCoreError extends Enum {
+ /** @name PalletRmrkCoreError (401) */
+ export interface PalletRmrkCoreError extends Enum {
readonly isCorruptedCollectionType: boolean;
readonly isRmrkPropertyKeyIsTooLong: boolean;
readonly isRmrkPropertyValueIsTooLong: boolean;
@@ -3534,8 +3384,8 @@
readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId';
}
- /** @name PalletRmrkEquipError (406) */
- interface PalletRmrkEquipError extends Enum {
+ /** @name PalletRmrkEquipError (403) */
+ export interface PalletRmrkEquipError extends Enum {
readonly isPermissionError: boolean;
readonly isNoAvailableBaseId: boolean;
readonly isNoAvailablePartId: boolean;
@@ -3546,8 +3396,8 @@
readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart';
}
- /** @name PalletEvmError (409) */
- interface PalletEvmError extends Enum {
+ /** @name PalletEvmError (406) */
+ export interface PalletEvmError extends Enum {
readonly isBalanceLow: boolean;
readonly isFeeOverflow: boolean;
readonly isPaymentOverflow: boolean;
@@ -3557,8 +3407,8 @@
readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';
}
- /** @name FpRpcTransactionStatus (412) */
- interface FpRpcTransactionStatus extends Struct {
+ /** @name FpRpcTransactionStatus (409) */
+ export interface FpRpcTransactionStatus extends Struct {
readonly transactionHash: H256;
readonly transactionIndex: u32;
readonly from: H160;
@@ -3568,11 +3418,11 @@
readonly logsBloom: EthbloomBloom;
}
- /** @name EthbloomBloom (414) */
- interface EthbloomBloom extends U8aFixed {}
+ /** @name EthbloomBloom (411) */
+ export interface EthbloomBloom extends U8aFixed {}
- /** @name EthereumReceiptReceiptV3 (416) */
- interface EthereumReceiptReceiptV3 extends Enum {
+ /** @name EthereumReceiptReceiptV3 (413) */
+ export interface EthereumReceiptReceiptV3 extends Enum {
readonly isLegacy: boolean;
readonly asLegacy: EthereumReceiptEip658ReceiptData;
readonly isEip2930: boolean;
@@ -3582,23 +3432,23 @@
readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
}
- /** @name EthereumReceiptEip658ReceiptData (417) */
- interface EthereumReceiptEip658ReceiptData extends Struct {
+ /** @name EthereumReceiptEip658ReceiptData (414) */
+ export interface EthereumReceiptEip658ReceiptData extends Struct {
readonly statusCode: u8;
readonly usedGas: U256;
readonly logsBloom: EthbloomBloom;
readonly logs: Vec<EthereumLog>;
}
- /** @name EthereumBlock (418) */
- interface EthereumBlock extends Struct {
+ /** @name EthereumBlock (415) */
+ export interface EthereumBlock extends Struct {
readonly header: EthereumHeader;
readonly transactions: Vec<EthereumTransactionTransactionV2>;
readonly ommers: Vec<EthereumHeader>;
}
- /** @name EthereumHeader (419) */
- interface EthereumHeader extends Struct {
+ /** @name EthereumHeader (416) */
+ export interface EthereumHeader extends Struct {
readonly parentHash: H256;
readonly ommersHash: H256;
readonly beneficiary: H160;
@@ -3616,46 +3466,46 @@
readonly nonce: EthereumTypesHashH64;
}
- /** @name EthereumTypesHashH64 (420) */
- interface EthereumTypesHashH64 extends U8aFixed {}
+ /** @name EthereumTypesHashH64 (417) */
+ export interface EthereumTypesHashH64 extends U8aFixed {}
- /** @name PalletEthereumError (425) */
- interface PalletEthereumError extends Enum {
+ /** @name PalletEthereumError (422) */
+ export interface PalletEthereumError extends Enum {
readonly isInvalidSignature: boolean;
readonly isPreLogExists: boolean;
readonly type: 'InvalidSignature' | 'PreLogExists';
}
- /** @name PalletEvmCoderSubstrateError (426) */
- interface PalletEvmCoderSubstrateError extends Enum {
+ /** @name PalletEvmCoderSubstrateError (423) */
+ export interface PalletEvmCoderSubstrateError extends Enum {
readonly isOutOfGas: boolean;
readonly isOutOfFund: boolean;
readonly type: 'OutOfGas' | 'OutOfFund';
}
- /** @name PalletEvmContractHelpersSponsoringModeT (427) */
- interface PalletEvmContractHelpersSponsoringModeT extends Enum {
+ /** @name PalletEvmContractHelpersSponsoringModeT (424) */
+ export interface PalletEvmContractHelpersSponsoringModeT extends Enum {
readonly isDisabled: boolean;
readonly isAllowlisted: boolean;
readonly isGenerous: boolean;
readonly type: 'Disabled' | 'Allowlisted' | 'Generous';
}
- /** @name PalletEvmContractHelpersError (429) */
- interface PalletEvmContractHelpersError extends Enum {
+ /** @name PalletEvmContractHelpersError (426) */
+ export interface PalletEvmContractHelpersError extends Enum {
readonly isNoPermission: boolean;
readonly type: 'NoPermission';
}
- /** @name PalletEvmMigrationError (430) */
- interface PalletEvmMigrationError extends Enum {
+ /** @name PalletEvmMigrationError (427) */
+ export interface PalletEvmMigrationError extends Enum {
readonly isAccountNotEmpty: boolean;
readonly isAccountIsNotMigrating: boolean;
readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';
}
- /** @name SpRuntimeMultiSignature (432) */
- interface SpRuntimeMultiSignature extends Enum {
+ /** @name SpRuntimeMultiSignature (429) */
+ export interface SpRuntimeMultiSignature extends Enum {
readonly isEd25519: boolean;
readonly asEd25519: SpCoreEd25519Signature;
readonly isSr25519: boolean;
@@ -3665,34 +3515,34 @@
readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
}
- /** @name SpCoreEd25519Signature (433) */
- interface SpCoreEd25519Signature extends U8aFixed {}
+ /** @name SpCoreEd25519Signature (430) */
+ export interface SpCoreEd25519Signature extends U8aFixed {}
- /** @name SpCoreSr25519Signature (435) */
- interface SpCoreSr25519Signature extends U8aFixed {}
+ /** @name SpCoreSr25519Signature (434) */
+ export interface SpCoreSr25519Signature extends U8aFixed {}
- /** @name SpCoreEcdsaSignature (436) */
- interface SpCoreEcdsaSignature extends U8aFixed {}
+ /** @name SpCoreEcdsaSignature (435) */
+ export interface SpCoreEcdsaSignature extends U8aFixed {}
- /** @name FrameSystemExtensionsCheckSpecVersion (439) */
- type FrameSystemExtensionsCheckSpecVersion = Null;
+ /** @name FrameSystemExtensionsCheckSpecVersion (438) */
+ export type FrameSystemExtensionsCheckSpecVersion = Null;
- /** @name FrameSystemExtensionsCheckGenesis (440) */
- type FrameSystemExtensionsCheckGenesis = Null;
+ /** @name FrameSystemExtensionsCheckGenesis (439) */
+ export type FrameSystemExtensionsCheckGenesis = Null;
- /** @name FrameSystemExtensionsCheckNonce (443) */
- interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
+ /** @name FrameSystemExtensionsCheckNonce (442) */
+ export interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
- /** @name FrameSystemExtensionsCheckWeight (444) */
- type FrameSystemExtensionsCheckWeight = Null;
+ /** @name FrameSystemExtensionsCheckWeight (443) */
+ export type FrameSystemExtensionsCheckWeight = Null;
- /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (445) */
- interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
+ /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (444) */
+ export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
- /** @name OpalRuntimeRuntime (446) */
- type OpalRuntimeRuntime = Null;
+ /** @name OpalRuntimeRuntime (445) */
+ export type OpalRuntimeRuntime = Null;
- /** @name PalletEthereumFakeTransactionFinalizer (447) */
- type PalletEthereumFakeTransactionFinalizer = Null;
+ /** @name PalletEthereumFakeTransactionFinalizer (444) */
+ export type PalletEthereumFakeTransactionFinalizer = Null;
} // declare module
tests/src/interfaces/unique/definitions.tsdiffbeforeafterboth--- a/tests/src/interfaces/unique/definitions.ts
+++ b/tests/src/interfaces/unique/definitions.ts
@@ -190,5 +190,10 @@
[crossAccountParam('staker')],
'u128',
),
+ pendingUnstake: fun(
+ 'Returns the total amount of unstaked tokens',
+ [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}],
+ 'u128',
+ ),
},
};
tests/src/pallet-presence.test.tsdiffbeforeafterboth--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -68,9 +68,10 @@
const refungible = 'refungible';
const scheduler = 'scheduler';
const rmrkPallets = ['rmrkcore', 'rmrkequip'];
+ const appPromotion = 'promotion';
if (chain.eq('OPAL by UNIQUE')) {
- requiredPallets.push(refungible, scheduler, ...rmrkPallets);
+ requiredPallets.push(refungible, scheduler, appPromotion, ...rmrkPallets);
} else if (chain.eq('QUARTZ by UNIQUE')) {
// Insert Quartz additional pallets here
} else if (chain.eq('UNIQUE')) {
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -48,6 +48,7 @@
Fungible = 'fungible',
NFT = 'nonfungible',
Scheduler = 'scheduler',
+ AppPromotion = 'promotion',
}
export async function isUnique(): Promise<boolean> {
tests/src/util/playgrounds/index.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/index.ts
+++ b/tests/src/util/playgrounds/index.ts
@@ -4,7 +4,10 @@
import {IKeyringPair} from '@polkadot/types/types';
import config from '../../config';
import '../../interfaces/augment-api-events';
-import {DevUniqueHelper} from './unique.dev';
+import * as defs from '../../interfaces/definitions';
+import {ApiPromise, WsProvider} from '@polkadot/api';
+import { UniqueHelper } from './unique';
+
class SilentLogger {
log(msg: any, level: any): void { }
@@ -15,13 +18,53 @@
};
}
-export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>) => {
+
+class DevUniqueHelper extends UniqueHelper {
+ async connect(wsEndpoint: string, listeners?: any): Promise<void> {
+ const wsProvider = new WsProvider(wsEndpoint);
+ this.api = new ApiPromise({
+ provider: wsProvider,
+ signedExtensions: {
+ ContractHelpers: {
+ extrinsic: {},
+ payload: {},
+ },
+ FakeTransactionFinalizer: {
+ extrinsic: {},
+ payload: {},
+ },
+ },
+ rpc: {
+ unique: defs.unique.rpc,
+ rmrk: defs.rmrk.rpc,
+ eth: {
+ feeHistory: {
+ description: 'Dummy',
+ params: [],
+ type: 'u8',
+ },
+ maxPriorityFeePerGas: {
+ description: 'Dummy',
+ params: [],
+ type: 'u8',
+ },
+ },
+ },
+ });
+ await this.api.isReadyOrError;
+ this.network = await UniqueHelper.detectNetwork(this.api);
+ }
+}
+
+
+export const usingPlaygrounds = async <T = void> (code: (helper: UniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<T>) => {
// TODO: Remove, this is temporary: Filter unneeded API output
// (Jaco promised it will be removed in the next version)
const consoleErr = console.error;
const consoleLog = console.log;
const consoleWarn = console.warn;
-
+ let result: T = null as unknown as T;
+
const outFn = (printer: any) => (...args: any[]) => {
for (const arg of args) {
if (typeof arg !== 'string')
@@ -41,7 +84,7 @@
await helper.connect(config.substrateUrl);
const ss58Format = helper.chain.getChainProperties().ss58Format;
const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format);
- await code(helper, privateKey);
+ result = await code(helper, privateKey);
}
finally {
await helper.disconnect();
@@ -49,4 +92,5 @@
console.log = consoleLog;
console.warn = consoleWarn;
}
+ return result as T;
};
\ No newline at end of file