difftreelog
CORE-410 Restor tests
in: master
6 files changed
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth1// Auto-generated via `yarn polkadot-types-from-chain`, do not edit2/* eslint-disable */34import type { ApiTypes } from '@polkadot/api-base/types';5import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';6import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';7import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';8import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsTokenChild } from '@polkadot/types/lookup';9import type { Observable } from '@polkadot/types/types';1011declare module '@polkadot/api-base/types/storage' {12 export interface AugmentedQueries<ApiType extends ApiTypes> {13 balances: {14 /**15 * The Balances pallet example of storing the balance of an account.16 * 17 * # Example18 * 19 * ```nocompile20 * impl pallet_balances::Config for Runtime {21 * type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>>22 * }23 * ```24 * 25 * You can also store the balance of an account in the `System` pallet.26 * 27 * # Example28 * 29 * ```nocompile30 * impl pallet_balances::Config for Runtime {31 * type AccountStore = System32 * }33 * ```34 * 35 * But this comes with tradeoffs, storing account balances in the system pallet stores36 * `frame_system` data alongside the account data contrary to storing account balances in the37 * `Balances` pallet, which uses a `StorageMap` to store balances data only.38 * NOTE: This is only used in the case that this pallet is used to store balances.39 **/40 account: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletBalancesAccountData>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;41 /**42 * Any liquidity locks on some account balances.43 * NOTE: Should only be accessed when setting, changing and freeing a lock.44 **/45 locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<PalletBalancesBalanceLock>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;46 /**47 * Named reserves on some account balances.48 **/49 reserves: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<PalletBalancesReserveData>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;50 /**51 * Storage version of the pallet.52 * 53 * This is set to v2.0.0 for new networks.54 **/55 storageVersion: AugmentedQuery<ApiType, () => Observable<PalletBalancesReleases>, []> & QueryableStorageEntry<ApiType, []>;56 /**57 * The total units issued in the system.58 **/59 totalIssuance: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;60 /**61 * Generic query62 **/63 [key: string]: QueryableStorageEntry<ApiType>;64 };65 charging: {66 /**67 * Generic query68 **/69 [key: string]: QueryableStorageEntry<ApiType>;70 };71 common: {72 adminAmount: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;73 /**74 * Allowlisted collection users75 **/76 allowlist: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;77 /**78 * Collection info79 **/80 collectionById: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<UpDataStructsCollection>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;81 /**82 * Collection properties83 **/84 collectionProperties: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;85 collectionPropertyPermissions: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<BTreeMap<Bytes, UpDataStructsPropertyPermission>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;86 createdCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;87 destroyedCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;88 /**89 * Not used by code, exists only to provide some types to metadata90 **/91 dummyStorageValue: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[UpDataStructsCollectionStats, u32, u32, UpDataStructsTokenChild, PhantomTypeUpDataStructs]>>>, []> & QueryableStorageEntry<ApiType, []>;92 /**93 * List of collection admins94 **/95 isAdmin: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;96 /**97 * Generic query98 **/99 [key: string]: QueryableStorageEntry<ApiType>;100 };101 dmpQueue: {102 /**103 * The configuration.104 **/105 configuration: AugmentedQuery<ApiType, () => Observable<CumulusPalletDmpQueueConfigData>, []> & QueryableStorageEntry<ApiType, []>;106 /**107 * The overweight messages.108 **/109 overweight: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[u32, Bytes]>>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;110 /**111 * The page index.112 **/113 pageIndex: AugmentedQuery<ApiType, () => Observable<CumulusPalletDmpQueuePageIndexData>, []> & QueryableStorageEntry<ApiType, []>;114 /**115 * The queue pages.116 **/117 pages: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[u32, Bytes]>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;118 /**119 * Generic query120 **/121 [key: string]: QueryableStorageEntry<ApiType>;122 };123 ethereum: {124 blockHash: AugmentedQuery<ApiType, (arg: U256 | AnyNumber | Uint8Array) => Observable<H256>, [U256]> & QueryableStorageEntry<ApiType, [U256]>;125 /**126 * The current Ethereum block.127 **/128 currentBlock: AugmentedQuery<ApiType, () => Observable<Option<EthereumBlock>>, []> & QueryableStorageEntry<ApiType, []>;129 /**130 * The current Ethereum receipts.131 **/132 currentReceipts: AugmentedQuery<ApiType, () => Observable<Option<Vec<EthereumReceiptReceiptV3>>>, []> & QueryableStorageEntry<ApiType, []>;133 /**134 * The current transaction statuses.135 **/136 currentTransactionStatuses: AugmentedQuery<ApiType, () => Observable<Option<Vec<FpRpcTransactionStatus>>>, []> & QueryableStorageEntry<ApiType, []>;137 /**138 * Injected transactions should have unique nonce, here we store current139 **/140 injectedNonce: AugmentedQuery<ApiType, () => Observable<U256>, []> & QueryableStorageEntry<ApiType, []>;141 /**142 * Current building block's transactions and receipts.143 **/144 pending: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[EthereumTransactionTransactionV2, FpRpcTransactionStatus, EthereumReceiptReceiptV3]>>>, []> & QueryableStorageEntry<ApiType, []>;145 /**146 * Generic query147 **/148 [key: string]: QueryableStorageEntry<ApiType>;149 };150 evm: {151 accountCodes: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<Bytes>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;152 accountStorages: AugmentedQuery<ApiType, (arg1: H160 | string | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<H256>, [H160, H256]> & QueryableStorageEntry<ApiType, [H160, H256]>;153 /**154 * Written on log, reset after transaction155 * Should be empty between transactions156 **/157 currentLogs: AugmentedQuery<ApiType, () => Observable<Vec<EthereumLog>>, []> & QueryableStorageEntry<ApiType, []>;158 /**159 * Generic query160 **/161 [key: string]: QueryableStorageEntry<ApiType>;162 };163 evmCoderSubstrate: {164 /**165 * Generic query166 **/167 [key: string]: QueryableStorageEntry<ApiType>;168 };169 evmContractHelpers: {170 allowlist: AugmentedQuery<ApiType, (arg1: H160 | string | Uint8Array, arg2: H160 | string | Uint8Array) => Observable<bool>, [H160, H160]> & QueryableStorageEntry<ApiType, [H160, H160]>;171 allowlistEnabled: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<bool>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;172 owner: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<H160>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;173 selfSponsoring: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<bool>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;174 sponsorBasket: AugmentedQuery<ApiType, (arg1: H160 | string | Uint8Array, arg2: H160 | string | Uint8Array) => Observable<Option<u32>>, [H160, H160]> & QueryableStorageEntry<ApiType, [H160, H160]>;175 sponsoringMode: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<Option<PalletEvmContractHelpersSponsoringModeT>>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;176 sponsoringRateLimit: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<u32>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;177 /**178 * Generic query179 **/180 [key: string]: QueryableStorageEntry<ApiType>;181 };182 evmMigration: {183 migrationPending: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<bool>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;184 /**185 * Generic query186 **/187 [key: string]: QueryableStorageEntry<ApiType>;188 };189 fungible: {190 allowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u128>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]>;191 balance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u128>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;192 totalSupply: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;193 /**194 * Generic query195 **/196 [key: string]: QueryableStorageEntry<ApiType>;197 };198 inflation: {199 /**200 * Current inflation for `InflationBlockInterval` number of blocks201 **/202 blockInflation: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;203 /**204 * Next target (relay) block when inflation will be applied205 **/206 nextInflationBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;207 /**208 * Next target (relay) block when inflation is recalculated209 **/210 nextRecalculationBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;211 /**212 * Relay block when inflation has started213 **/214 startBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;215 /**216 * starting year total issuance217 **/218 startingYearTotalIssuance: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;219 /**220 * Generic query221 **/222 [key: string]: QueryableStorageEntry<ApiType>;223 };224 nonfungible: {225 accountBalance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u32>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;226 allowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;227 /**228 * Used to enumerate tokens owned by account229 **/230 owned: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: u32 | AnyNumber | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]>;231 tokenAuxProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: UpDataStructsPropertyScope | 'None' | 'Rmrk' | number | Uint8Array, arg4: Bytes | string | Uint8Array) => Observable<Option<Bytes>>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry<ApiType, [u32, u32, UpDataStructsPropertyScope, Bytes]>;232 /**233 * Used to enumerate token's children234 **/235 tokenChildren: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array]) => Observable<bool>, [u32, u32, ITuple<[u32, u32]>]> & QueryableStorageEntry<ApiType, [u32, u32, ITuple<[u32, u32]>]>;236 tokenData: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNonfungibleItemData>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;237 tokenProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;238 tokensBurnt: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;239 tokensMinted: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;240 /**241 * Generic query242 **/243 [key: string]: QueryableStorageEntry<ApiType>;244 };245 parachainInfo: {246 parachainId: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;247 /**248 * Generic query249 **/250 [key: string]: QueryableStorageEntry<ApiType>;251 };252 parachainSystem: {253 /**254 * The number of HRMP messages we observed in `on_initialize` and thus used that number for255 * announcing the weight of `on_initialize` and `on_finalize`.256 **/257 announcedHrmpMessagesPerCandidate: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;258 /**259 * The next authorized upgrade, if there is one.260 **/261 authorizedUpgrade: AugmentedQuery<ApiType, () => Observable<Option<H256>>, []> & QueryableStorageEntry<ApiType, []>;262 /**263 * A custom head data that should be returned as result of `validate_block`.264 * 265 * See [`Pallet::set_custom_validation_head_data`] for more information.266 **/267 customValidationHeadData: AugmentedQuery<ApiType, () => Observable<Option<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;268 /**269 * Were the validation data set to notify the relay chain?270 **/271 didSetValidationCode: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;272 /**273 * The parachain host configuration that was obtained from the relay parent.274 * 275 * This field is meant to be updated each block with the validation data inherent. Therefore,276 * before processing of the inherent, e.g. in `on_initialize` this data may be stale.277 * 278 * This data is also absent from the genesis.279 **/280 hostConfiguration: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2AbridgedHostConfiguration>>, []> & QueryableStorageEntry<ApiType, []>;281 /**282 * HRMP messages that were sent in a block.283 * 284 * This will be cleared in `on_initialize` of each new block.285 **/286 hrmpOutboundMessages: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotCorePrimitivesOutboundHrmpMessage>>, []> & QueryableStorageEntry<ApiType, []>;287 /**288 * HRMP watermark that was set in a block.289 * 290 * This will be cleared in `on_initialize` of each new block.291 **/292 hrmpWatermark: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;293 /**294 * The last downward message queue chain head we have observed.295 * 296 * This value is loaded before and saved after processing inbound downward messages carried297 * by the system inherent.298 **/299 lastDmqMqcHead: AugmentedQuery<ApiType, () => Observable<H256>, []> & QueryableStorageEntry<ApiType, []>;300 /**301 * The message queue chain heads we have observed per each channel incoming channel.302 * 303 * This value is loaded before and saved after processing inbound downward messages carried304 * by the system inherent.305 **/306 lastHrmpMqcHeads: AugmentedQuery<ApiType, () => Observable<BTreeMap<u32, H256>>, []> & QueryableStorageEntry<ApiType, []>;307 /**308 * Validation code that is set by the parachain and is to be communicated to collator and309 * consequently the relay-chain.310 * 311 * This will be cleared in `on_initialize` of each new block if no other pallet already set312 * the value.313 **/314 newValidationCode: AugmentedQuery<ApiType, () => Observable<Option<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;315 /**316 * Upward messages that are still pending and not yet send to the relay chain.317 **/318 pendingUpwardMessages: AugmentedQuery<ApiType, () => Observable<Vec<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;319 /**320 * In case of a scheduled upgrade, this storage field contains the validation code to be applied.321 * 322 * As soon as the relay chain gives us the go-ahead signal, we will overwrite the [`:code`][well_known_keys::CODE]323 * which will result the next block process with the new validation code. This concludes the upgrade process.324 * 325 * [well_known_keys::CODE]: sp_core::storage::well_known_keys::CODE326 **/327 pendingValidationCode: AugmentedQuery<ApiType, () => Observable<Bytes>, []> & QueryableStorageEntry<ApiType, []>;328 /**329 * Number of downward messages processed in a block.330 * 331 * This will be cleared in `on_initialize` of each new block.332 **/333 processedDownwardMessages: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;334 /**335 * The state proof for the last relay parent block.336 * 337 * This field is meant to be updated each block with the validation data inherent. Therefore,338 * before processing of the inherent, e.g. in `on_initialize` this data may be stale.339 * 340 * This data is also absent from the genesis.341 **/342 relayStateProof: AugmentedQuery<ApiType, () => Observable<Option<SpTrieStorageProof>>, []> & QueryableStorageEntry<ApiType, []>;343 /**344 * The snapshot of some state related to messaging relevant to the current parachain as per345 * the relay parent.346 * 347 * This field is meant to be updated each block with the validation data inherent. Therefore,348 * before processing of the inherent, e.g. in `on_initialize` this data may be stale.349 * 350 * This data is also absent from the genesis.351 **/352 relevantMessagingState: AugmentedQuery<ApiType, () => Observable<Option<CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot>>, []> & QueryableStorageEntry<ApiType, []>;353 /**354 * The weight we reserve at the beginning of the block for processing DMP messages. This355 * overrides the amount set in the Config trait.356 **/357 reservedDmpWeightOverride: AugmentedQuery<ApiType, () => Observable<Option<u64>>, []> & QueryableStorageEntry<ApiType, []>;358 /**359 * The weight we reserve at the beginning of the block for processing XCMP messages. This360 * overrides the amount set in the Config trait.361 **/362 reservedXcmpWeightOverride: AugmentedQuery<ApiType, () => Observable<Option<u64>>, []> & QueryableStorageEntry<ApiType, []>;363 /**364 * An option which indicates if the relay-chain restricts signalling a validation code upgrade.365 * In other words, if this is `Some` and [`NewValidationCode`] is `Some` then the produced366 * candidate will be invalid.367 * 368 * This storage item is a mirror of the corresponding value for the current parachain from the369 * relay-chain. This value is ephemeral which means it doesn't hit the storage. This value is370 * set after the inherent.371 **/372 upgradeRestrictionSignal: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2UpgradeRestriction>>, []> & QueryableStorageEntry<ApiType, []>;373 /**374 * Upward messages that were sent in a block.375 * 376 * This will be cleared in `on_initialize` of each new block.377 **/378 upwardMessages: AugmentedQuery<ApiType, () => Observable<Vec<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;379 /**380 * The [`PersistedValidationData`] set for this block.381 * This value is expected to be set only once per block and it's never stored382 * in the trie.383 **/384 validationData: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2PersistedValidationData>>, []> & QueryableStorageEntry<ApiType, []>;385 /**386 * Generic query387 **/388 [key: string]: QueryableStorageEntry<ApiType>;389 };390 randomnessCollectiveFlip: {391 /**392 * Series of block headers from the last 81 blocks that acts as random seed material. This393 * is arranged as a ring buffer with `block_number % 81` being the index into the `Vec` of394 * the oldest hash.395 **/396 randomMaterial: AugmentedQuery<ApiType, () => Observable<Vec<H256>>, []> & QueryableStorageEntry<ApiType, []>;397 /**398 * Generic query399 **/400 [key: string]: QueryableStorageEntry<ApiType>;401 };402 refungible: {403 accountBalance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u32>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;404 allowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg4: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u128>, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]>;405 balance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u128>, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]>;406 /**407 * Used to enumerate tokens owned by account408 **/409 owned: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: u32 | AnyNumber | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]>;410 tokenData: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<PalletRefungibleItemData>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;411 tokensBurnt: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;412 tokensMinted: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;413 totalSupply: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;414 /**415 * Generic query416 **/417 [key: string]: QueryableStorageEntry<ApiType>;418 };419 rmrkCore: {420 collectionIndex: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;421 uniqueCollectionId: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;422 /**423 * Generic query424 **/425 [key: string]: QueryableStorageEntry<ApiType>;426 };427 rmrkEquip: {428 baseHasDefaultTheme: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<bool>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;429 inernalPartId: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;430 /**431 * Generic query432 **/433 [key: string]: QueryableStorageEntry<ApiType>;434 };435 scheduler: {436 /**437 * Items to be executed, indexed by the block number that they should be executed on.438 **/439 agenda: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<Option<PalletUniqueSchedulerScheduledV3>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;440 /**441 * Lookup from identity to the block number and index of the task.442 **/443 lookup: AugmentedQuery<ApiType, (arg: U8aFixed | string | Uint8Array) => Observable<Option<ITuple<[u32, u32]>>>, [U8aFixed]> & QueryableStorageEntry<ApiType, [U8aFixed]>;444 /**445 * Generic query446 **/447 [key: string]: QueryableStorageEntry<ApiType>;448 };449 structure: {450 /**451 * Generic query452 **/453 [key: string]: QueryableStorageEntry<ApiType>;454 };455 sudo: {456 /**457 * The `AccountId` of the sudo key.458 **/459 key: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;460 /**461 * Generic query462 **/463 [key: string]: QueryableStorageEntry<ApiType>;464 };465 system: {466 /**467 * The full account information for a particular account ID.468 **/469 account: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<FrameSystemAccountInfo>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;470 /**471 * Total length (in bytes) for all extrinsics put together, for the current block.472 **/473 allExtrinsicsLen: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;474 /**475 * Map of block numbers to block hashes.476 **/477 blockHash: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<H256>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;478 /**479 * The current weight for the block.480 **/481 blockWeight: AugmentedQuery<ApiType, () => Observable<FrameSupportWeightsPerDispatchClassU64>, []> & QueryableStorageEntry<ApiType, []>;482 /**483 * Digest of the current block, also part of the block header.484 **/485 digest: AugmentedQuery<ApiType, () => Observable<SpRuntimeDigest>, []> & QueryableStorageEntry<ApiType, []>;486 /**487 * The number of events in the `Events<T>` list.488 **/489 eventCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;490 /**491 * Events deposited for the current block.492 * 493 * NOTE: The item is unbound and should therefore never be read on chain.494 * It could otherwise inflate the PoV size of a block.495 * 496 * Events have a large in-memory size. Box the events to not go out-of-memory497 * just in case someone still reads them from within the runtime.498 **/499 events: AugmentedQuery<ApiType, () => Observable<Vec<FrameSystemEventRecord>>, []> & QueryableStorageEntry<ApiType, []>;500 /**501 * Mapping between a topic (represented by T::Hash) and a vector of indexes502 * of events in the `<Events<T>>` list.503 * 504 * All topic vectors have deterministic storage locations depending on the topic. This505 * allows light-clients to leverage the changes trie storage tracking mechanism and506 * in case of changes fetch the list of events of interest.507 * 508 * The value has the type `(T::BlockNumber, EventIndex)` because if we used only just509 * the `EventIndex` then in case if the topic has the same contents on the next block510 * no notification will be triggered thus the event might be lost.511 **/512 eventTopics: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Vec<ITuple<[u32, u32]>>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;513 /**514 * The execution phase of the block.515 **/516 executionPhase: AugmentedQuery<ApiType, () => Observable<Option<FrameSystemPhase>>, []> & QueryableStorageEntry<ApiType, []>;517 /**518 * Total extrinsics count for the current block.519 **/520 extrinsicCount: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;521 /**522 * Extrinsics data for the current block (maps an extrinsic's index to its data).523 **/524 extrinsicData: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Bytes>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;525 /**526 * Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened.527 **/528 lastRuntimeUpgrade: AugmentedQuery<ApiType, () => Observable<Option<FrameSystemLastRuntimeUpgradeInfo>>, []> & QueryableStorageEntry<ApiType, []>;529 /**530 * The current block number being processed. Set by `execute_block`.531 **/532 number: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;533 /**534 * Hash of the previous block.535 **/536 parentHash: AugmentedQuery<ApiType, () => Observable<H256>, []> & QueryableStorageEntry<ApiType, []>;537 /**538 * True if we have upgraded so that AccountInfo contains three types of `RefCount`. False539 * (default) if not.540 **/541 upgradedToTripleRefCount: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;542 /**543 * True if we have upgraded so that `type RefCount` is `u32`. False (default) if not.544 **/545 upgradedToU32RefCount: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;546 /**547 * Generic query548 **/549 [key: string]: QueryableStorageEntry<ApiType>;550 };551 timestamp: {552 /**553 * Did the timestamp get updated in this block?554 **/555 didUpdate: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;556 /**557 * Current time for the current block.558 **/559 now: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;560 /**561 * Generic query562 **/563 [key: string]: QueryableStorageEntry<ApiType>;564 };565 transactionPayment: {566 nextFeeMultiplier: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;567 storageVersion: AugmentedQuery<ApiType, () => Observable<PalletTransactionPaymentReleases>, []> & QueryableStorageEntry<ApiType, []>;568 /**569 * Generic query570 **/571 [key: string]: QueryableStorageEntry<ApiType>;572 };573 treasury: {574 /**575 * Proposal indices that have been approved but not yet awarded.576 **/577 approvals: AugmentedQuery<ApiType, () => Observable<Vec<u32>>, []> & QueryableStorageEntry<ApiType, []>;578 /**579 * Number of proposals that have been made.580 **/581 proposalCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;582 /**583 * Proposals that have been made.584 **/585 proposals: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletTreasuryProposal>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;586 /**587 * Generic query588 **/589 [key: string]: QueryableStorageEntry<ApiType>;590 };591 unique: {592 /**593 * Used for migrations594 **/595 chainVersion: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;596 /**597 * (Collection id (controlled?2), who created (real))598 * TODO: Off chain worker should remove from this map when collection gets removed599 **/600 createItemBasket: AugmentedQuery<ApiType, (arg: ITuple<[u32, AccountId32]> | [u32 | AnyNumber | Uint8Array, AccountId32 | string | Uint8Array]) => Observable<Option<u32>>, [ITuple<[u32, AccountId32]>]> & QueryableStorageEntry<ApiType, [ITuple<[u32, AccountId32]>]>;601 fungibleApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;602 /**603 * Collection id (controlled?2), owning user (real)604 **/605 fungibleTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;606 /**607 * Approval sponsoring608 **/609 nftApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;610 /**611 * Collection id (controlled?2), token id (controlled?2)612 **/613 nftTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;614 refungibleApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, u32, AccountId32]>;615 /**616 * Collection id (controlled?2), token id (controlled?2)617 **/618 reFungibleTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, u32, AccountId32]>;619 tokenPropertyBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;620 /**621 * Variable metadata sponsoring622 * Collection id (controlled?2), token id (controlled?2)623 **/624 variableMetaDataBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;625 /**626 * Generic query627 **/628 [key: string]: QueryableStorageEntry<ApiType>;629 };630 vesting: {631 /**632 * Vesting schedules of an account.633 * 634 * VestingSchedules: map AccountId => Vec<VestingSchedule>635 **/636 vestingSchedules: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<OrmlVestingVestingSchedule>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;637 /**638 * Generic query639 **/640 [key: string]: QueryableStorageEntry<ApiType>;641 };642 xcmpQueue: {643 /**644 * Inbound aggregate XCMP messages. It can only be one per ParaId/block.645 **/646 inboundXcmpMessages: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Bytes>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;647 /**648 * Status of the inbound XCMP channels.649 **/650 inboundXcmpStatus: AugmentedQuery<ApiType, () => Observable<Vec<CumulusPalletXcmpQueueInboundChannelDetails>>, []> & QueryableStorageEntry<ApiType, []>;651 /**652 * The messages outbound in a given XCMP channel.653 **/654 outboundXcmpMessages: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u16 | AnyNumber | Uint8Array) => Observable<Bytes>, [u32, u16]> & QueryableStorageEntry<ApiType, [u32, u16]>;655 /**656 * The non-empty XCMP channels in order of becoming non-empty, and the index of the first657 * and last outbound message. If the two indices are equal, then it indicates an empty658 * queue and there must be a non-`Ok` `OutboundStatus`. We assume queues grow no greater659 * than 65535 items. Queue indices for normal messages begin at one; zero is reserved in660 * case of the need to send a high-priority signal message this block.661 * The bool is true if there is a signal message waiting to be sent.662 **/663 outboundXcmpStatus: AugmentedQuery<ApiType, () => Observable<Vec<CumulusPalletXcmpQueueOutboundChannelDetails>>, []> & QueryableStorageEntry<ApiType, []>;664 /**665 * The messages that exceeded max individual message weight budget.666 * 667 * These message stay in this storage map until they are manually dispatched via668 * `service_overweight`.669 **/670 overweight: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[u32, u32, Bytes]>>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;671 /**672 * The number of overweight messages ever recorded in `Overweight`. Also doubles as the next673 * available free overweight index.674 **/675 overweightCount: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;676 /**677 * The configuration which controls the dynamics of the outbound queue.678 **/679 queueConfig: AugmentedQuery<ApiType, () => Observable<CumulusPalletXcmpQueueQueueConfigData>, []> & QueryableStorageEntry<ApiType, []>;680 /**681 * Whether or not the XCMP queue is suspended from executing incoming XCMs or not.682 **/683 queueSuspended: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;684 /**685 * Any signal messages waiting to be sent.686 **/687 signalMessages: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Bytes>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;688 /**689 * Generic query690 **/691 [key: string]: QueryableStorageEntry<ApiType>;692 };693 } // AugmentedQueries694} // declare moduletests/src/interfaces/default/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/default/types.ts
+++ b/tests/src/interfaces/default/types.ts
@@ -2461,12 +2461,14 @@
export interface UpDataStructsCreateReFungibleData extends Struct {
readonly constData: Bytes;
readonly pieces: u128;
+ readonly properties: Vec<UpDataStructsProperty>;
}
/** @name UpDataStructsCreateRefungibleExData */
export interface UpDataStructsCreateRefungibleExData extends Struct {
readonly constData: Bytes;
readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;
+ readonly properties: Vec<UpDataStructsProperty>;
}
/** @name UpDataStructsNestingPermissions */
tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -1502,7 +1502,8 @@
**/
UpDataStructsCreateReFungibleData: {
constData: 'Bytes',
- pieces: 'u128'
+ pieces: 'u128',
+ properties: 'Vec<UpDataStructsProperty>'
},
/**
* Lookup193: up_data_structs::CreateItemExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
@@ -1527,7 +1528,8 @@
**/
UpDataStructsCreateRefungibleExData: {
constData: 'Bytes',
- users: 'BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>'
+ users: 'BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>',
+ properties: 'Vec<UpDataStructsProperty>'
},
/**
* Lookup204: pallet_unique_scheduler::pallet::Call<T>
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -1629,6 +1629,7 @@
export interface UpDataStructsCreateReFungibleData extends Struct {
readonly constData: Bytes;
readonly pieces: u128;
+ readonly properties: Vec<UpDataStructsProperty>;
}
/** @name UpDataStructsCreateItemExData (193) */
@@ -1654,6 +1655,7 @@
export interface UpDataStructsCreateRefungibleExData extends Struct {
readonly constData: Bytes;
readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;
+ readonly properties: Vec<UpDataStructsProperty>;
}
/** @name PalletUniqueSchedulerCall (204) */
tests/src/nesting/properties.test.tsdiffbeforeafterboth--- a/tests/src/nesting/properties.test.ts
+++ b/tests/src/nesting/properties.test.ts
@@ -806,123 +806,144 @@
await testDeletePropertiesAccordingPermission({type: 'ReFungible'}, 100);
});
- // it('Assigns properties to a nested token according to permissions', async () => {
- // await usingApi(async api => {
- // const propertyKeys: string[] = [];
- // let i = 0;
- // for (const permission of permissions) {
- // for (const signer of permission.signers) {
- // const key = i + '_' + signer.address;
- // propertyKeys.push(key);
+ it('Assigns properties to a nested token according to permissions', async () => {
+ await usingApi(async api => {
+ const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
+ await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});
+ const token = await createItemExpectSuccess(alice, collection, 'NFT');
+ const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, token)});
+ await addCollectionAdminExpectSuccess(alice, collection, bob.address);
+ await transferExpectSuccess(collection, token, alice, charlie);
- // await expect(executeTransaction(
- // api,
- // alice,
- // api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]),
- // ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected;
+ const propertyKeys: string[] = [];
+ let i = 0;
+ for (const permission of permissions) {
+ for (const signer of permission.signers) {
+ const key = i + '_' + signer.address;
+ propertyKeys.push(key);
- // await expect(executeTransaction(
- // api,
- // signer,
- // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]),
- // ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected;
- // }
+ await expect(executeTransaction(
+ api,
+ alice,
+ api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]),
+ ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected;
- // i++;
- // }
+ await expect(executeTransaction(
+ api,
+ signer,
+ api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]),
+ ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected;
+ }
- // const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[];
- // const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[];
- // for (let i = 0; i < properties.length; i++) {
- // expect(properties[i].value).to.be.equal('Serotonin increase');
- // expect(tokensData[i].value).to.be.equal('Serotonin increase');
- // }
- // });
- // });
+ i++;
+ }
+
+ const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[];
+ const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[];
+ for (let i = 0; i < properties.length; i++) {
+ expect(properties[i].value).to.be.equal('Serotonin increase');
+ expect(tokensData[i].value).to.be.equal('Serotonin increase');
+ }
+ });
+ });
- // it('Changes properties of a nested token according to permissions', async () => {
- // await usingApi(async api => {
- // const propertyKeys: string[] = [];
- // let i = 0;
- // for (const permission of permissions) {
- // if (!permission.permission.mutable) continue;
+ it('Changes properties of a nested token according to permissions', async () => {
+ await usingApi(async api => {
+ const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
+ await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});
+ const token = await createItemExpectSuccess(alice, collection, 'NFT');
+ const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, token)});
+ await addCollectionAdminExpectSuccess(alice, collection, bob.address);
+ await transferExpectSuccess(collection, token, alice, charlie);
+
+ const propertyKeys: string[] = [];
+ let i = 0;
+ for (const permission of permissions) {
+ if (!permission.permission.mutable) continue;
- // for (const signer of permission.signers) {
- // const key = i + '_' + signer.address;
- // propertyKeys.push(key);
+ for (const signer of permission.signers) {
+ const key = i + '_' + signer.address;
+ propertyKeys.push(key);
- // await expect(executeTransaction(
- // api,
- // alice,
- // api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]),
- // ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected;
+ await expect(executeTransaction(
+ api,
+ alice,
+ api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]),
+ ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected;
- // await expect(executeTransaction(
- // api,
- // signer,
- // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]),
- // ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected;
+ await expect(executeTransaction(
+ api,
+ signer,
+ api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]),
+ ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected;
- // await expect(executeTransaction(
- // api,
- // signer,
- // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin stable'}]),
- // ), `on changing property ${i} by ${signer.address}`).to.not.be.rejected;
- // }
+ await expect(executeTransaction(
+ api,
+ signer,
+ api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin stable'}]),
+ ), `on changing property ${i} by ${signer.address}`).to.not.be.rejected;
+ }
- // i++;
- // }
+ i++;
+ }
- // const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[];
- // const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[];
- // for (let i = 0; i < properties.length; i++) {
- // expect(properties[i].value).to.be.equal('Serotonin stable');
- // expect(tokensData[i].value).to.be.equal('Serotonin stable');
- // }
- // });
- // });
+ const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[];
+ const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[];
+ for (let i = 0; i < properties.length; i++) {
+ expect(properties[i].value).to.be.equal('Serotonin stable');
+ expect(tokensData[i].value).to.be.equal('Serotonin stable');
+ }
+ });
+ });
+
+ it('Deletes properties of a nested token according to permissions', async () => {
+ await usingApi(async api => {
+ const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
+ await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});
+ const token = await createItemExpectSuccess(alice, collection, 'NFT');
+ const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, token)});
+ await addCollectionAdminExpectSuccess(alice, collection, bob.address);
+ await transferExpectSuccess(collection, token, alice, charlie);
- // it('Deletes properties of a nested token according to permissions', async () => {
- // await usingApi(async api => {
- // const propertyKeys: string[] = [];
- // let i = 0;
+ const propertyKeys: string[] = [];
+ let i = 0;
- // for (const permission of permissions) {
- // if (!permission.permission.mutable) continue;
+ for (const permission of permissions) {
+ if (!permission.permission.mutable) continue;
- // for (const signer of permission.signers) {
- // const key = i + '_' + signer.address;
- // propertyKeys.push(key);
+ for (const signer of permission.signers) {
+ const key = i + '_' + signer.address;
+ propertyKeys.push(key);
- // await expect(executeTransaction(
- // api,
- // alice,
- // api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]),
- // ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected;
+ await expect(executeTransaction(
+ api,
+ alice,
+ api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]),
+ ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected;
- // await expect(executeTransaction(
- // api,
- // signer,
- // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]),
- // ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected;
+ await expect(executeTransaction(
+ api,
+ signer,
+ api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]),
+ ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected;
- // await expect(executeTransaction(
- // api,
- // signer,
- // api.tx.unique.deleteTokenProperties(collection, nestedToken, [key]),
- // ), `on deleting property ${i} by ${signer.address}`).to.not.be.rejected;
- // }
+ await expect(executeTransaction(
+ api,
+ signer,
+ api.tx.unique.deleteTokenProperties(collection, nestedToken, [key]),
+ ), `on deleting property ${i} by ${signer.address}`).to.not.be.rejected;
+ }
- // i++;
- // }
+ i++;
+ }
- // const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toJSON() as any[];
- // expect(properties).to.be.empty;
- // const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toJSON().properties as any[];
- // expect(tokensData).to.be.empty;
- // expect((await api.query.nonfungible.tokenProperties(collection, nestedToken)).toJSON().consumedSpace).to.be.equal(0);
- // });
- // });
+ const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toJSON() as any[];
+ expect(properties).to.be.empty;
+ const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toJSON().properties as any[];
+ expect(tokensData).to.be.empty;
+ expect((await api.query.nonfungible.tokenProperties(collection, nestedToken)).toJSON().consumedSpace).to.be.equal(0);
+ });
+ });
});
describe('Negative Integration Test: Token Properties', () => {
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -1414,7 +1414,7 @@
tx = api.tx.unique.createItem(collectionId, to, createData as any);
}
- const events = await submitTransactionAsync(sender, tx);
+ const events = await executeTransaction(api, sender, tx);
const result = getCreateItemResult(events);
const itemCountAfter = await getLastTokenId(api, collectionId);