difftreelog
Merge branch 'develop' into feature/prop-check-root-owner
in: master
41 files changed
pallets/nonfungible/src/lib.rsdiffbeforeafterboth382 <TokenData<T>>::get((collection.id, token)).ok_or(<CommonError<T>>::TokenNotFound)?;382 <TokenData<T>>::get((collection.id, token)).ok_or(<CommonError<T>>::TokenNotFound)?;383 ensure!(383 ensure!(&token_data.owner == sender, <CommonError<T>>::NoPermission);384 &token_data.owner == sender385 || (collection.limits.owner_can_transfer() && collection.is_owner_or_admin(sender)),386 <CommonError<T>>::NoPermission387 );388384696692697 let token_data =693 let token_data =698 <TokenData<T>>::get((collection.id, token)).ok_or(<CommonError<T>>::TokenNotFound)?;694 <TokenData<T>>::get((collection.id, token)).ok_or(<CommonError<T>>::TokenNotFound)?;699 // TODO: require sender to be token, owner, require admins to go through transfer_from700 ensure!(695 ensure!(&token_data.owner == from, <CommonError<T>>::NoPermission);701 &token_data.owner == from702 || (collection.limits.owner_can_transfer() && collection.is_owner_or_admin(from)),703 <CommonError<T>>::NoPermission704 );7056961009 collection.check_allowlist(spender)?;1000 collection.check_allowlist(spender)?;1010 }1001 }10021003 if collection.limits.owner_can_transfer() && collection.is_owner_or_admin(spender) {1004 return Ok(());1005 }10061011 if let Some(source) = T::CrossTokenAddressMapping::address_to_token(from) {1007 if let Some(source) = T::CrossTokenAddressMapping::address_to_token(from) {1012 // TODO: should collection owner be allowed to perform this transfer?1013 ensure!(1008 ensure!(1014 <PalletStructure<T>>::check_indirectly_owned(1009 <PalletStructure<T>>::check_indirectly_owned(1015 spender.clone(),1010 spender.clone(),pallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth19use frame_support::{pallet_prelude::*, transactional, BoundedVec, dispatch::DispatchResult};19use frame_support::{pallet_prelude::*, transactional, BoundedVec, dispatch::DispatchResult};20use frame_system::{pallet_prelude::*, ensure_signed};20use frame_system::{pallet_prelude::*, ensure_signed};21use sp_runtime::{DispatchError, Permill, traits::StaticLookup};21use sp_runtime::{DispatchError, Permill, traits::StaticLookup};22use sp_std::vec::Vec;22use sp_std::{23 vec::Vec,24 collections::{btree_set::BTreeSet, btree_map::BTreeMap},25};23use up_data_structs::{*, mapping::TokenAddressMapping};26use up_data_structs::{*, mapping::TokenAddressMapping};24use pallet_common::{27use pallet_common::{25 Pallet as PalletCommon, Error as CommonError, CollectionHandle, CommonCollectionOperations,28 Pallet as PalletCommon, Error as CommonError, CollectionHandle, CommonCollectionOperations,485149pub const NESTING_BUDGET: u32 = 5;52pub const NESTING_BUDGET: u32 = 5;5354type PendingTarget = (CollectionId, TokenId);55type PendingChild = (RmrkCollectionId, RmrkNftId);56type PendingChildrenSet = BTreeSet<PendingChild>;5758type BasesMap = BTreeMap<RmrkBaseId, u32>;505951#[frame_support::pallet]60#[frame_support::pallet]52pub mod pallet {61pub mod pallet {383 [392 [384 Self::rmrk_property(TokenType, &NftType::Regular)?,393 Self::rmrk_property(TokenType, &NftType::Regular)?,385 Self::rmrk_property(Transferable, &transferable)?,394 Self::rmrk_property(Transferable, &transferable)?,386 Self::rmrk_property(PendingNftAccept, &false)?,395 Self::rmrk_property(PendingNftAccept, &None::<PendingTarget>)?,387 Self::rmrk_property(RoyaltyInfo, &royalty_info)?,396 Self::rmrk_property(RoyaltyInfo, &royalty_info)?,388 Self::rmrk_property(Metadata, &metadata)?,397 Self::rmrk_property(Metadata, &metadata)?,389 Self::rmrk_property(Equipped, &false)?,398 Self::rmrk_property(Equipped, &false)?,390 Self::rmrk_property(ResourcePriorities, &<Vec<u8>>::new())?,399 Self::rmrk_property(ResourcePriorities, &<Vec<u8>>::new())?,391 Self::rmrk_property(NextResourceId, &(0 as RmrkResourceId))?,400 Self::rmrk_property(NextResourceId, &(0 as RmrkResourceId))?,401 Self::rmrk_property(PendingChildren, &PendingChildrenSet::new())?,402 Self::rmrk_property(AssociatedBases, &BasesMap::new())?,392 ]403 ]393 .into_iter(),404 .into_iter(),394 )405 )483 );494 );484495485 ensure!(496 ensure!(486 !Self::get_nft_property_decoded(497 Self::get_nft_property_decoded::<Option<PendingTarget>>(487 collection_id,498 collection_id,488 nft_id,499 nft_id,489 RmrkProperty::PendingNftAccept500 RmrkProperty::PendingNftAccept490 )?,501 )?502 .is_none(),491 <Error<T>>::NoPermission503 <Error<T>>::NoPermission492 );504 );493505524 collection.id,536 collection.id,525 nft_id,537 nft_id,526 PropertyScope::Rmrk,538 PropertyScope::Rmrk,527 Self::rmrk_property(PendingNftAccept, &approval_required)?,539 Self::rmrk_property::<Option<PendingTarget>>(540 PendingNftAccept,541 &Some((target_collection_id, target_nft_id.into())),542 )?,528 )?;543 )?;544545 Self::insert_pending_child(546 (target_collection_id, target_nft_id.into()),547 (rmrk_collection_id, rmrk_nft_id),548 )?;529 } else {549 } else {530 target_owner = T::CrossTokenAddressMapping::token_to_address(550 target_owner = T::CrossTokenAddressMapping::token_to_address(531 target_collection_id,551 target_collection_id,618 }638 }619 })?;639 })?;640641 let pending_target = Self::get_nft_property_decoded::<Option<PendingTarget>>(642 collection_id,643 nft_id,644 RmrkProperty::PendingNftAccept,645 )?;646647 if let Some(pending_target) = pending_target {648 Self::remove_pending_child(pending_target, (rmrk_collection_id, rmrk_nft_id))?;620649621 <PalletNft<T>>::set_scoped_token_property(650 <PalletNft<T>>::set_scoped_token_property(622 collection.id,651 collection.id,623 nft_id,652 nft_id,624 PropertyScope::Rmrk,653 PropertyScope::Rmrk,625 Self::rmrk_property(PendingNftAccept, &false)?,654 Self::rmrk_property(PendingNftAccept, &None::<PendingTarget>)?,626 )?;655 )?;656 }627657628 Self::deposit_event(Event::NFTAccepted {658 Self::deposit_event(Event::NFTAccepted {629 sender,659 sender,663 <Error<T>>::NoAvailableNftId693 <Error<T>>::NoAvailableNftId664 );694 );665695666 ensure!(667 Self::get_nft_property_decoded(696 let pending_target = Self::get_nft_property_decoded::<Option<PendingTarget>>(668 collection_id,697 collection_id,669 nft_id,698 nft_id,670 RmrkProperty::PendingNftAccept699 RmrkProperty::PendingNftAccept,671 )?,700 )?;672 <Error<T>>::CannotRejectNonPendingNft701673 );702 match pending_target {703 Some(pending_target) => {704 Self::remove_pending_child(pending_target, (rmrk_collection_id, rmrk_nft_id))?705 }706 None => return Err(<Error<T>>::CannotRejectNonPendingNft.into()),707 }674708675 Self::destroy_nft(709 Self::destroy_nft(676 cross_sender,710 cross_sender,785 resource_id_key,819 resource_id_key,786 );820 );821822 if let RmrkResourceTypes::Composable(resource) = resource_info.resource {823 let base_id = resource.base;824825 Self::remove_associated_base_id(collection_id, nft_id, base_id)?;826 }787827788 Self::deposit_event(Event::<T>::ResourceRemovalAccepted {828 Self::deposit_event(Event::<T>::ResourceRemovalAccepted {789 nft_id: rmrk_nft_id,829 nft_id: rmrk_nft_id,938 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;978 Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;939 collection.check_is_external()?;979 collection.check_is_external()?;980981 let base_id = resource.base;940982941 let resource_id = Self::resource_add(983 let resource_id = Self::resource_add(942 sender,984 sender,945 RmrkResourceTypes::Composable(resource),987 RmrkResourceTypes::Composable(resource),946 )?;988 )?;989990 <PalletNft<T>>::try_mutate_token_aux_property(991 collection_id,992 nft_id.into(),993 PropertyScope::Rmrk,994 Self::rmrk_property_key(AssociatedBases)?,995 |value| -> DispatchResult {996 let mut bases: BasesMap = match value {997 Some(value) => Self::decode_property(value)?,998 None => BasesMap::new(),999 };10001001 *bases.entry(base_id).or_insert(0) += 1;10021003 *value = Some(Self::encode_property(&bases)?);1004 Ok(())1005 },1006 )?;9471007948 Self::deposit_event(Event::ResourceAdded {1008 Self::deposit_event(Event::ResourceAdded {949 nft_id,1009 nft_id,1147 )1207 )1148 }1208 }12091210 fn insert_pending_child(1211 target: (CollectionId, TokenId),1212 child: (RmrkCollectionId, RmrkNftId),1213 ) -> DispatchResult {1214 Self::mutate_pending_child(target, |pending_children| {1215 pending_children.insert(child);1216 })1217 }12181219 fn remove_pending_child(1220 target: (CollectionId, TokenId),1221 child: (RmrkCollectionId, RmrkNftId),1222 ) -> DispatchResult {1223 Self::mutate_pending_child(target, |pending_children| {1224 pending_children.remove(&child);1225 })1226 }12271228 fn mutate_pending_child(1229 (target_collection_id, target_nft_id): (CollectionId, TokenId),1230 f: impl FnOnce(&mut PendingChildrenSet),1231 ) -> DispatchResult {1232 <PalletNft<T>>::try_mutate_token_aux_property(1233 target_collection_id,1234 target_nft_id,1235 PropertyScope::Rmrk,1236 Self::rmrk_property_key(PendingChildren)?,1237 |pending_children| -> DispatchResult {1238 let mut map = match pending_children {1239 Some(map) => Self::decode_property(map)?,1240 None => PendingChildrenSet::new(),1241 };12421243 f(&mut map);12441245 *pending_children = Some(Self::encode_property(&map)?);12461247 Ok(())1248 },1249 )1250 }12511252 fn iterate_pending_children(1253 collection_id: CollectionId,1254 nft_id: TokenId,1255 ) -> Result<impl Iterator<Item = PendingChild>, DispatchError> {1256 let property = <PalletNft<T>>::token_aux_property((1257 collection_id,1258 nft_id,1259 PropertyScope::Rmrk,1260 Self::rmrk_property_key(PendingChildren)?,1261 ));12621263 let pending_children = match property {1264 Some(map) => Self::decode_property(&map)?,1265 None => PendingChildrenSet::new(),1266 };12671268 Ok(pending_children.into_iter())1269 }114912701150 fn acquire_next_resource_id(1271 fn acquire_next_resource_id(1151 collection_id: CollectionId,1272 collection_id: CollectionId,1223 let resource_id_key = Self::rmrk_property_key(ResourceId(resource_id))?;1344 let resource_id_key = Self::rmrk_property_key(ResourceId(resource_id))?;1224 let scope = PropertyScope::Rmrk;1345 let scope = PropertyScope::Rmrk;122513461226 ensure!(1227 <PalletNft<T>>::token_aux_property((1347 let resource = <PalletNft<T>>::token_aux_property((1228 collection_id,1348 collection_id,1229 nft_id,1349 nft_id,1230 scope,1350 scope,1231 resource_id_key.clone()1351 resource_id_key.clone(),1232 ))1352 ))1233 .is_some(),1353 .ok_or(<Error<T>>::ResourceDoesntExist)?;1234 <Error<T>>::ResourceDoesntExist13541235 );1355 let resource_info: RmrkResourceInfo = Self::decode_property(&resource)?;123613561237 let budget = up_data_structs::budget::Value::new(NESTING_BUDGET);1357 let budget = up_data_structs::budget::Value::new(NESTING_BUDGET);1238 let topmost_owner =1358 let topmost_owner =1247 Self::rmrk_property_key(ResourceId(resource_id))?,1367 Self::rmrk_property_key(ResourceId(resource_id))?,1248 );1368 );13691370 if let RmrkResourceTypes::Composable(resource) = resource_info.resource {1371 let base_id = resource.base;13721373 Self::remove_associated_base_id(collection_id, nft_id, base_id)?;1374 }1249 } else {1375 } else {1250 Self::try_mutate_resource_info(collection_id, nft_id, resource_id, |res| {1376 Self::try_mutate_resource_info(collection_id, nft_id, resource_id, |res| {1251 res.pending_removal = true;1377 res.pending_removal = true;1257 Ok(())1383 Ok(())1258 }1384 }13851386 fn remove_associated_base_id(1387 collection_id: CollectionId,1388 nft_id: TokenId,1389 base_id: RmrkBaseId,1390 ) -> DispatchResult {1391 <PalletNft<T>>::try_mutate_token_aux_property(1392 collection_id,1393 nft_id,1394 PropertyScope::Rmrk,1395 Self::rmrk_property_key(AssociatedBases)?,1396 |value| -> DispatchResult {1397 let mut bases: BasesMap = match value {1398 Some(value) => Self::decode_property(value)?,1399 None => BasesMap::new(),1400 };14011402 let remaining = bases.get(&base_id);14031404 if let Some(remaining) = remaining {1405 if let Some(0) | None = remaining.checked_sub(1) {1406 bases.remove(&base_id);1407 }1408 }14091410 *value = Some(Self::encode_property(&bases)?);1411 Ok(())1412 },1413 )1414 }125914151260 fn try_mutate_resource_info(1416 fn try_mutate_resource_info(1261 collection_id: CollectionId,1417 collection_id: CollectionId,1526 Value: Decode + Default,1682 Value: Decode + Default,1527 Mapper: Fn(Key, Value) -> R,1683 Mapper: Fn(Key, Value) -> R,1528 {1684 {1529 let key_prefix = Self::rmrk_property_key(UserProperty(b""))?;15301531 let properties = match token_id {1685 let properties = match token_id {1532 Some(token_id) => <PalletNft<T>>::token_properties((collection_id, token_id)),1686 Some(token_id) => <PalletNft<T>>::token_properties((collection_id, token_id)),1533 None => <PalletCommon<T>>::collection_properties(collection_id),1687 None => <PalletCommon<T>>::collection_properties(collection_id),1534 };1688 };153516891536 let properties = properties.into_iter().filter_map(move |(key, value)| {1690 let properties = properties.into_iter().filter_map(move |(key, value)| {1537 let key = key.as_slice().strip_prefix(key_prefix.as_slice())?;1691 let key = strip_key_prefix(&key, USER_PROPERTY_PREFIX)?;153816921539 let key: Key = key.to_vec().try_into().ok()?;1693 let key: Key = key.to_vec().try_into().ok()?;1540 let value: Value = value.decode().ok()?;1694 let value: Value = value.decode().ok()?;pallets/proxy-rmrk-core/src/property.rsdiffbeforeafterboth15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.161617use super::*;17use super::*;18use up_data_structs::PropertyScope;18use core::convert::AsRef;19use core::convert::AsRef;192020const RESOURCE_ID_PREFIX: &str = "rsid-";21pub const RESOURCE_ID_PREFIX: &str = "rsid-";22pub const USER_PROPERTY_PREFIX: &str = "userprop-";212322pub enum RmrkProperty<'r> {24pub enum RmrkProperty<'r> {23 Metadata,25 Metadata,31 NextResourceId,33 NextResourceId,32 ResourceId(RmrkResourceId),34 ResourceId(RmrkResourceId),33 PendingNftAccept,35 PendingNftAccept,36 PendingChildren,37 AssociatedBases,34 Parts,38 Parts,35 Base,39 Base,36 Src,40 Src,73 Self::NextResourceId => key!("next-resource-id"),77 Self::NextResourceId => key!("next-resource-id"),74 Self::ResourceId(id) => key!(RESOURCE_ID_PREFIX, id.to_le_bytes()),78 Self::ResourceId(id) => key!(RESOURCE_ID_PREFIX, id.to_le_bytes()),75 Self::PendingNftAccept => key!("pending-nft-accept"),79 Self::PendingNftAccept => key!("pending-nft-accept"),80 Self::PendingChildren => key!("pending-children"),81 Self::AssociatedBases => key!("assoc-bases"),76 Self::Parts => key!("parts"),82 Self::Parts => key!("parts"),77 Self::Base => key!("base"),83 Self::Base => key!("base"),78 Self::Src => key!("src"),84 Self::Src => key!("src"),83 Self::ZIndex => key!("z-index"),89 Self::ZIndex => key!("z-index"),84 Self::ThemeName => key!("theme-name"),90 Self::ThemeName => key!("theme-name"),85 Self::ThemeInherit => key!("theme-inherit"),91 Self::ThemeInherit => key!("theme-inherit"),86 Self::UserProperty(name) => key!("userprop-", name),92 Self::UserProperty(name) => key!(USER_PROPERTY_PREFIX, name),87 }93 }88 }94 }89}95}9697pub fn strip_key_prefix(key: &PropertyKey, prefix: &str) -> Option<PropertyKey> {98 let key_prefix = PropertyKey::try_from(prefix.as_bytes().to_vec()).ok()?;99 let key_prefix = PropertyScope::Rmrk.apply(key_prefix).ok()?;100101 key.as_slice()102 .strip_prefix(key_prefix.as_slice())?103 .to_vec()104 .try_into()105 .ok()106}107108pub fn is_valid_key_prefix(key: &PropertyKey, prefix: &str) -> bool {109 strip_key_prefix(key, prefix).is_some()110}90111pallets/proxy-rmrk-core/src/rpc.rsdiffbeforeafterboth131131132 Ok(132 Ok(133 pallet_nonfungible::TokenChildren::<T>::iter_prefix((collection_id, nft_id))133 pallet_nonfungible::TokenChildren::<T>::iter_prefix((collection_id, nft_id))134 .filter_map(|((child_collection, child_token), _)| {134 .filter_map(|((child_collection, child_token), _)| {135 let is_pending = <Pallet<T>>::get_nft_property_decoded(136 child_collection,137 child_token,138 RmrkProperty::PendingNftAccept,139 )140 .ok()?;141142 if is_pending {143 return None;144 }145146 let rmrk_child_collection =135 let rmrk_child_collection =147 <Pallet<T>>::rmrk_collection_id(child_collection).ok()?;136 <Pallet<T>>::rmrk_collection_id(child_collection).ok()?;150 collection_id: rmrk_child_collection,139 collection_id: rmrk_child_collection,151 nft_id: child_token.0,140 nft_id: child_token.0,152 })141 })153 })142 })143 .chain(144 <Pallet<T>>::iterate_pending_children(collection_id, nft_id)?.map(145 |(child_collection, child_nft_id)| RmrkNftChild {146 collection_id: child_collection,147 nft_id: child_nft_id,148 },149 ),150 )154 .collect(),151 .collect(),155 )152 )156}153}224 nft_id,221 nft_id,225 PropertyScope::Rmrk,222 PropertyScope::Rmrk,226 )223 )227 .filter_map(|(_, value)| {224 .filter_map(|(key, value)| {225 if !is_valid_key_prefix(&key, RESOURCE_ID_PREFIX) {226 return None;227 }228228 let resource_info: RmrkResourceInfo = <Pallet<T>>::decode_property(&value).ok()?;229 let resource_info: RmrkResourceInfo = <Pallet<T>>::decode_property(&value).ok()?;229230pallets/proxy-rmrk-core/src/weights.rsdiffbeforeafterboth3//! Autogenerated weights for pallet_proxy_rmrk_core3//! Autogenerated weights for pallet_proxy_rmrk_core4//!4//!5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev6//! DATE: 2022-06-21, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`6//! DATE: 2022-07-01, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`7//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 10247//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024889// Executed Command:9// Executed Command:64 // Storage: Common CollectionById (r:0 w:1)64 // Storage: Common CollectionById (r:0 w:1)65 // Storage: RmrkCore UniqueCollectionId (r:0 w:1)65 // Storage: RmrkCore UniqueCollectionId (r:0 w:1)66 fn create_collection() -> Weight {66 fn create_collection() -> Weight {67 (49_986_000 as Weight)67 (49_365_000 as Weight)68 .saturating_add(T::DbWeight::get().reads(5 as Weight))68 .saturating_add(T::DbWeight::get().reads(5 as Weight))69 .saturating_add(T::DbWeight::get().writes(8 as Weight))69 .saturating_add(T::DbWeight::get().writes(8 as Weight))70 }70 }77 // Storage: Nonfungible TokensBurnt (r:0 w:1)77 // Storage: Nonfungible TokensBurnt (r:0 w:1)78 // Storage: Common AdminAmount (r:0 w:1)78 // Storage: Common AdminAmount (r:0 w:1)79 fn destroy_collection() -> Weight {79 fn destroy_collection() -> Weight {80 (50_177_000 as Weight)80 (49_903_000 as Weight)81 .saturating_add(T::DbWeight::get().reads(5 as Weight))81 .saturating_add(T::DbWeight::get().reads(5 as Weight))82 .saturating_add(T::DbWeight::get().writes(6 as Weight))82 .saturating_add(T::DbWeight::get().writes(6 as Weight))83 }83 }84 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)84 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)85 // Storage: Common CollectionById (r:1 w:1)85 // Storage: Common CollectionById (r:1 w:1)86 // Storage: Common CollectionProperties (r:1 w:0)86 // Storage: Common CollectionProperties (r:1 w:0)87 fn change_collection_issuer() -> Weight {87 fn change_collection_issuer() -> Weight {88 (25_949_000 as Weight)88 (26_134_000 as Weight)89 .saturating_add(T::DbWeight::get().reads(3 as Weight))89 .saturating_add(T::DbWeight::get().reads(3 as Weight))90 .saturating_add(T::DbWeight::get().writes(1 as Weight))90 .saturating_add(T::DbWeight::get().writes(1 as Weight))91 }91 }95 // Storage: Nonfungible TokensMinted (r:1 w:0)95 // Storage: Nonfungible TokensMinted (r:1 w:0)96 // Storage: Nonfungible TokensBurnt (r:1 w:0)96 // Storage: Nonfungible TokensBurnt (r:1 w:0)97 fn lock_collection() -> Weight {97 fn lock_collection() -> Weight {98 (27_183_000 as Weight)98 (28_020_000 as Weight)99 .saturating_add(T::DbWeight::get().reads(5 as Weight))99 .saturating_add(T::DbWeight::get().reads(5 as Weight))100 .saturating_add(T::DbWeight::get().writes(1 as Weight))100 .saturating_add(T::DbWeight::get().writes(1 as Weight))101 }101 }109 // Storage: Nonfungible Owned (r:0 w:1)109 // Storage: Nonfungible Owned (r:0 w:1)110 // Storage: Nonfungible TokenAuxProperties (r:2 w:2)110 // Storage: Nonfungible TokenAuxProperties (r:2 w:2)111 fn mint_nft(b: u32, ) -> Weight {111 fn mint_nft(b: u32, ) -> Weight {112 (65_512_000 as Weight)112 (67_476_000 as Weight)113 // Standard Error: 12_000113 // Standard Error: 19_000114 .saturating_add((11_525_000 as Weight).saturating_mul(b as Weight))114 .saturating_add((12_373_000 as Weight).saturating_mul(b as Weight))115 .saturating_add(T::DbWeight::get().reads(6 as Weight))115 .saturating_add(T::DbWeight::get().reads(6 as Weight))116 .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))116 .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))117 .saturating_add(T::DbWeight::get().writes(5 as Weight))117 .saturating_add(T::DbWeight::get().writes(5 as Weight))129 // Storage: Nonfungible TokenProperties (r:0 w:1)129 // Storage: Nonfungible TokenProperties (r:0 w:1)130 fn burn_nft(b: u32, ) -> Weight {130 fn burn_nft(b: u32, ) -> Weight {131 (0 as Weight)131 (0 as Weight)132 // Standard Error: 1_472_000132 // Standard Error: 1_500_000133 .saturating_add((296_221_000 as Weight).saturating_mul(b as Weight))133 .saturating_add((300_520_000 as Weight).saturating_mul(b as Weight))134 .saturating_add(T::DbWeight::get().reads(9 as Weight))134 .saturating_add(T::DbWeight::get().reads(9 as Weight))135 .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(b as Weight)))135 .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(b as Weight)))136 .saturating_add(T::DbWeight::get().writes(6 as Weight))136 .saturating_add(T::DbWeight::get().writes(6 as Weight))146 // Storage: Nonfungible TokenChildren (r:0 w:1)146 // Storage: Nonfungible TokenChildren (r:0 w:1)147 // Storage: Nonfungible Owned (r:0 w:2)147 // Storage: Nonfungible Owned (r:0 w:2)148 fn send() -> Weight {148 fn send() -> Weight {149 (82_778_000 as Weight)149 (84_023_000 as Weight)150 .saturating_add(T::DbWeight::get().reads(12 as Weight))150 .saturating_add(T::DbWeight::get().reads(12 as Weight))151 .saturating_add(T::DbWeight::get().writes(6 as Weight))151 .saturating_add(T::DbWeight::get().writes(6 as Weight))152 }152 }157 // Storage: Nonfungible AccountBalance (r:2 w:2)157 // Storage: Nonfungible AccountBalance (r:2 w:2)158 // Storage: Nonfungible Allowance (r:1 w:0)158 // Storage: Nonfungible Allowance (r:1 w:0)159 // Storage: Nonfungible TokenProperties (r:1 w:1)159 // Storage: Nonfungible TokenProperties (r:1 w:1)160 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)160 // Storage: Nonfungible TokenChildren (r:0 w:1)161 // Storage: Nonfungible TokenChildren (r:0 w:1)161 // Storage: Nonfungible Owned (r:0 w:2)162 // Storage: Nonfungible Owned (r:0 w:2)162 fn accept_nft() -> Weight {163 fn accept_nft() -> Weight {163 (90_190_000 as Weight)164 (98_502_000 as Weight)164 .saturating_add(T::DbWeight::get().reads(15 as Weight))165 .saturating_add(T::DbWeight::get().reads(16 as Weight))165 .saturating_add(T::DbWeight::get().writes(7 as Weight))166 .saturating_add(T::DbWeight::get().writes(8 as Weight))166 }167 }167 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)168 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)168 // Storage: Common CollectionProperties (r:1 w:0)169 // Storage: Common CollectionProperties (r:1 w:0)169 // Storage: Common CollectionById (r:1 w:0)170 // Storage: Common CollectionById (r:1 w:0)170 // Storage: Nonfungible TokenData (r:5 w:5)171 // Storage: Nonfungible TokenData (r:5 w:5)171 // Storage: Nonfungible TokenProperties (r:1 w:5)172 // Storage: Nonfungible TokenProperties (r:1 w:5)173 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)172 // Storage: Nonfungible TokenChildren (r:9 w:4)174 // Storage: Nonfungible TokenChildren (r:9 w:4)173 // Storage: Nonfungible TokensBurnt (r:1 w:1)175 // Storage: Nonfungible TokensBurnt (r:1 w:1)174 // Storage: Nonfungible AccountBalance (r:5 w:5)176 // Storage: Nonfungible AccountBalance (r:5 w:5)175 // Storage: Nonfungible Allowance (r:5 w:0)177 // Storage: Nonfungible Allowance (r:5 w:0)176 // Storage: Nonfungible Owned (r:0 w:5)178 // Storage: Nonfungible Owned (r:0 w:5)177 fn reject_nft() -> Weight {179 fn reject_nft() -> Weight {178 (262_238_000 as Weight)180 (277_017_000 as Weight)179 .saturating_add(T::DbWeight::get().reads(29 as Weight))181 .saturating_add(T::DbWeight::get().reads(30 as Weight))180 .saturating_add(T::DbWeight::get().writes(25 as Weight))182 .saturating_add(T::DbWeight::get().writes(26 as Weight))181 }183 }182 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)184 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)183 // Storage: Common CollectionProperties (r:1 w:0)185 // Storage: Common CollectionProperties (r:1 w:0)184 // Storage: Common CollectionById (r:1 w:0)186 // Storage: Common CollectionById (r:1 w:0)185 // Storage: Nonfungible TokenProperties (r:1 w:1)187 // Storage: Nonfungible TokenProperties (r:1 w:1)186 // Storage: Nonfungible TokenData (r:5 w:0)188 // Storage: Nonfungible TokenData (r:5 w:0)187 fn set_property() -> Weight {189 fn set_property() -> Weight {188 (55_187_000 as Weight)190 (55_408_000 as Weight)189 .saturating_add(T::DbWeight::get().reads(9 as Weight))191 .saturating_add(T::DbWeight::get().reads(9 as Weight))190 .saturating_add(T::DbWeight::get().writes(1 as Weight))192 .saturating_add(T::DbWeight::get().writes(1 as Weight))191 }193 }195 // Storage: Nonfungible TokenProperties (r:1 w:1)197 // Storage: Nonfungible TokenProperties (r:1 w:1)196 // Storage: Nonfungible TokenData (r:5 w:0)198 // Storage: Nonfungible TokenData (r:5 w:0)197 fn set_priority() -> Weight {199 fn set_priority() -> Weight {198 (54_092_000 as Weight)200 (55_063_000 as Weight)199 .saturating_add(T::DbWeight::get().reads(9 as Weight))201 .saturating_add(T::DbWeight::get().reads(9 as Weight))200 .saturating_add(T::DbWeight::get().writes(1 as Weight))202 .saturating_add(T::DbWeight::get().writes(1 as Weight))201 }203 }206 // Storage: Nonfungible TokenProperties (r:1 w:1)208 // Storage: Nonfungible TokenProperties (r:1 w:1)207 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)209 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)208 fn add_basic_resource() -> Weight {210 fn add_basic_resource() -> Weight {209 (62_551_000 as Weight)211 (64_656_000 as Weight)210 .saturating_add(T::DbWeight::get().reads(10 as Weight))212 .saturating_add(T::DbWeight::get().reads(10 as Weight))211 .saturating_add(T::DbWeight::get().writes(2 as Weight))213 .saturating_add(T::DbWeight::get().writes(2 as Weight))212 }214 }215 // Storage: Common CollectionById (r:1 w:0)217 // Storage: Common CollectionById (r:1 w:0)216 // Storage: Nonfungible TokenData (r:5 w:0)218 // Storage: Nonfungible TokenData (r:5 w:0)217 // Storage: Nonfungible TokenProperties (r:1 w:1)219 // Storage: Nonfungible TokenProperties (r:1 w:1)218 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)220 // Storage: Nonfungible TokenAuxProperties (r:2 w:2)219 fn add_composable_resource() -> Weight {221 fn add_composable_resource() -> Weight {220 (61_778_000 as Weight)222 (67_593_000 as Weight)221 .saturating_add(T::DbWeight::get().reads(10 as Weight))223 .saturating_add(T::DbWeight::get().reads(11 as Weight))222 .saturating_add(T::DbWeight::get().writes(2 as Weight))224 .saturating_add(T::DbWeight::get().writes(3 as Weight))223 }225 }224 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)226 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)225 // Storage: Common CollectionProperties (r:1 w:0)227 // Storage: Common CollectionProperties (r:1 w:0)228 // Storage: Nonfungible TokenProperties (r:1 w:1)230 // Storage: Nonfungible TokenProperties (r:1 w:1)229 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)231 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)230 fn add_slot_resource() -> Weight {232 fn add_slot_resource() -> Weight {231 (62_700_000 as Weight)233 (63_845_000 as Weight)232 .saturating_add(T::DbWeight::get().reads(10 as Weight))234 .saturating_add(T::DbWeight::get().reads(10 as Weight))233 .saturating_add(T::DbWeight::get().writes(2 as Weight))235 .saturating_add(T::DbWeight::get().writes(2 as Weight))234 }236 }238 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)240 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)239 // Storage: Nonfungible TokenData (r:5 w:0)241 // Storage: Nonfungible TokenData (r:5 w:0)240 fn remove_resource() -> Weight {242 fn remove_resource() -> Weight {241 (52_920_000 as Weight)243 (53_414_000 as Weight)242 .saturating_add(T::DbWeight::get().reads(9 as Weight))244 .saturating_add(T::DbWeight::get().reads(9 as Weight))243 .saturating_add(T::DbWeight::get().writes(1 as Weight))245 .saturating_add(T::DbWeight::get().writes(1 as Weight))244 }246 }248 // Storage: Nonfungible TokenData (r:5 w:0)250 // Storage: Nonfungible TokenData (r:5 w:0)249 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)251 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)250 fn accept_resource() -> Weight {252 fn accept_resource() -> Weight {251 (52_450_000 as Weight)253 (51_869_000 as Weight)252 .saturating_add(T::DbWeight::get().reads(9 as Weight))254 .saturating_add(T::DbWeight::get().reads(9 as Weight))253 .saturating_add(T::DbWeight::get().writes(1 as Weight))255 .saturating_add(T::DbWeight::get().writes(1 as Weight))254 }256 }258 // Storage: Nonfungible TokenData (r:5 w:0)260 // Storage: Nonfungible TokenData (r:5 w:0)259 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)261 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)260 fn accept_resource_removal() -> Weight {262 fn accept_resource_removal() -> Weight {261 (50_901_000 as Weight)263 (53_168_000 as Weight)262 .saturating_add(T::DbWeight::get().reads(9 as Weight))264 .saturating_add(T::DbWeight::get().reads(9 as Weight))263 .saturating_add(T::DbWeight::get().writes(1 as Weight))265 .saturating_add(T::DbWeight::get().writes(1 as Weight))264 }266 }275 // Storage: Common CollectionById (r:0 w:1)277 // Storage: Common CollectionById (r:0 w:1)276 // Storage: RmrkCore UniqueCollectionId (r:0 w:1)278 // Storage: RmrkCore UniqueCollectionId (r:0 w:1)277 fn create_collection() -> Weight {279 fn create_collection() -> Weight {278 (49_986_000 as Weight)280 (49_365_000 as Weight)279 .saturating_add(RocksDbWeight::get().reads(5 as Weight))281 .saturating_add(RocksDbWeight::get().reads(5 as Weight))280 .saturating_add(RocksDbWeight::get().writes(8 as Weight))282 .saturating_add(RocksDbWeight::get().writes(8 as Weight))281 }283 }288 // Storage: Nonfungible TokensBurnt (r:0 w:1)290 // Storage: Nonfungible TokensBurnt (r:0 w:1)289 // Storage: Common AdminAmount (r:0 w:1)291 // Storage: Common AdminAmount (r:0 w:1)290 fn destroy_collection() -> Weight {292 fn destroy_collection() -> Weight {291 (50_177_000 as Weight)293 (49_903_000 as Weight)292 .saturating_add(RocksDbWeight::get().reads(5 as Weight))294 .saturating_add(RocksDbWeight::get().reads(5 as Weight))293 .saturating_add(RocksDbWeight::get().writes(6 as Weight))295 .saturating_add(RocksDbWeight::get().writes(6 as Weight))294 }296 }295 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)297 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)296 // Storage: Common CollectionById (r:1 w:1)298 // Storage: Common CollectionById (r:1 w:1)297 // Storage: Common CollectionProperties (r:1 w:0)299 // Storage: Common CollectionProperties (r:1 w:0)298 fn change_collection_issuer() -> Weight {300 fn change_collection_issuer() -> Weight {299 (25_949_000 as Weight)301 (26_134_000 as Weight)300 .saturating_add(RocksDbWeight::get().reads(3 as Weight))302 .saturating_add(RocksDbWeight::get().reads(3 as Weight))301 .saturating_add(RocksDbWeight::get().writes(1 as Weight))303 .saturating_add(RocksDbWeight::get().writes(1 as Weight))302 }304 }306 // Storage: Nonfungible TokensMinted (r:1 w:0)308 // Storage: Nonfungible TokensMinted (r:1 w:0)307 // Storage: Nonfungible TokensBurnt (r:1 w:0)309 // Storage: Nonfungible TokensBurnt (r:1 w:0)308 fn lock_collection() -> Weight {310 fn lock_collection() -> Weight {309 (27_183_000 as Weight)311 (28_020_000 as Weight)310 .saturating_add(RocksDbWeight::get().reads(5 as Weight))312 .saturating_add(RocksDbWeight::get().reads(5 as Weight))311 .saturating_add(RocksDbWeight::get().writes(1 as Weight))313 .saturating_add(RocksDbWeight::get().writes(1 as Weight))312 }314 }320 // Storage: Nonfungible Owned (r:0 w:1)322 // Storage: Nonfungible Owned (r:0 w:1)321 // Storage: Nonfungible TokenAuxProperties (r:2 w:2)323 // Storage: Nonfungible TokenAuxProperties (r:2 w:2)322 fn mint_nft(b: u32, ) -> Weight {324 fn mint_nft(b: u32, ) -> Weight {323 (65_512_000 as Weight)325 (67_476_000 as Weight)324 // Standard Error: 12_000326 // Standard Error: 19_000325 .saturating_add((11_525_000 as Weight).saturating_mul(b as Weight))327 .saturating_add((12_373_000 as Weight).saturating_mul(b as Weight))326 .saturating_add(RocksDbWeight::get().reads(6 as Weight))328 .saturating_add(RocksDbWeight::get().reads(6 as Weight))327 .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))329 .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))328 .saturating_add(RocksDbWeight::get().writes(5 as Weight))330 .saturating_add(RocksDbWeight::get().writes(5 as Weight))340 // Storage: Nonfungible TokenProperties (r:0 w:1)342 // Storage: Nonfungible TokenProperties (r:0 w:1)341 fn burn_nft(b: u32, ) -> Weight {343 fn burn_nft(b: u32, ) -> Weight {342 (0 as Weight)344 (0 as Weight)343 // Standard Error: 1_472_000345 // Standard Error: 1_500_000344 .saturating_add((296_221_000 as Weight).saturating_mul(b as Weight))346 .saturating_add((300_520_000 as Weight).saturating_mul(b as Weight))345 .saturating_add(RocksDbWeight::get().reads(9 as Weight))347 .saturating_add(RocksDbWeight::get().reads(9 as Weight))346 .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(b as Weight)))348 .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(b as Weight)))347 .saturating_add(RocksDbWeight::get().writes(6 as Weight))349 .saturating_add(RocksDbWeight::get().writes(6 as Weight))357 // Storage: Nonfungible TokenChildren (r:0 w:1)359 // Storage: Nonfungible TokenChildren (r:0 w:1)358 // Storage: Nonfungible Owned (r:0 w:2)360 // Storage: Nonfungible Owned (r:0 w:2)359 fn send() -> Weight {361 fn send() -> Weight {360 (82_778_000 as Weight)362 (84_023_000 as Weight)361 .saturating_add(RocksDbWeight::get().reads(12 as Weight))363 .saturating_add(RocksDbWeight::get().reads(12 as Weight))362 .saturating_add(RocksDbWeight::get().writes(6 as Weight))364 .saturating_add(RocksDbWeight::get().writes(6 as Weight))363 }365 }368 // Storage: Nonfungible AccountBalance (r:2 w:2)370 // Storage: Nonfungible AccountBalance (r:2 w:2)369 // Storage: Nonfungible Allowance (r:1 w:0)371 // Storage: Nonfungible Allowance (r:1 w:0)370 // Storage: Nonfungible TokenProperties (r:1 w:1)372 // Storage: Nonfungible TokenProperties (r:1 w:1)373 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)371 // Storage: Nonfungible TokenChildren (r:0 w:1)374 // Storage: Nonfungible TokenChildren (r:0 w:1)372 // Storage: Nonfungible Owned (r:0 w:2)375 // Storage: Nonfungible Owned (r:0 w:2)373 fn accept_nft() -> Weight {376 fn accept_nft() -> Weight {374 (90_190_000 as Weight)377 (98_502_000 as Weight)375 .saturating_add(RocksDbWeight::get().reads(15 as Weight))378 .saturating_add(RocksDbWeight::get().reads(16 as Weight))376 .saturating_add(RocksDbWeight::get().writes(7 as Weight))379 .saturating_add(RocksDbWeight::get().writes(8 as Weight))377 }380 }378 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)381 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)379 // Storage: Common CollectionProperties (r:1 w:0)382 // Storage: Common CollectionProperties (r:1 w:0)380 // Storage: Common CollectionById (r:1 w:0)383 // Storage: Common CollectionById (r:1 w:0)381 // Storage: Nonfungible TokenData (r:5 w:5)384 // Storage: Nonfungible TokenData (r:5 w:5)382 // Storage: Nonfungible TokenProperties (r:1 w:5)385 // Storage: Nonfungible TokenProperties (r:1 w:5)386 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)383 // Storage: Nonfungible TokenChildren (r:9 w:4)387 // Storage: Nonfungible TokenChildren (r:9 w:4)384 // Storage: Nonfungible TokensBurnt (r:1 w:1)388 // Storage: Nonfungible TokensBurnt (r:1 w:1)385 // Storage: Nonfungible AccountBalance (r:5 w:5)389 // Storage: Nonfungible AccountBalance (r:5 w:5)386 // Storage: Nonfungible Allowance (r:5 w:0)390 // Storage: Nonfungible Allowance (r:5 w:0)387 // Storage: Nonfungible Owned (r:0 w:5)391 // Storage: Nonfungible Owned (r:0 w:5)388 fn reject_nft() -> Weight {392 fn reject_nft() -> Weight {389 (262_238_000 as Weight)393 (277_017_000 as Weight)390 .saturating_add(RocksDbWeight::get().reads(29 as Weight))394 .saturating_add(RocksDbWeight::get().reads(30 as Weight))391 .saturating_add(RocksDbWeight::get().writes(25 as Weight))395 .saturating_add(RocksDbWeight::get().writes(26 as Weight))392 }396 }393 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)397 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)394 // Storage: Common CollectionProperties (r:1 w:0)398 // Storage: Common CollectionProperties (r:1 w:0)395 // Storage: Common CollectionById (r:1 w:0)399 // Storage: Common CollectionById (r:1 w:0)396 // Storage: Nonfungible TokenProperties (r:1 w:1)400 // Storage: Nonfungible TokenProperties (r:1 w:1)397 // Storage: Nonfungible TokenData (r:5 w:0)401 // Storage: Nonfungible TokenData (r:5 w:0)398 fn set_property() -> Weight {402 fn set_property() -> Weight {399 (55_187_000 as Weight)403 (55_408_000 as Weight)400 .saturating_add(RocksDbWeight::get().reads(9 as Weight))404 .saturating_add(RocksDbWeight::get().reads(9 as Weight))401 .saturating_add(RocksDbWeight::get().writes(1 as Weight))405 .saturating_add(RocksDbWeight::get().writes(1 as Weight))402 }406 }406 // Storage: Nonfungible TokenProperties (r:1 w:1)410 // Storage: Nonfungible TokenProperties (r:1 w:1)407 // Storage: Nonfungible TokenData (r:5 w:0)411 // Storage: Nonfungible TokenData (r:5 w:0)408 fn set_priority() -> Weight {412 fn set_priority() -> Weight {409 (54_092_000 as Weight)413 (55_063_000 as Weight)410 .saturating_add(RocksDbWeight::get().reads(9 as Weight))414 .saturating_add(RocksDbWeight::get().reads(9 as Weight))411 .saturating_add(RocksDbWeight::get().writes(1 as Weight))415 .saturating_add(RocksDbWeight::get().writes(1 as Weight))412 }416 }417 // Storage: Nonfungible TokenProperties (r:1 w:1)421 // Storage: Nonfungible TokenProperties (r:1 w:1)418 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)422 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)419 fn add_basic_resource() -> Weight {423 fn add_basic_resource() -> Weight {420 (62_551_000 as Weight)424 (64_656_000 as Weight)421 .saturating_add(RocksDbWeight::get().reads(10 as Weight))425 .saturating_add(RocksDbWeight::get().reads(10 as Weight))422 .saturating_add(RocksDbWeight::get().writes(2 as Weight))426 .saturating_add(RocksDbWeight::get().writes(2 as Weight))423 }427 }426 // Storage: Common CollectionById (r:1 w:0)430 // Storage: Common CollectionById (r:1 w:0)427 // Storage: Nonfungible TokenData (r:5 w:0)431 // Storage: Nonfungible TokenData (r:5 w:0)428 // Storage: Nonfungible TokenProperties (r:1 w:1)432 // Storage: Nonfungible TokenProperties (r:1 w:1)429 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)433 // Storage: Nonfungible TokenAuxProperties (r:2 w:2)430 fn add_composable_resource() -> Weight {434 fn add_composable_resource() -> Weight {431 (61_778_000 as Weight)435 (67_593_000 as Weight)432 .saturating_add(RocksDbWeight::get().reads(10 as Weight))436 .saturating_add(RocksDbWeight::get().reads(11 as Weight))433 .saturating_add(RocksDbWeight::get().writes(2 as Weight))437 .saturating_add(RocksDbWeight::get().writes(3 as Weight))434 }438 }435 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)439 // Storage: RmrkCore UniqueCollectionId (r:1 w:0)436 // Storage: Common CollectionProperties (r:1 w:0)440 // Storage: Common CollectionProperties (r:1 w:0)439 // Storage: Nonfungible TokenProperties (r:1 w:1)443 // Storage: Nonfungible TokenProperties (r:1 w:1)440 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)444 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)441 fn add_slot_resource() -> Weight {445 fn add_slot_resource() -> Weight {442 (62_700_000 as Weight)446 (63_845_000 as Weight)443 .saturating_add(RocksDbWeight::get().reads(10 as Weight))447 .saturating_add(RocksDbWeight::get().reads(10 as Weight))444 .saturating_add(RocksDbWeight::get().writes(2 as Weight))448 .saturating_add(RocksDbWeight::get().writes(2 as Weight))445 }449 }449 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)453 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)450 // Storage: Nonfungible TokenData (r:5 w:0)454 // Storage: Nonfungible TokenData (r:5 w:0)451 fn remove_resource() -> Weight {455 fn remove_resource() -> Weight {452 (52_920_000 as Weight)456 (53_414_000 as Weight)453 .saturating_add(RocksDbWeight::get().reads(9 as Weight))457 .saturating_add(RocksDbWeight::get().reads(9 as Weight))454 .saturating_add(RocksDbWeight::get().writes(1 as Weight))458 .saturating_add(RocksDbWeight::get().writes(1 as Weight))455 }459 }459 // Storage: Nonfungible TokenData (r:5 w:0)463 // Storage: Nonfungible TokenData (r:5 w:0)460 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)464 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)461 fn accept_resource() -> Weight {465 fn accept_resource() -> Weight {462 (52_450_000 as Weight)466 (51_869_000 as Weight)463 .saturating_add(RocksDbWeight::get().reads(9 as Weight))467 .saturating_add(RocksDbWeight::get().reads(9 as Weight))464 .saturating_add(RocksDbWeight::get().writes(1 as Weight))468 .saturating_add(RocksDbWeight::get().writes(1 as Weight))465 }469 }469 // Storage: Nonfungible TokenData (r:5 w:0)473 // Storage: Nonfungible TokenData (r:5 w:0)470 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)474 // Storage: Nonfungible TokenAuxProperties (r:1 w:1)471 fn accept_resource_removal() -> Weight {475 fn accept_resource_removal() -> Weight {472 (50_901_000 as Weight)476 (53_168_000 as Weight)473 .saturating_add(RocksDbWeight::get().reads(9 as Weight))477 .saturating_add(RocksDbWeight::get().reads(9 as Weight))474 .saturating_add(RocksDbWeight::get().writes(1 as Weight))478 .saturating_add(RocksDbWeight::get().writes(1 as Weight))475 }479 }pallets/proxy-rmrk-equip/src/weights.rsdiffbeforeafterboth3//! Autogenerated weights for pallet_proxy_rmrk_equip3//! Autogenerated weights for pallet_proxy_rmrk_equip4//!4//!5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev6//! DATE: 2022-06-21, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`6//! DATE: 2022-07-01, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`7//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 10247//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024889// Executed Command:9// Executed Command:54 // Storage: Nonfungible TokenData (r:0 w:1)54 // Storage: Nonfungible TokenData (r:0 w:1)55 // Storage: Nonfungible Owned (r:0 w:1)55 // Storage: Nonfungible Owned (r:0 w:1)56 fn create_base(b: u32, ) -> Weight {56 fn create_base(b: u32, ) -> Weight {57 (62_832_000 as Weight)57 (57_871_000 as Weight)58 // Standard Error: 22_00058 // Standard Error: 21_00059 .saturating_add((20_106_000 as Weight).saturating_mul(b as Weight))59 .saturating_add((19_870_000 as Weight).saturating_mul(b as Weight))60 .saturating_add(T::DbWeight::get().reads(6 as Weight))60 .saturating_add(T::DbWeight::get().reads(6 as Weight))61 .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(b as Weight)))61 .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(b as Weight)))62 .saturating_add(T::DbWeight::get().writes(8 as Weight))62 .saturating_add(T::DbWeight::get().writes(8 as Weight))71 // Storage: Nonfungible TokenData (r:0 w:1)71 // Storage: Nonfungible TokenData (r:0 w:1)72 // Storage: Nonfungible Owned (r:0 w:1)72 // Storage: Nonfungible Owned (r:0 w:1)73 fn theme_add(b: u32, ) -> Weight {73 fn theme_add(b: u32, ) -> Weight {74 (46_793_000 as Weight)74 (46_121_000 as Weight)75 // Standard Error: 61_00075 // Standard Error: 31_00076 .saturating_add((3_061_000 as Weight).saturating_mul(b as Weight))76 .saturating_add((2_988_000 as Weight).saturating_mul(b as Weight))77 .saturating_add(T::DbWeight::get().reads(6 as Weight))77 .saturating_add(T::DbWeight::get().reads(6 as Weight))78 .saturating_add(T::DbWeight::get().writes(5 as Weight))78 .saturating_add(T::DbWeight::get().writes(5 as Weight))79 }79 }82 // Storage: RmrkEquip InernalPartId (r:1 w:0)82 // Storage: RmrkEquip InernalPartId (r:1 w:0)83 // Storage: Nonfungible TokenProperties (r:1 w:1)83 // Storage: Nonfungible TokenProperties (r:1 w:1)84 fn equippable() -> Weight {84 fn equippable() -> Weight {85 (32_495_000 as Weight)85 (32_032_000 as Weight)86 .saturating_add(T::DbWeight::get().reads(4 as Weight))86 .saturating_add(T::DbWeight::get().reads(4 as Weight))87 .saturating_add(T::DbWeight::get().writes(1 as Weight))87 .saturating_add(T::DbWeight::get().writes(1 as Weight))88 }88 }103 // Storage: Nonfungible TokenData (r:0 w:1)103 // Storage: Nonfungible TokenData (r:0 w:1)104 // Storage: Nonfungible Owned (r:0 w:1)104 // Storage: Nonfungible Owned (r:0 w:1)105 fn create_base(b: u32, ) -> Weight {105 fn create_base(b: u32, ) -> Weight {106 (62_832_000 as Weight)106 (57_871_000 as Weight)107 // Standard Error: 22_000107 // Standard Error: 21_000108 .saturating_add((20_106_000 as Weight).saturating_mul(b as Weight))108 .saturating_add((19_870_000 as Weight).saturating_mul(b as Weight))109 .saturating_add(RocksDbWeight::get().reads(6 as Weight))109 .saturating_add(RocksDbWeight::get().reads(6 as Weight))110 .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(b as Weight)))110 .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(b as Weight)))111 .saturating_add(RocksDbWeight::get().writes(8 as Weight))111 .saturating_add(RocksDbWeight::get().writes(8 as Weight))120 // Storage: Nonfungible TokenData (r:0 w:1)120 // Storage: Nonfungible TokenData (r:0 w:1)121 // Storage: Nonfungible Owned (r:0 w:1)121 // Storage: Nonfungible Owned (r:0 w:1)122 fn theme_add(b: u32, ) -> Weight {122 fn theme_add(b: u32, ) -> Weight {123 (46_793_000 as Weight)123 (46_121_000 as Weight)124 // Standard Error: 61_000124 // Standard Error: 31_000125 .saturating_add((3_061_000 as Weight).saturating_mul(b as Weight))125 .saturating_add((2_988_000 as Weight).saturating_mul(b as Weight))126 .saturating_add(RocksDbWeight::get().reads(6 as Weight))126 .saturating_add(RocksDbWeight::get().reads(6 as Weight))127 .saturating_add(RocksDbWeight::get().writes(5 as Weight))127 .saturating_add(RocksDbWeight::get().writes(5 as Weight))128 }128 }131 // Storage: RmrkEquip InernalPartId (r:1 w:0)131 // Storage: RmrkEquip InernalPartId (r:1 w:0)132 // Storage: Nonfungible TokenProperties (r:1 w:1)132 // Storage: Nonfungible TokenProperties (r:1 w:1)133 fn equippable() -> Weight {133 fn equippable() -> Weight {134 (32_495_000 as Weight)134 (32_032_000 as Weight)135 .saturating_add(RocksDbWeight::get().reads(4 as Weight))135 .saturating_add(RocksDbWeight::get().reads(4 as Weight))136 .saturating_add(RocksDbWeight::get().writes(1 as Weight))136 .saturating_add(RocksDbWeight::get().writes(1 as Weight))137 }137 }runtime/quartz/src/lib.rsdiffbeforeafterboth924 type Event = Event;924 type Event = Event;925 type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;925 type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;926 type CommonWeightInfo = CommonWeights<Self>;926 type CommonWeightInfo = CommonWeights<Self>;927 type RefungibleExtensionsWeightInfo = CommonWeights<Self>;927}928}928929929parameter_types! {930parameter_types! {runtime/unique/src/lib.rsdiffbeforeafterboth913 type Event = Event;913 type Event = Event;914 type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;914 type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;915 type CommonWeightInfo = CommonWeights<Self>;915 type CommonWeightInfo = CommonWeights<Self>;916 type RefungibleExtensionsWeightInfo = CommonWeights<Self>;916}917}917918918parameter_types! {919parameter_types! {tests/package.jsondiffbeforeafterboth60 "testAddToContractAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/addToContractAllowList.test.ts",60 "testAddToContractAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/addToContractAllowList.test.ts",61 "testTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/transfer.test.ts",61 "testTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/transfer.test.ts",62 "testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts",62 "testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts",63 "testAdminTransferAndBurn": "mocha --timeout 9999999 -r ts-node/register ./**/adminTransferAndBurn.test.ts",63 "testSetMintPermission": "mocha --timeout 9999999 -r ts-node/register ./**/setMintPermission.test.ts",64 "testSetMintPermission": "mocha --timeout 9999999 -r ts-node/register ./**/setMintPermission.test.ts",64 "testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts",65 "testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts",65 "testContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/contractSponsoring.test.ts",66 "testContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/contractSponsoring.test.ts",tests/src/adminTransferAndBurn.test.tsdiffbeforeafterbothno changes
tests/src/burnItem.test.tsdiffbeforeafterboth155 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);155 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);156156157 await usingApi(async (api) => {157 await usingApi(async (api) => {158 const tx = api.tx.unique.burnItem(collectionId, tokenId, 1);158 const tx = api.tx.unique.burnFrom(collectionId, {Substrate: alice.address}, tokenId, 1);159 const events = await submitTransactionAsync(bob, tx);159 const events = await submitTransactionAsync(bob, tx);160 const result = getGenericResult(events);160 const result = getGenericResult(events);161161tests/src/interfaces/augment-api-events.tsdiffbeforeafterboth13 /**13 /**14 * A balance was set by root.14 * A balance was set by root.15 **/15 **/16 BalanceSet: AugmentedEvent<ApiType, [who: AccountId32, free: u128, reserved: u128], { who: AccountId32, free: u128, reserved: u128 }>;16 BalanceSet: AugmentedEvent<ApiType, [AccountId32, u128, u128]>;17 /**17 /**18 * Some amount was deposited (e.g. for transaction fees).18 * Some amount was deposited (e.g. for transaction fees).19 **/19 **/20 Deposit: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;20 Deposit: AugmentedEvent<ApiType, [AccountId32, u128]>;21 /**21 /**22 * An account was removed whose balance was non-zero but below ExistentialDeposit,22 * An account was removed whose balance was non-zero but below ExistentialDeposit,23 * resulting in an outright loss.23 * resulting in an outright loss.24 **/24 **/25 DustLost: AugmentedEvent<ApiType, [account: AccountId32, amount: u128], { account: AccountId32, amount: u128 }>;25 DustLost: AugmentedEvent<ApiType, [AccountId32, u128]>;26 /**26 /**27 * An account was created with some free balance.27 * An account was created with some free balance.28 **/28 **/29 Endowed: AugmentedEvent<ApiType, [account: AccountId32, freeBalance: u128], { account: AccountId32, freeBalance: u128 }>;29 Endowed: AugmentedEvent<ApiType, [AccountId32, u128]>;30 /**30 /**31 * Some balance was reserved (moved from free to reserved).31 * Some balance was reserved (moved from free to reserved).32 **/32 **/33 Reserved: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;33 Reserved: AugmentedEvent<ApiType, [AccountId32, u128]>;34 /**34 /**35 * Some balance was moved from the reserve of the first account to the second account.35 * Some balance was moved from the reserve of the first account to the second account.36 * Final argument indicates the destination balance type.36 * Final argument indicates the destination balance type.37 **/37 **/38 ReserveRepatriated: AugmentedEvent<ApiType, [from: AccountId32, to: AccountId32, amount: u128, destinationStatus: FrameSupportTokensMiscBalanceStatus], { from: AccountId32, to: AccountId32, amount: u128, destinationStatus: FrameSupportTokensMiscBalanceStatus }>;38 ReserveRepatriated: AugmentedEvent<ApiType, [AccountId32, AccountId32, u128, FrameSupportTokensMiscBalanceStatus]>;39 /**39 /**40 * Some amount was removed from the account (e.g. for misbehavior).40 * Some amount was removed from the account (e.g. for misbehavior).41 **/41 **/42 Slashed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;42 Slashed: AugmentedEvent<ApiType, [AccountId32, u128]>;43 /**43 /**44 * Transfer succeeded.44 * Transfer succeeded.45 **/45 **/46 Transfer: AugmentedEvent<ApiType, [from: AccountId32, to: AccountId32, amount: u128], { from: AccountId32, to: AccountId32, amount: u128 }>;46 Transfer: AugmentedEvent<ApiType, [AccountId32, AccountId32, u128]>;47 /**47 /**48 * Some balance was unreserved (moved from reserved to free).48 * Some balance was unreserved (moved from reserved to free).49 **/49 **/50 Unreserved: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;50 Unreserved: AugmentedEvent<ApiType, [AccountId32, u128]>;51 /**51 /**52 * Some amount was withdrawn from the account (e.g. for transaction fees).52 * Some amount was withdrawn from the account (e.g. for transaction fees).53 **/53 **/54 Withdraw: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;54 Withdraw: AugmentedEvent<ApiType, [AccountId32, u128]>;55 /**55 /**56 * Generic event56 * Generic event57 **/57 **/167 /**167 /**168 * Downward message executed with the given outcome.168 * Downward message executed with the given outcome.169 **/169 **/170 ExecutedDownward: AugmentedEvent<ApiType, [messageId: U8aFixed, outcome: XcmV2TraitsOutcome], { messageId: U8aFixed, outcome: XcmV2TraitsOutcome }>;170 ExecutedDownward: AugmentedEvent<ApiType, [U8aFixed, XcmV2TraitsOutcome]>;171 /**171 /**172 * Downward message is invalid XCM.172 * Downward message is invalid XCM.173 **/173 **/174 InvalidFormat: AugmentedEvent<ApiType, [messageId: U8aFixed], { messageId: U8aFixed }>;174 InvalidFormat: AugmentedEvent<ApiType, [U8aFixed]>;175 /**175 /**176 * Downward message is overweight and was placed in the overweight queue.176 * Downward message is overweight and was placed in the overweight queue.177 **/177 **/178 OverweightEnqueued: AugmentedEvent<ApiType, [messageId: U8aFixed, overweightIndex: u64, requiredWeight: u64], { messageId: U8aFixed, overweightIndex: u64, requiredWeight: u64 }>;178 OverweightEnqueued: AugmentedEvent<ApiType, [U8aFixed, u64, u64]>;179 /**179 /**180 * Downward message from the overweight queue was executed.180 * Downward message from the overweight queue was executed.181 **/181 **/182 OverweightServiced: AugmentedEvent<ApiType, [overweightIndex: u64, weightUsed: u64], { overweightIndex: u64, weightUsed: u64 }>;182 OverweightServiced: AugmentedEvent<ApiType, [u64, u64]>;183 /**183 /**184 * Downward message is unsupported version of XCM.184 * Downward message is unsupported version of XCM.185 **/185 **/186 UnsupportedVersion: AugmentedEvent<ApiType, [messageId: U8aFixed], { messageId: U8aFixed }>;186 UnsupportedVersion: AugmentedEvent<ApiType, [U8aFixed]>;187 /**187 /**188 * The weight limit for handling downward messages was reached.188 * The weight limit for handling downward messages was reached.189 **/189 **/190 WeightExhausted: AugmentedEvent<ApiType, [messageId: U8aFixed, remainingWeight: u64, requiredWeight: u64], { messageId: U8aFixed, remainingWeight: u64, requiredWeight: u64 }>;190 WeightExhausted: AugmentedEvent<ApiType, [U8aFixed, u64, u64]>;191 /**191 /**192 * Generic event192 * Generic event193 **/193 **/241 /**241 /**242 * Downward messages were processed using the given weight.242 * Downward messages were processed using the given weight.243 **/243 **/244 DownwardMessagesProcessed: AugmentedEvent<ApiType, [weightUsed: u64, dmqHead: H256], { weightUsed: u64, dmqHead: H256 }>;244 DownwardMessagesProcessed: AugmentedEvent<ApiType, [u64, H256]>;245 /**245 /**246 * Some downward messages have been received and will be processed.246 * Some downward messages have been received and will be processed.247 **/247 **/248 DownwardMessagesReceived: AugmentedEvent<ApiType, [count: u32], { count: u32 }>;248 DownwardMessagesReceived: AugmentedEvent<ApiType, [u32]>;249 /**249 /**250 * An upgrade has been authorized.250 * An upgrade has been authorized.251 **/251 **/252 UpgradeAuthorized: AugmentedEvent<ApiType, [codeHash: H256], { codeHash: H256 }>;252 UpgradeAuthorized: AugmentedEvent<ApiType, [H256]>;253 /**253 /**254 * The validation function was applied as of the contained relay chain block number.254 * The validation function was applied as of the contained relay chain block number.255 **/255 **/256 ValidationFunctionApplied: AugmentedEvent<ApiType, [relayChainBlockNum: u32], { relayChainBlockNum: u32 }>;256 ValidationFunctionApplied: AugmentedEvent<ApiType, [u32]>;257 /**257 /**258 * The relay-chain aborted the upgrade process.258 * The relay-chain aborted the upgrade process.259 **/259 **/390 [key: string]: AugmentedEvent<ApiType>;390 [key: string]: AugmentedEvent<ApiType>;391 };391 };392 rmrkCore: {392 rmrkCore: {393 CollectionCreated: AugmentedEvent<ApiType, [issuer: AccountId32, collectionId: u32], { issuer: AccountId32, collectionId: u32 }>;393 CollectionCreated: AugmentedEvent<ApiType, [AccountId32, u32]>;394 CollectionDestroyed: AugmentedEvent<ApiType, [issuer: AccountId32, collectionId: u32], { issuer: AccountId32, collectionId: u32 }>;394 CollectionDestroyed: AugmentedEvent<ApiType, [AccountId32, u32]>;395 CollectionLocked: AugmentedEvent<ApiType, [issuer: AccountId32, collectionId: u32], { issuer: AccountId32, collectionId: u32 }>;395 CollectionLocked: AugmentedEvent<ApiType, [AccountId32, u32]>;396 IssuerChanged: AugmentedEvent<ApiType, [oldIssuer: AccountId32, newIssuer: AccountId32, collectionId: u32], { oldIssuer: AccountId32, newIssuer: AccountId32, collectionId: u32 }>;396 IssuerChanged: AugmentedEvent<ApiType, [AccountId32, AccountId32, u32]>;397 NFTAccepted: AugmentedEvent<ApiType, [sender: AccountId32, recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple, collectionId: u32, nftId: u32], { sender: AccountId32, recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple, collectionId: u32, nftId: u32 }>;397 NFTAccepted: AugmentedEvent<ApiType, [AccountId32, RmrkTraitsNftAccountIdOrCollectionNftTuple, u32, u32]>;398 NFTBurned: AugmentedEvent<ApiType, [owner: AccountId32, nftId: u32], { owner: AccountId32, nftId: u32 }>;398 NFTBurned: AugmentedEvent<ApiType, [AccountId32, u32]>;399 NftMinted: AugmentedEvent<ApiType, [owner: AccountId32, collectionId: u32, nftId: u32], { owner: AccountId32, collectionId: u32, nftId: u32 }>;399 NftMinted: AugmentedEvent<ApiType, [AccountId32, u32, u32]>;400 NFTRejected: AugmentedEvent<ApiType, [sender: AccountId32, collectionId: u32, nftId: u32], { sender: AccountId32, collectionId: u32, nftId: u32 }>;400 NFTRejected: AugmentedEvent<ApiType, [AccountId32, u32, u32]>;401 NFTSent: AugmentedEvent<ApiType, [sender: AccountId32, recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple, collectionId: u32, nftId: u32, approvalRequired: bool], { sender: AccountId32, recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple, collectionId: u32, nftId: u32, approvalRequired: bool }>;401 NFTSent: AugmentedEvent<ApiType, [AccountId32, RmrkTraitsNftAccountIdOrCollectionNftTuple, u32, u32, bool]>;402 PrioritySet: AugmentedEvent<ApiType, [collectionId: u32, nftId: u32], { collectionId: u32, nftId: u32 }>;402 PrioritySet: AugmentedEvent<ApiType, [u32, u32]>;403 PropertySet: AugmentedEvent<ApiType, [collectionId: u32, maybeNftId: Option<u32>, key: Bytes, value: Bytes], { collectionId: u32, maybeNftId: Option<u32>, key: Bytes, value: Bytes }>;403 PropertySet: AugmentedEvent<ApiType, [u32, Option<u32>, Bytes, Bytes]>;404 ResourceAccepted: AugmentedEvent<ApiType, [nftId: u32, resourceId: u32], { nftId: u32, resourceId: u32 }>;404 ResourceAccepted: AugmentedEvent<ApiType, [u32, u32]>;405 ResourceAdded: AugmentedEvent<ApiType, [nftId: u32, resourceId: u32], { nftId: u32, resourceId: u32 }>;405 ResourceAdded: AugmentedEvent<ApiType, [u32, u32]>;406 ResourceRemoval: AugmentedEvent<ApiType, [nftId: u32, resourceId: u32], { nftId: u32, resourceId: u32 }>;406 ResourceRemoval: AugmentedEvent<ApiType, [u32, u32]>;407 ResourceRemovalAccepted: AugmentedEvent<ApiType, [nftId: u32, resourceId: u32], { nftId: u32, resourceId: u32 }>;407 ResourceRemovalAccepted: AugmentedEvent<ApiType, [u32, u32]>;408 /**408 /**409 * Generic event409 * Generic event410 **/410 **/411 [key: string]: AugmentedEvent<ApiType>;411 [key: string]: AugmentedEvent<ApiType>;412 };412 };413 rmrkEquip: {413 rmrkEquip: {414 BaseCreated: AugmentedEvent<ApiType, [issuer: AccountId32, baseId: u32], { issuer: AccountId32, baseId: u32 }>;414 BaseCreated: AugmentedEvent<ApiType, [AccountId32, u32]>;415 EquippablesUpdated: AugmentedEvent<ApiType, [baseId: u32, slotId: u32], { baseId: u32, slotId: u32 }>;415 EquippablesUpdated: AugmentedEvent<ApiType, [u32, u32]>;416 /**416 /**417 * Generic event417 * Generic event418 **/418 **/422 /**422 /**423 * The call for the provided hash was not found so the task has been aborted.423 * The call for the provided hash was not found so the task has been aborted.424 **/424 **/425 CallLookupFailed: AugmentedEvent<ApiType, [task: ITuple<[u32, u32]>, id: Option<U8aFixed>, error: FrameSupportScheduleLookupError], { task: ITuple<[u32, u32]>, id: Option<U8aFixed>, error: FrameSupportScheduleLookupError }>;425 CallLookupFailed: AugmentedEvent<ApiType, [ITuple<[u32, u32]>, Option<U8aFixed>, FrameSupportScheduleLookupError]>;426 /**426 /**427 * Canceled some task.427 * Canceled some task.428 **/428 **/429 Canceled: AugmentedEvent<ApiType, [when: u32, index: u32], { when: u32, index: u32 }>;429 Canceled: AugmentedEvent<ApiType, [u32, u32]>;430 /**430 /**431 * Dispatched some task.431 * Dispatched some task.432 **/432 **/433 Dispatched: AugmentedEvent<ApiType, [task: ITuple<[u32, u32]>, id: Option<U8aFixed>, result: Result<Null, SpRuntimeDispatchError>], { task: ITuple<[u32, u32]>, id: Option<U8aFixed>, result: Result<Null, SpRuntimeDispatchError> }>;433 Dispatched: AugmentedEvent<ApiType, [ITuple<[u32, u32]>, Option<U8aFixed>, Result<Null, SpRuntimeDispatchError>]>;434 /**434 /**435 * Scheduled some task.435 * Scheduled some task.436 **/436 **/437 Scheduled: AugmentedEvent<ApiType, [when: u32, index: u32], { when: u32, index: u32 }>;437 Scheduled: AugmentedEvent<ApiType, [u32, u32]>;438 /**438 /**439 * Generic event439 * Generic event440 **/440 **/454 /**454 /**455 * The \[sudoer\] just switched identity; the old key is supplied if one existed.455 * The \[sudoer\] just switched identity; the old key is supplied if one existed.456 **/456 **/457 KeyChanged: AugmentedEvent<ApiType, [oldSudoer: Option<AccountId32>], { oldSudoer: Option<AccountId32> }>;457 KeyChanged: AugmentedEvent<ApiType, [Option<AccountId32>]>;458 /**458 /**459 * A sudo just took place. \[result\]459 * A sudo just took place. \[result\]460 **/460 **/461 Sudid: AugmentedEvent<ApiType, [sudoResult: Result<Null, SpRuntimeDispatchError>], { sudoResult: Result<Null, SpRuntimeDispatchError> }>;461 Sudid: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>;462 /**462 /**463 * A sudo just took place. \[result\]463 * A sudo just took place. \[result\]464 **/464 **/465 SudoAsDone: AugmentedEvent<ApiType, [sudoResult: Result<Null, SpRuntimeDispatchError>], { sudoResult: Result<Null, SpRuntimeDispatchError> }>;465 SudoAsDone: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>;466 /**466 /**467 * Generic event467 * Generic event468 **/468 **/476 /**476 /**477 * An extrinsic failed.477 * An extrinsic failed.478 **/478 **/479 ExtrinsicFailed: AugmentedEvent<ApiType, [dispatchError: SpRuntimeDispatchError, dispatchInfo: FrameSupportWeightsDispatchInfo], { dispatchError: SpRuntimeDispatchError, dispatchInfo: FrameSupportWeightsDispatchInfo }>;479 ExtrinsicFailed: AugmentedEvent<ApiType, [SpRuntimeDispatchError, FrameSupportWeightsDispatchInfo]>;480 /**480 /**481 * An extrinsic completed successfully.481 * An extrinsic completed successfully.482 **/482 **/483 ExtrinsicSuccess: AugmentedEvent<ApiType, [dispatchInfo: FrameSupportWeightsDispatchInfo], { dispatchInfo: FrameSupportWeightsDispatchInfo }>;483 ExtrinsicSuccess: AugmentedEvent<ApiType, [FrameSupportWeightsDispatchInfo]>;484 /**484 /**485 * An account was reaped.485 * An account was reaped.486 **/486 **/487 KilledAccount: AugmentedEvent<ApiType, [account: AccountId32], { account: AccountId32 }>;487 KilledAccount: AugmentedEvent<ApiType, [AccountId32]>;488 /**488 /**489 * A new account was created.489 * A new account was created.490 **/490 **/491 NewAccount: AugmentedEvent<ApiType, [account: AccountId32], { account: AccountId32 }>;491 NewAccount: AugmentedEvent<ApiType, [AccountId32]>;492 /**492 /**493 * On on-chain remark happened.493 * On on-chain remark happened.494 **/494 **/495 Remarked: AugmentedEvent<ApiType, [sender: AccountId32, hash_: H256], { sender: AccountId32, hash_: H256 }>;495 Remarked: AugmentedEvent<ApiType, [AccountId32, H256]>;496 /**496 /**497 * Generic event497 * Generic event498 **/498 **/502 /**502 /**503 * Some funds have been allocated.503 * Some funds have been allocated.504 **/504 **/505 Awarded: AugmentedEvent<ApiType, [proposalIndex: u32, award: u128, account: AccountId32], { proposalIndex: u32, award: u128, account: AccountId32 }>;505 Awarded: AugmentedEvent<ApiType, [u32, u128, AccountId32]>;506 /**506 /**507 * Some of our funds have been burnt.507 * Some of our funds have been burnt.508 **/508 **/509 Burnt: AugmentedEvent<ApiType, [burntFunds: u128], { burntFunds: u128 }>;509 Burnt: AugmentedEvent<ApiType, [u128]>;510 /**510 /**511 * Some funds have been deposited.511 * Some funds have been deposited.512 **/512 **/513 Deposit: AugmentedEvent<ApiType, [value: u128], { value: u128 }>;513 Deposit: AugmentedEvent<ApiType, [u128]>;514 /**514 /**515 * New proposal.515 * New proposal.516 **/516 **/517 Proposed: AugmentedEvent<ApiType, [proposalIndex: u32], { proposalIndex: u32 }>;517 Proposed: AugmentedEvent<ApiType, [u32]>;518 /**518 /**519 * A proposal was rejected; funds were slashed.519 * A proposal was rejected; funds were slashed.520 **/520 **/521 Rejected: AugmentedEvent<ApiType, [proposalIndex: u32, slashed: u128], { proposalIndex: u32, slashed: u128 }>;521 Rejected: AugmentedEvent<ApiType, [u32, u128]>;522 /**522 /**523 * Spending has finished; this is the amount that rolls over until next spend.523 * Spending has finished; this is the amount that rolls over until next spend.524 **/524 **/525 Rollover: AugmentedEvent<ApiType, [rolloverBalance: u128], { rolloverBalance: u128 }>;525 Rollover: AugmentedEvent<ApiType, [u128]>;526 /**526 /**527 * We have ended a spend period and will now allocate funds.527 * We have ended a spend period and will now allocate funds.528 **/528 **/529 Spending: AugmentedEvent<ApiType, [budgetRemaining: u128], { budgetRemaining: u128 }>;529 Spending: AugmentedEvent<ApiType, [u128]>;530 /**530 /**531 * Generic event531 * Generic event532 **/532 **/629 /**629 /**630 * Claimed vesting.630 * Claimed vesting.631 **/631 **/632 Claimed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;632 Claimed: AugmentedEvent<ApiType, [AccountId32, u128]>;633 /**633 /**634 * Added new vesting schedule.634 * Added new vesting schedule.635 **/635 **/636 VestingScheduleAdded: AugmentedEvent<ApiType, [from: AccountId32, to: AccountId32, vestingSchedule: OrmlVestingVestingSchedule], { from: AccountId32, to: AccountId32, vestingSchedule: OrmlVestingVestingSchedule }>;636 VestingScheduleAdded: AugmentedEvent<ApiType, [AccountId32, AccountId32, OrmlVestingVestingSchedule]>;637 /**637 /**638 * Updated vesting schedules.638 * Updated vesting schedules.639 **/639 **/640 VestingSchedulesUpdated: AugmentedEvent<ApiType, [who: AccountId32], { who: AccountId32 }>;640 VestingSchedulesUpdated: AugmentedEvent<ApiType, [AccountId32]>;641 /**641 /**642 * Generic event642 * Generic event643 **/643 **/tests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth906 createMultipleItemsEx: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, data: UpDataStructsCreateItemExData | { NFT: any } | { Fungible: any } | { RefungibleMultipleItems: any } | { RefungibleMultipleOwners: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsCreateItemExData]>;906 createMultipleItemsEx: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, data: UpDataStructsCreateItemExData | { NFT: any } | { Fungible: any } | { RefungibleMultipleItems: any } | { RefungibleMultipleOwners: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsCreateItemExData]>;907 deleteCollectionProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, propertyKeys: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<Bytes>]>;907 deleteCollectionProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, propertyKeys: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<Bytes>]>;908 deleteTokenProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, u32, Vec<Bytes>]>;908 deleteTokenProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, u32, Vec<Bytes>]>;909 /**909 /**910 * **DANGEROUS**: Destroys collection and all NFTs within this collection. Users irrecoverably lose their assets and may lose real money.910 * Destroys collection if no tokens within this collection911 * 911 * 912 * # Permissions912 * # Permissions913 * 913 * 914 * * Collection Owner.914 * * Collection Owner.915 * 915 * 916 * # Arguments916 * # Arguments917 * 917 * 918 * * collection_id: collection to destroy.918 * * collection_id: collection to destroy.919 **/919 **/920 destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;920 destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;921 /**921 /**922 * Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin.922 * Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin.tests/src/nesting/graphs.test.tsdiffbeforeafterboth36 await usingApi(async (api, privateKeyWrapper) => {36 await usingApi(async (api, privateKeyWrapper) => {37 const alice = privateKeyWrapper('//Alice');37 const alice = privateKeyWrapper('//Alice');38 const collection = await buildComplexObjectGraph(api, alice);38 const collection = await buildComplexObjectGraph(api, alice);39 await setCollectionLimitsExpectSuccess(alice, collection, {ownerCanTransfer: true});39 const tokenTwoParent = tokenIdToCross(collection, 1);404041 // to self41 // to self42 await expect(42 await expect(49 'second transaction',49 'second transaction',50 ).to.be.rejectedWith(/structure\.OuroborosDetected/);50 ).to.be.rejectedWith(/structure\.OuroborosDetected/);51 await expect(51 await expect(52 executeTransaction(api, alice, api.tx.unique.transfer(tokenIdToCross(collection, 8), collection, 2, 1)),52 executeTransaction(api, alice, api.tx.unique.transferFrom(tokenTwoParent, tokenIdToCross(collection, 8), collection, 2, 1)),53 'third transaction',53 'third transaction',54 ).to.be.rejectedWith(/structure\.OuroborosDetected/);54 ).to.be.rejectedWith(/structure\.OuroborosDetected/);55 });55 });tests/src/nesting/nest.test.tsdiffbeforeafterboth123 ], 'Children contents check at nesting #2');123 ], 'Children contents check at nesting #2');124124125 // Move token B to a different user outside the nesting tree125 // Move token B to a different user outside the nesting tree126 await transferExpectSuccess(collectionA, tokenB, alice, bob);126 await transferFromExpectSuccess(collectionA, tokenB, alice, targetAddress, bob);127 children = await getTokenChildren(api, collectionA, targetToken);127 children = await getTokenChildren(api, collectionA, targetToken);128 expect(children.length).to.be.equal(1, 'Children length check at unnesting');128 expect(children.length).to.be.equal(1, 'Children length check at unnesting');129 expect(children).to.be.have.deep.members([129 expect(children).to.be.have.deep.members([470 await expect(executeTransaction(470 await expect(executeTransaction(471 api, 471 api, 472 alice, 472 alice, 473 api.tx.unique.transfer(targetAddress, collection, newToken, 1),473 api.tx.unique.transferFrom(targetAddress, {Substrate: bob.address}, collection, newToken, 1),474 ), 'while nesting another\'s token token').to.be.rejectedWith(/common\.AddressNotInAllowlist/);474 ), 'while nesting another\'s token token').to.be.rejectedWith(/common\.AddressNotInAllowlist/);475 expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address});475 expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address});476476tests/src/rmrk/acceptNft.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/addResource.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/addTheme.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/burnNft.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/changeCollectionIssuer.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/createBase.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/createCollection.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/deleteCollection.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/equipNft.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/getOwnedNfts.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/lockCollection.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/mintNft.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/rejectNft.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/removeResource.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/rmrk.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/rmrkIsolation.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/sendNft.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/setCollectionProperty.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/setEquippableList.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/setNftProperty.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/setResourcePriorities.test.tsdiffbeforeafterbothno changes
tests/src/rmrk/util/fetch.tsdiffbeforeafterbothno changes
tests/src/rmrk/util/helpers.tsdiffbeforeafterbothno changes
tests/src/rmrk/util/tx.tsdiffbeforeafterbothno changes
tests/src/substrate/substrate-api.tsdiffbeforeafterboth59 };59 };60}60}6162export async function getApiConnection(settings: ApiOptions | undefined = undefined): Promise<ApiPromise> {63 settings = settings || defaultApiOptions();64 const api = new ApiPromise(settings);6566 if (api) {67 await api.isReadyOrError;68 }6970 return api;71}617262export default async function usingApi<T = void>(action: (api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair) => Promise<T>, settings: ApiOptions | undefined = undefined): Promise<T> {73export default async function usingApi<T = void>(action: (api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair) => Promise<T>, settings: ApiOptions | undefined = undefined): Promise<T> {63 settings = settings || defaultApiOptions();74 settings = settings || defaultApiOptions();tests/src/util/helpers.tsdiffbeforeafterboth830 });830 });831}831}832833export async function burnItemExpectFailure(sender: IKeyringPair, collectionId: number, tokenId: number, value: number | bigint = 1) {834 await usingApi(async (api) => {835 const tx = api.tx.unique.burnItem(collectionId, tokenId, value);836837 const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;838 const result = getCreateCollectionResult(events);839 // tslint:disable-next-line:no-unused-expression840 expect(result.success).to.be.false;841 });842}843844export async function burnFromExpectSuccess(sender: IKeyringPair, from: IKeyringPair | CrossAccountId, collectionId: number, tokenId: number, value: number | bigint = 1) {845 await usingApi(async (api) => {846 const tx = api.tx.unique.burnFrom(collectionId, normalizeAccountId(from), tokenId, value);847 const events = await submitTransactionAsync(sender, tx);848 return getGenericResult(events).success;849 });850}832851833export async function852export async function834approve(853approve(1005 expectedBlockNumber, 1024 expectedBlockNumber, 1006 repetitions > 1 ? [period, repetitions] : null, 1025 repetitions > 1 ? [period, repetitions] : null, 1007 0, 1026 0, 1008 {value: operationTx as any},1027 {Value: operationTx as any},1009 );1028 );101010291011 const events = await submitTransactionAsync(sender, scheduleTx);1030 const events = await submitTransactionAsync(sender, scheduleTx);1032 expectedBlockNumber, 1051 expectedBlockNumber, 1033 repetitions <= 1 ? null : [period, repetitions], 1052 repetitions <= 1 ? null : [period, repetitions], 1034 0, 1053 0, 1035 {value: operationTx as any},1054 {Value: operationTx as any},1036 );1055 );103710561038 //const events = 1057 //const events = 136113801362 let tx;1381 let tx;1363 if (createMode === 'NFT') {1382 if (createMode === 'NFT') {1364 const data = api.createType('UpDataStructsCreateItemData', {NFT: {properties: props}});1383 const data = api.createType('UpDataStructsCreateItemData', {NFT: {properties: props}}) as UpDataStructsCreateItemData;1365 tx = api.tx.unique.createItem(collectionId, normalizeAccountId(owner), data);1384 tx = api.tx.unique.createItem(collectionId, normalizeAccountId(owner), data);1366 } else {1385 } else {1367 tx = api.tx.unique.createItem(collectionId, normalizeAccountId(owner), createMode);1386 tx = api.tx.unique.createItem(collectionId, normalizeAccountId(owner), createMode);