git.delta.rocks / unique-network / refs/commits / 6bbb9b831975

difftreelog

feat(rpc) topmostTokenOwner

Yaroslav Bolyukin2022-04-08parent: #208e41d.patch.diff
in: master

15 files changed

modifiedclient/rpc/src/lib.rsdiffbeforeafterboth
48 token: TokenId,48 token: TokenId,
49 at: Option<BlockHash>,49 at: Option<BlockHash>,
50 ) -> Result<Option<CrossAccountId>>;50 ) -> Result<Option<CrossAccountId>>;
51 #[rpc(name = "unique_topmostTokenOwner")]
52 fn topmost_token_owner(
53 &self,
54 collection: CollectionId,
55 token: TokenId,
56 at: Option<BlockHash>,
57 ) -> Result<Option<CrossAccountId>>;
51 #[rpc(name = "unique_constMetadata")]58 #[rpc(name = "unique_constMetadata")]
52 fn const_metadata(59 fn const_metadata(
53 &self,60 &self,
224 token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>;231 token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>;
225 changed_in 2, token_owner_before_version_2(collection, token) => |u| Some(u)232 changed_in 2, token_owner_before_version_2(collection, token) => |u| Some(u)
226 );233 );
234 pass_method!(topmost_token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>);
227 pass_method!(const_metadata(collection: CollectionId, token: TokenId) -> Vec<u8>);235 pass_method!(const_metadata(collection: CollectionId, token: TokenId) -> Vec<u8>);
228 pass_method!(variable_metadata(collection: CollectionId, token: TokenId) -> Vec<u8>);236 pass_method!(variable_metadata(collection: CollectionId, token: TokenId) -> Vec<u8>);
229 pass_method!(collection_tokens(collection: CollectionId) -> u32);237 pass_method!(collection_tokens(collection: CollectionId) -> u32);
modifiedprimitives/rpc/src/lib.rsdiffbeforeafterboth
36 fn token_exists(collection: CollectionId, token: TokenId) -> Result<bool>;36 fn token_exists(collection: CollectionId, token: TokenId) -> Result<bool>;
3737
38 fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>>;38 fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>>;
39 fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>>;
39 fn const_metadata(collection: CollectionId, token: TokenId) -> Result<Vec<u8>>;40 fn const_metadata(collection: CollectionId, token: TokenId) -> Result<Vec<u8>>;
40 fn variable_metadata(collection: CollectionId, token: TokenId) -> Result<Vec<u8>>;41 fn variable_metadata(collection: CollectionId, token: TokenId) -> Result<Vec<u8>>;
4142
modifiedruntime/common/src/runtime_apis.rsdiffbeforeafterboth
21 fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {21 fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {
22 dispatch_unique_runtime!(collection.token_owner(token))22 dispatch_unique_runtime!(collection.token_owner(token))
23 }23 }
24 fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {
25 let budget = up_data_structs::budget::Value::new(5);
26
27 Ok(Some(<pallet_structure::Pallet<Runtime>>::find_topmost_owner(collection, token, &budget)?))
28 }
24 fn const_metadata(collection: CollectionId, token: TokenId) -> Result<Vec<u8>, DispatchError> {29 fn const_metadata(collection: CollectionId, token: TokenId) -> Result<Vec<u8>, DispatchError> {
25 dispatch_unique_runtime!(collection.const_metadata(token))30 dispatch_unique_runtime!(collection.const_metadata(token))
26 }31 }
modifiedtests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth
72 * Collection description can not be longer than 255 char.72 * Collection description can not be longer than 255 char.
73 **/73 **/
74 CollectionDescriptionLimitExceeded: AugmentedError<ApiType>;74 CollectionDescriptionLimitExceeded: AugmentedError<ApiType>;
75 /**
76 * Tried to store more data than allowed in collection field
77 **/
78 CollectionFieldSizeExceeded: AugmentedError<ApiType>;
75 /**79 /**
76 * Collection limit bounds per collection exceeded80 * Collection limit bounds per collection exceeded
77 **/81 **/
100 * Sender parameter and item owner must be equal.104 * Sender parameter and item owner must be equal.
101 **/105 **/
102 MustBeTokenOwner: AugmentedError<ApiType>;106 MustBeTokenOwner: AugmentedError<ApiType>;
107 /**
108 * Collection has nesting disabled
109 **/
110 NestingIsDisabled: AugmentedError<ApiType>;
103 /**111 /**
104 * No permission to perform action112 * No permission to perform action
105 **/113 **/
108 * Not sufficient founds to perform action116 * Not sufficient founds to perform action
109 **/117 **/
110 NotSufficientFounds: AugmentedError<ApiType>;118 NotSufficientFounds: AugmentedError<ApiType>;
119 /**
120 * Only owner may nest tokens under this collection
121 **/
122 OnlyOwnerAllowedToNest: AugmentedError<ApiType>;
111 /**123 /**
112 * Tried to enable permissions which are only permitted to be disabled124 * Tried to enable permissions which are only permitted to be disabled
113 **/125 **/
116 * Collection is not in mint mode.128 * Collection is not in mint mode.
117 **/129 **/
118 PublicMintingNotAllowed: AugmentedError<ApiType>;130 PublicMintingNotAllowed: AugmentedError<ApiType>;
131 /**
132 * Only tokens from specific collections may nest tokens under this
133 **/
134 SourceCollectionIsNotAllowedToNest: AugmentedError<ApiType>;
119 /**135 /**
120 * Item not exists.136 * Item not exists.
121 **/137 **/
236 [key: string]: AugmentedError<ApiType>;252 [key: string]: AugmentedError<ApiType>;
237 };253 };
238 fungible: {254 fungible: {
255 /**
256 * Fungible token does not support nested
257 **/
258 FungibleDisallowsNesting: AugmentedError<ApiType>;
239 /**259 /**
240 * Tried to set data for fungible item260 * Tried to set data for fungible item
241 **/261 **/
372 * Not Refungible item data used to mint in Refungible collection.392 * Not Refungible item data used to mint in Refungible collection.
373 **/393 **/
374 NotRefungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;394 NotRefungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;
395 /**
396 * Refungible token can't nest other tokens
397 **/
398 RefungibleDisallowsNesting: AugmentedError<ApiType>;
375 /**399 /**
376 * Maximum refungibility exceeded400 * Maximum refungibility exceeded
377 **/401 **/
381 **/405 **/
382 [key: string]: AugmentedError<ApiType>;406 [key: string]: AugmentedError<ApiType>;
383 };407 };
408 structure: {
409 /**
410 * While searched for owner, encountered depth limit
411 **/
412 DepthLimit: AugmentedError<ApiType>;
413 /**
414 * While searched for owner, got already checked account
415 **/
416 OuroborosDetected: AugmentedError<ApiType>;
417 /**
418 * While searched for owner, found token owner by not-yet-existing token
419 **/
420 TokenNotFound: AugmentedError<ApiType>;
421 /**
422 * Generic error
423 **/
424 [key: string]: AugmentedError<ApiType>;
425 };
384 sudo: {426 sudo: {
385 /**427 /**
386 * Sender must be the Sudo account428 * Sender must be the Sudo account
modifiedtests/src/interfaces/augment-api-events.tsdiffbeforeafterboth
391 **/391 **/
392 [key: string]: AugmentedEvent<ApiType>;392 [key: string]: AugmentedEvent<ApiType>;
393 };393 };
394 structure: {
395 /**
396 * Executed call on behalf of token
397 **/
398 Executed: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>;
399 /**
400 * Generic event
401 **/
402 [key: string]: AugmentedEvent<ApiType>;
403 };
394 sudo: {404 sudo: {
395 /**405 /**
396 * The \[sudoer\] just switched identity; the old key is supplied if one existed.406 * The \[sudoer\] just switched identity; the old key is supplied if one existed.
modifiedtests/src/interfaces/augment-api-query.tsdiffbeforeafterboth
5import type { BTreeMap, Bytes, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';5import type { BTreeMap, Bytes, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
6import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';6import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
7import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';7import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
8import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats } from '@polkadot/types/lookup';8import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1PersistedValidationData, PolkadotPrimitivesV1UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollectionField, UpDataStructsCollectionStats, UpDataStructsCollectionVersion2 } from '@polkadot/types/lookup';
9import type { Observable } from '@polkadot/types/types';9import type { Observable } from '@polkadot/types/types';
1010
11declare module '@polkadot/api-base/types/storage' {11declare module '@polkadot/api-base/types/storage' {
12 export interface AugmentedQueries<ApiType extends ApiTypes> {12 export interface AugmentedQueries<ApiType extends ApiTypes> {
13 balances: {13 balances: {
14 /**14 /**
15 * The Balances pallet example of storing the balance of an account.15 * The Balances pallet example of storing the balance of an account.
16 * 16 *
17 * # Example17 * # Example
18 * 18 *
19 * ```nocompile19 * ```nocompile
20 * impl pallet_balances::Config for Runtime {20 * impl pallet_balances::Config for Runtime {
21 * type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>>21 * type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>>
22 * }22 * }
23 * ```23 * ```
24 * 24 *
25 * You can also store the balance of an account in the `System` pallet.25 * You can also store the balance of an account in the `System` pallet.
26 * 26 *
27 * # Example27 * # Example
28 * 28 *
29 * ```nocompile29 * ```nocompile
30 * impl pallet_balances::Config for Runtime {30 * impl pallet_balances::Config for Runtime {
31 * type AccountStore = System31 * type AccountStore = System
32 * }32 * }
33 * ```33 * ```
34 * 34 *
35 * But this comes with tradeoffs, storing account balances in the system pallet stores35 * But this comes with tradeoffs, storing account balances in the system pallet stores
36 * `frame_system` data alongside the account data contrary to storing account balances in the36 * `frame_system` data alongside the account data contrary to storing account balances in the
37 * `Balances` pallet, which uses a `StorageMap` to store balances data only.37 * `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.38 * NOTE: This is only used in the case that this pallet is used to store balances.
39 **/39 **/
40 account: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletBalancesAccountData>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;40 account: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletBalancesAccountData>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
41 /**41 /**
42 * Any liquidity locks on some account balances.42 * Any liquidity locks on some account balances.
47 * Named reserves on some account balances.47 * Named reserves on some account balances.
48 **/48 **/
49 reserves: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<PalletBalancesReserveData>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;49 reserves: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<PalletBalancesReserveData>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
50 /**50 /**
51 * Storage version of the pallet.51 * Storage version of the pallet.
52 * 52 *
53 * This is set to v2.0.0 for new networks.53 * This is set to v2.0.0 for new networks.
54 **/54 **/
55 storageVersion: AugmentedQuery<ApiType, () => Observable<PalletBalancesReleases>, []> & QueryableStorageEntry<ApiType, []>;55 storageVersion: AugmentedQuery<ApiType, () => Observable<PalletBalancesReleases>, []> & QueryableStorageEntry<ApiType, []>;
56 /**56 /**
57 * The total units issued in the system.57 * The total units issued in the system.
77 /**77 /**
78 * Collection info78 * Collection info
79 **/79 **/
80 collectionById: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<UpDataStructsCollection>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;80 collectionById: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<UpDataStructsCollectionVersion2>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
81 /**
82 * Large variable-size collection fields are extracted here
83 **/
84 collectionData: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: UpDataStructsCollectionField | 'VariableOnChainSchema' | 'ConstOnChainSchema' | 'OffchainSchema' | number | Uint8Array) => Observable<Bytes>, [u32, UpDataStructsCollectionField]> & QueryableStorageEntry<ApiType, [u32, UpDataStructsCollectionField]>;
81 createdCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;85 createdCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
82 destroyedCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;86 destroyedCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
83 /**87 /**
84 * Not used by code, exists only to provide some types to metadata88 * Not used by code, exists only to provide some types to metadata
85 **/89 **/
86 dummyStorageValue: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[UpDataStructsCollectionStats, u32, u32]>>>, []> & QueryableStorageEntry<ApiType, []>;90 dummyStorageValue: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[UpDataStructsCollectionStats, u32, u32, PhantomTypeUpDataStructs]>>>, []> & QueryableStorageEntry<ApiType, []>;
87 /**91 /**
88 * List of collection admins92 * List of collection admins
89 **/93 **/
243 * The next authorized upgrade, if there is one.247 * The next authorized upgrade, if there is one.
244 **/248 **/
245 authorizedUpgrade: AugmentedQuery<ApiType, () => Observable<Option<H256>>, []> & QueryableStorageEntry<ApiType, []>;249 authorizedUpgrade: AugmentedQuery<ApiType, () => Observable<Option<H256>>, []> & QueryableStorageEntry<ApiType, []>;
246 /**250 /**
247 * A custom head data that should be returned as result of `validate_block`.251 * A custom head data that should be returned as result of `validate_block`.
248 * 252 *
249 * See [`Pallet::set_custom_validation_head_data`] for more information.253 * See [`Pallet::set_custom_validation_head_data`] for more information.
250 **/254 **/
251 customValidationHeadData: AugmentedQuery<ApiType, () => Observable<Option<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;255 customValidationHeadData: AugmentedQuery<ApiType, () => Observable<Option<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;
252 /**256 /**
253 * Were the validation data set to notify the relay chain?257 * Were the validation data set to notify the relay chain?
254 **/258 **/
255 didSetValidationCode: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;259 didSetValidationCode: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
256 /**260 /**
257 * The parachain host configuration that was obtained from the relay parent.261 * The parachain host configuration that was obtained from the relay parent.
258 * 262 *
259 * This field is meant to be updated each block with the validation data inherent. Therefore,263 * This field is meant to be updated each block with the validation data inherent. Therefore,
260 * before processing of the inherent, e.g. in `on_initialize` this data may be stale.264 * before processing of the inherent, e.g. in `on_initialize` this data may be stale.
261 * 265 *
262 * This data is also absent from the genesis.266 * This data is also absent from the genesis.
263 **/267 **/
264 hostConfiguration: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2AbridgedHostConfiguration>>, []> & QueryableStorageEntry<ApiType, []>;268 hostConfiguration: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2AbridgedHostConfiguration>>, []> & QueryableStorageEntry<ApiType, []>;
265 /**269 /**
266 * HRMP messages that were sent in a block.270 * HRMP messages that were sent in a block.
267 * 271 *
268 * This will be cleared in `on_initialize` of each new block.272 * This will be cleared in `on_initialize` of each new block.
269 **/273 **/
270 hrmpOutboundMessages: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotCorePrimitivesOutboundHrmpMessage>>, []> & QueryableStorageEntry<ApiType, []>;274 hrmpOutboundMessages: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotCorePrimitivesOutboundHrmpMessage>>, []> & QueryableStorageEntry<ApiType, []>;
271 /**275 /**
272 * HRMP watermark that was set in a block.276 * HRMP watermark that was set in a block.
273 * 277 *
274 * This will be cleared in `on_initialize` of each new block.278 * This will be cleared in `on_initialize` of each new block.
275 **/279 **/
276 hrmpWatermark: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;280 hrmpWatermark: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
277 /**281 /**
278 * The last downward message queue chain head we have observed.282 * The last downward message queue chain head we have observed.
279 * 283 *
280 * This value is loaded before and saved after processing inbound downward messages carried284 * This value is loaded before and saved after processing inbound downward messages carried
281 * by the system inherent.285 * by the system inherent.
282 **/286 **/
283 lastDmqMqcHead: AugmentedQuery<ApiType, () => Observable<H256>, []> & QueryableStorageEntry<ApiType, []>;287 lastDmqMqcHead: AugmentedQuery<ApiType, () => Observable<H256>, []> & QueryableStorageEntry<ApiType, []>;
284 /**288 /**
285 * The message queue chain heads we have observed per each channel incoming channel.289 * The message queue chain heads we have observed per each channel incoming channel.
286 * 290 *
287 * This value is loaded before and saved after processing inbound downward messages carried291 * This value is loaded before and saved after processing inbound downward messages carried
288 * by the system inherent.292 * by the system inherent.
289 **/293 **/
290 lastHrmpMqcHeads: AugmentedQuery<ApiType, () => Observable<BTreeMap<u32, H256>>, []> & QueryableStorageEntry<ApiType, []>;294 lastHrmpMqcHeads: AugmentedQuery<ApiType, () => Observable<BTreeMap<u32, H256>>, []> & QueryableStorageEntry<ApiType, []>;
291 /**295 /**
292 * Validation code that is set by the parachain and is to be communicated to collator and296 * Validation code that is set by the parachain and is to be communicated to collator and
293 * consequently the relay-chain.297 * consequently the relay-chain.
294 * 298 *
295 * This will be cleared in `on_initialize` of each new block if no other pallet already set299 * This will be cleared in `on_initialize` of each new block if no other pallet already set
296 * the value.300 * the value.
297 **/301 **/
298 newValidationCode: AugmentedQuery<ApiType, () => Observable<Option<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;302 newValidationCode: AugmentedQuery<ApiType, () => Observable<Option<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;
299 /**303 /**
300 * Upward messages that are still pending and not yet send to the relay chain.304 * Upward messages that are still pending and not yet send to the relay chain.
301 **/305 **/
302 pendingUpwardMessages: AugmentedQuery<ApiType, () => Observable<Vec<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;306 pendingUpwardMessages: AugmentedQuery<ApiType, () => Observable<Vec<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;
303 /**307 /**
304 * In case of a scheduled upgrade, this storage field contains the validation code to be applied.308 * In case of a scheduled upgrade, this storage field contains the validation code to be applied.
305 * 309 *
306 * As soon as the relay chain gives us the go-ahead signal, we will overwrite the [`:code`][well_known_keys::CODE]310 * As soon as the relay chain gives us the go-ahead signal, we will overwrite the [`:code`][well_known_keys::CODE]
307 * which will result the next block process with the new validation code. This concludes the upgrade process.311 * which will result the next block process with the new validation code. This concludes the upgrade process.
308 * 312 *
309 * [well_known_keys::CODE]: sp_core::storage::well_known_keys::CODE313 * [well_known_keys::CODE]: sp_core::storage::well_known_keys::CODE
310 **/314 **/
311 pendingValidationCode: AugmentedQuery<ApiType, () => Observable<Bytes>, []> & QueryableStorageEntry<ApiType, []>;315 pendingValidationCode: AugmentedQuery<ApiType, () => Observable<Bytes>, []> & QueryableStorageEntry<ApiType, []>;
312 /**316 /**
313 * Number of downward messages processed in a block.317 * Number of downward messages processed in a block.
314 * 318 *
315 * This will be cleared in `on_initialize` of each new block.319 * This will be cleared in `on_initialize` of each new block.
316 **/320 **/
317 processedDownwardMessages: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;321 processedDownwardMessages: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
318 /**322 /**
319 * The state proof for the last relay parent block.323 * The state proof for the last relay parent block.
320 * 324 *
321 * This field is meant to be updated each block with the validation data inherent. Therefore,325 * This field is meant to be updated each block with the validation data inherent. Therefore,
322 * before processing of the inherent, e.g. in `on_initialize` this data may be stale.326 * before processing of the inherent, e.g. in `on_initialize` this data may be stale.
323 * 327 *
324 * This data is also absent from the genesis.328 * This data is also absent from the genesis.
325 **/329 **/
326 relayStateProof: AugmentedQuery<ApiType, () => Observable<Option<SpTrieStorageProof>>, []> & QueryableStorageEntry<ApiType, []>;330 relayStateProof: AugmentedQuery<ApiType, () => Observable<Option<SpTrieStorageProof>>, []> & QueryableStorageEntry<ApiType, []>;
327 /**331 /**
328 * The snapshot of some state related to messaging relevant to the current parachain as per332 * The snapshot of some state related to messaging relevant to the current parachain as per
329 * the relay parent.333 * the relay parent.
330 * 334 *
331 * This field is meant to be updated each block with the validation data inherent. Therefore,335 * This field is meant to be updated each block with the validation data inherent. Therefore,
332 * before processing of the inherent, e.g. in `on_initialize` this data may be stale.336 * before processing of the inherent, e.g. in `on_initialize` this data may be stale.
333 * 337 *
334 * This data is also absent from the genesis.338 * This data is also absent from the genesis.
335 **/339 **/
336 relevantMessagingState: AugmentedQuery<ApiType, () => Observable<Option<CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot>>, []> & QueryableStorageEntry<ApiType, []>;340 relevantMessagingState: AugmentedQuery<ApiType, () => Observable<Option<CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot>>, []> & QueryableStorageEntry<ApiType, []>;
337 /**341 /**
338 * The weight we reserve at the beginning of the block for processing DMP messages. This342 * The weight we reserve at the beginning of the block for processing DMP messages. This
344 * overrides the amount set in the Config trait.348 * overrides the amount set in the Config trait.
345 **/349 **/
346 reservedXcmpWeightOverride: AugmentedQuery<ApiType, () => Observable<Option<u64>>, []> & QueryableStorageEntry<ApiType, []>;350 reservedXcmpWeightOverride: AugmentedQuery<ApiType, () => Observable<Option<u64>>, []> & QueryableStorageEntry<ApiType, []>;
347 /**351 /**
348 * An option which indicates if the relay-chain restricts signalling a validation code upgrade.352 * An option which indicates if the relay-chain restricts signalling a validation code upgrade.
349 * In other words, if this is `Some` and [`NewValidationCode`] is `Some` then the produced353 * In other words, if this is `Some` and [`NewValidationCode`] is `Some` then the produced
350 * candidate will be invalid.354 * candidate will be invalid.
351 * 355 *
352 * This storage item is a mirror of the corresponding value for the current parachain from the356 * This storage item is a mirror of the corresponding value for the current parachain from the
353 * relay-chain. This value is ephemeral which means it doesn't hit the storage. This value is357 * relay-chain. This value is ephemeral which means it doesn't hit the storage. This value is
354 * set after the inherent.358 * set after the inherent.
355 **/359 **/
356 upgradeRestrictionSignal: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2UpgradeRestriction>>, []> & QueryableStorageEntry<ApiType, []>;360 upgradeRestrictionSignal: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2UpgradeRestriction>>, []> & QueryableStorageEntry<ApiType, []>;
357 /**361 /**
358 * Upward messages that were sent in a block.362 * Upward messages that were sent in a block.
359 * 363 *
360 * This will be cleared in `on_initialize` of each new block.364 * This will be cleared in `on_initialize` of each new block.
361 **/365 **/
362 upwardMessages: AugmentedQuery<ApiType, () => Observable<Vec<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;366 upwardMessages: AugmentedQuery<ApiType, () => Observable<Vec<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;
363 /**367 /**
364 * The [`PersistedValidationData`] set for this block.368 * The [`PersistedValidationData`] set for this block.
400 **/404 **/
401 [key: string]: QueryableStorageEntry<ApiType>;405 [key: string]: QueryableStorageEntry<ApiType>;
402 };406 };
407 structure: {
408 /**
409 * Generic query
410 **/
411 [key: string]: QueryableStorageEntry<ApiType>;
412 };
403 sudo: {413 sudo: {
404 /**414 /**
405 * The `AccountId` of the sudo key.415 * The `AccountId` of the sudo key.
435 * The number of events in the `Events<T>` list.445 * The number of events in the `Events<T>` list.
436 **/446 **/
437 eventCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;447 eventCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
438 /**448 /**
439 * Events deposited for the current block.449 * Events deposited for the current block.
440 * 450 *
441 * NOTE: The item is unbound and should therefore never be read on chain.451 * NOTE: The item is unbound and should therefore never be read on chain.
442 * It could otherwise inflate the PoV size of a block.452 * It could otherwise inflate the PoV size of a block.
443 * 453 *
444 * Events have a large in-memory size. Box the events to not go out-of-memory454 * Events have a large in-memory size. Box the events to not go out-of-memory
445 * just in case someone still reads them from within the runtime.455 * just in case someone still reads them from within the runtime.
446 **/456 **/
447 events: AugmentedQuery<ApiType, () => Observable<Vec<FrameSystemEventRecord>>, []> & QueryableStorageEntry<ApiType, []>;457 events: AugmentedQuery<ApiType, () => Observable<Vec<FrameSystemEventRecord>>, []> & QueryableStorageEntry<ApiType, []>;
448 /**458 /**
449 * Mapping between a topic (represented by T::Hash) and a vector of indexes459 * Mapping between a topic (represented by T::Hash) and a vector of indexes
450 * of events in the `<Events<T>>` list.460 * of events in the `<Events<T>>` list.
451 * 461 *
452 * All topic vectors have deterministic storage locations depending on the topic. This462 * All topic vectors have deterministic storage locations depending on the topic. This
453 * allows light-clients to leverage the changes trie storage tracking mechanism and463 * allows light-clients to leverage the changes trie storage tracking mechanism and
454 * in case of changes fetch the list of events of interest.464 * in case of changes fetch the list of events of interest.
455 * 465 *
456 * The value has the type `(T::BlockNumber, EventIndex)` because if we used only just466 * The value has the type `(T::BlockNumber, EventIndex)` because if we used only just
457 * the `EventIndex` then in case if the topic has the same contents on the next block467 * the `EventIndex` then in case if the topic has the same contents on the next block
458 * no notification will be triggered thus the event might be lost.468 * no notification will be triggered thus the event might be lost.
459 **/469 **/
460 eventTopics: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Vec<ITuple<[u32, u32]>>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;470 eventTopics: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Vec<ITuple<[u32, u32]>>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
461 /**471 /**
462 * The execution phase of the block.472 * The execution phase of the block.
575 [key: string]: QueryableStorageEntry<ApiType>;585 [key: string]: QueryableStorageEntry<ApiType>;
576 };586 };
577 vesting: {587 vesting: {
578 /**588 /**
579 * Vesting schedules of an account.589 * Vesting schedules of an account.
580 * 590 *
581 * VestingSchedules: map AccountId => Vec<VestingSchedule>591 * VestingSchedules: map AccountId => Vec<VestingSchedule>
582 **/592 **/
583 vestingSchedules: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<OrmlVestingVestingSchedule>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;593 vestingSchedules: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<OrmlVestingVestingSchedule>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
584 /**594 /**
585 * Generic query595 * Generic query
608 * The bool is true if there is a signal message waiting to be sent.618 * The bool is true if there is a signal message waiting to be sent.
609 **/619 **/
610 outboundXcmpStatus: AugmentedQuery<ApiType, () => Observable<Vec<CumulusPalletXcmpQueueOutboundChannelDetails>>, []> & QueryableStorageEntry<ApiType, []>;620 outboundXcmpStatus: AugmentedQuery<ApiType, () => Observable<Vec<CumulusPalletXcmpQueueOutboundChannelDetails>>, []> & QueryableStorageEntry<ApiType, []>;
611 /**621 /**
612 * The messages that exceeded max individual message weight budget.622 * The messages that exceeded max individual message weight budget.
613 * 623 *
614 * These message stay in this storage map until they are manually dispatched via624 * These message stay in this storage map until they are manually dispatched via
615 * `service_overweight`.625 * `service_overweight`.
616 **/626 **/
617 overweight: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[u32, u32, Bytes]>>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;627 overweight: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[u32, u32, Bytes]>>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;
618 /**628 /**
619 * The number of overweight messages ever recorded in `Overweight`. Also doubles as the next629 * The number of overweight messages ever recorded in `Overweight`. Also doubles as the next
modifiedtests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth
1// Auto-generated via `yarn polkadot-types-from-chain`, do not edit1// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
2/* eslint-disable */2/* eslint-disable */
33
4import type { PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionStats } from './unique';4import type { PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsCollectionLimitsVersion2, UpDataStructsCollectionStats, UpDataStructsRpcCollection } from './unique';
5import type { AugmentedRpc } from '@polkadot/rpc-core/types';5import type { AugmentedRpc } from '@polkadot/rpc-core/types';
6import type { Metadata, StorageKey } from '@polkadot/types';6import type { Metadata, StorageKey } from '@polkadot/types';
7import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u128, u32, u64 } from '@polkadot/types-codec';7import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u128, u32, u64 } from '@polkadot/types-codec';
601 /**601 /**
602 * Get collection by specified id602 * Get collection by specified id
603 **/603 **/
604 collectionById: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollection>>>;604 collectionById: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsRpcCollection>>>;
605 /**605 /**
606 * Get collection stats606 * Get collection stats
607 **/607 **/
617 /**617 /**
618 * Get effective collection limits618 * Get effective collection limits
619 **/619 **/
620 effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimits>>>;620 effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimitsVersion2>>>;
621 /**621 /**
622 * Get last token id622 * Get last token id
623 **/623 **/
634 * Get token owner634 * Get token owner
635 **/635 **/
636 tokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<PalletEvmAccountBasicCrossAccountIdRepr>>;636 tokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<PalletEvmAccountBasicCrossAccountIdRepr>>;
637 /**
638 * Get token owner, in case of nested token - find parent recursive
639 **/
640 topmostTokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<PalletEvmAccountBasicCrossAccountIdRepr>>;
637 /**641 /**
638 * Get token variable metadata642 * Get token variable metadata
639 **/643 **/
modifiedtests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth
5import type { Bytes, Compact, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';5import type { Bytes, Compact, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
6import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';6import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
7import type { AccountId32, Call, H160, H256, MultiAddress, Perbill } from '@polkadot/types/interfaces/runtime';7import type { AccountId32, Call, H160, H256, MultiAddress, Perbill } from '@polkadot/types/interfaces/runtime';
8import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsAccessMode, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsMetaUpdatePermission, UpDataStructsSchemaVersion, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';8import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsAccessMode, UpDataStructsCollectionLimitsVersion2, UpDataStructsCollectionMode, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsMetaUpdatePermission, UpDataStructsSchemaVersion, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
99
10declare module '@polkadot/api-base/types/submittable' {10declare module '@polkadot/api-base/types/submittable' {
11 export interface AugmentedSubmittables<ApiType extends ApiTypes> {11 export interface AugmentedSubmittables<ApiType extends ApiTypes> {
346 **/346 **/
347 [key: string]: SubmittableExtrinsicFunction<ApiType>;347 [key: string]: SubmittableExtrinsicFunction<ApiType>;
348 };348 };
349 structure: {
350 /**
351 * Generic tx
352 **/
353 [key: string]: SubmittableExtrinsicFunction<ApiType>;
354 };
349 sudo: {355 sudo: {
350 /**356 /**
351 * Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo357 * Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo
771 * * address.777 * * address.
772 **/778 **/
773 removeFromAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;779 removeFromAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
774 setCollectionLimits: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newLimit: UpDataStructsCollectionLimits | { accountTokenOwnershipLimit?: any; sponsoredDataSize?: any; sponsoredDataRateLimit?: any; tokenLimit?: any; sponsorTransferTimeout?: any; sponsorApproveTimeout?: any; ownerCanTransfer?: any; ownerCanDestroy?: any; transfersEnabled?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsCollectionLimits]>;780 setCollectionLimits: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newLimit: UpDataStructsCollectionLimitsVersion2 | { accountTokenOwnershipLimit?: any; sponsoredDataSize?: any; sponsoredDataRateLimit?: any; tokenLimit?: any; sponsorTransferTimeout?: any; sponsorApproveTimeout?: any; ownerCanTransfer?: any; ownerCanDestroy?: any; transfersEnabled?: any; nestingRule?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsCollectionLimitsVersion2]>;
775 /**781 /**
776 * # Permissions782 * # Permissions
777 * 783 *
modifiedtests/src/interfaces/augment-types.tsdiffbeforeafterboth
1// Auto-generated via `yarn polkadot-types-from-defs`, do not edit1// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
2/* eslint-disable */2/* eslint-disable */
33
4import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsMetaUpdatePermission, UpDataStructsSchemaVersion, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './unique';4import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportStorageBoundedBTreeSet, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1AbridgedHrmpChannel, PolkadotPrimitivesV1PersistedValidationData, PolkadotPrimitivesV1UpgradeRestriction, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollectionField, UpDataStructsCollectionLimitsVersion2, UpDataStructsCollectionMode, UpDataStructsCollectionStats, UpDataStructsCollectionVersion2, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsMetaUpdatePermission, UpDataStructsNestingRule, UpDataStructsRpcCollection, UpDataStructsSchemaVersion, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './unique';
5import type { Data, StorageKey } from '@polkadot/types';5import type { Data, StorageKey } from '@polkadot/types';
6import type { BTreeSet, BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';6import type { BTreeSet, BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
7import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';7import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
479 ForkTreePendingChangeNode: ForkTreePendingChangeNode;479 ForkTreePendingChangeNode: ForkTreePendingChangeNode;
480 FpRpcTransactionStatus: FpRpcTransactionStatus;480 FpRpcTransactionStatus: FpRpcTransactionStatus;
481 FrameSupportPalletId: FrameSupportPalletId;481 FrameSupportPalletId: FrameSupportPalletId;
482 FrameSupportStorageBoundedBTreeSet: FrameSupportStorageBoundedBTreeSet;
482 FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus;483 FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus;
483 FrameSupportWeightsDispatchClass: FrameSupportWeightsDispatchClass;484 FrameSupportWeightsDispatchClass: FrameSupportWeightsDispatchClass;
484 FrameSupportWeightsDispatchInfo: FrameSupportWeightsDispatchInfo;485 FrameSupportWeightsDispatchInfo: FrameSupportWeightsDispatchInfo;
789 PalletsOrigin: PalletsOrigin;790 PalletsOrigin: PalletsOrigin;
790 PalletStorageMetadataLatest: PalletStorageMetadataLatest;791 PalletStorageMetadataLatest: PalletStorageMetadataLatest;
791 PalletStorageMetadataV14: PalletStorageMetadataV14;792 PalletStorageMetadataV14: PalletStorageMetadataV14;
793 PalletStructureCall: PalletStructureCall;
794 PalletStructureError: PalletStructureError;
795 PalletStructureEvent: PalletStructureEvent;
792 PalletSudoCall: PalletSudoCall;796 PalletSudoCall: PalletSudoCall;
793 PalletSudoError: PalletSudoError;797 PalletSudoError: PalletSudoError;
794 PalletSudoEvent: PalletSudoEvent;798 PalletSudoEvent: PalletSudoEvent;
846 PerU16: PerU16;850 PerU16: PerU16;
847 Phantom: Phantom;851 Phantom: Phantom;
848 PhantomData: PhantomData;852 PhantomData: PhantomData;
853 PhantomTypeUpDataStructs: PhantomTypeUpDataStructs;
849 Phase: Phase;854 Phase: Phase;
850 PhragmenScore: PhragmenScore;855 PhragmenScore: PhragmenScore;
851 Points: Points;856 Points: Points;
1163 UnrewardedRelayer: UnrewardedRelayer;1168 UnrewardedRelayer: UnrewardedRelayer;
1164 UnrewardedRelayersState: UnrewardedRelayersState;1169 UnrewardedRelayersState: UnrewardedRelayersState;
1165 UpDataStructsAccessMode: UpDataStructsAccessMode;1170 UpDataStructsAccessMode: UpDataStructsAccessMode;
1166 UpDataStructsCollection: UpDataStructsCollection;1171 UpDataStructsCollectionField: UpDataStructsCollectionField;
1167 UpDataStructsCollectionLimits: UpDataStructsCollectionLimits;1172 UpDataStructsCollectionLimitsVersion2: UpDataStructsCollectionLimitsVersion2;
1168 UpDataStructsCollectionMode: UpDataStructsCollectionMode;1173 UpDataStructsCollectionMode: UpDataStructsCollectionMode;
1169 UpDataStructsCollectionStats: UpDataStructsCollectionStats;1174 UpDataStructsCollectionStats: UpDataStructsCollectionStats;
1175 UpDataStructsCollectionVersion2: UpDataStructsCollectionVersion2;
1170 UpDataStructsCreateCollectionData: UpDataStructsCreateCollectionData;1176 UpDataStructsCreateCollectionData: UpDataStructsCreateCollectionData;
1171 UpDataStructsCreateFungibleData: UpDataStructsCreateFungibleData;1177 UpDataStructsCreateFungibleData: UpDataStructsCreateFungibleData;
1172 UpDataStructsCreateItemData: UpDataStructsCreateItemData;1178 UpDataStructsCreateItemData: UpDataStructsCreateItemData;
1176 UpDataStructsCreateReFungibleData: UpDataStructsCreateReFungibleData;1182 UpDataStructsCreateReFungibleData: UpDataStructsCreateReFungibleData;
1177 UpDataStructsCreateRefungibleExData: UpDataStructsCreateRefungibleExData;1183 UpDataStructsCreateRefungibleExData: UpDataStructsCreateRefungibleExData;
1178 UpDataStructsMetaUpdatePermission: UpDataStructsMetaUpdatePermission;1184 UpDataStructsMetaUpdatePermission: UpDataStructsMetaUpdatePermission;
1185 UpDataStructsNestingRule: UpDataStructsNestingRule;
1186 UpDataStructsRpcCollection: UpDataStructsRpcCollection;
1179 UpDataStructsSchemaVersion: UpDataStructsSchemaVersion;1187 UpDataStructsSchemaVersion: UpDataStructsSchemaVersion;
1180 UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit;1188 UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit;
1181 UpDataStructsSponsorshipState: UpDataStructsSponsorshipState;1189 UpDataStructsSponsorshipState: UpDataStructsSponsorshipState;
deletedtests/src/interfaces/lookup.tsdiffbeforeafterboth

no changes

deletedtests/src/interfaces/types-lookup.tsdiffbeforeafterboth

no changes

modifiedtests/src/interfaces/unique/definitions.tsdiffbeforeafterboth
49 balance: fun('Get amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'),49 balance: fun('Get amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'),
50 allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'),50 allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'),
51 tokenOwner: fun('Get token owner', [collectionParam, tokenParam], CROSS_ACCOUNT_ID_TYPE),51 tokenOwner: fun('Get token owner', [collectionParam, tokenParam], CROSS_ACCOUNT_ID_TYPE),
52 topmostTokenOwner: fun('Get token owner, in case of nested token - find parent recursive', [collectionParam, tokenParam], CROSS_ACCOUNT_ID_TYPE),
52 constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec<u8>'),53 constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec<u8>'),
53 variableMetadata: fun('Get token variable metadata', [collectionParam, tokenParam], 'Vec<u8>'),54 variableMetadata: fun('Get token variable metadata', [collectionParam, tokenParam], 'Vec<u8>'),
54 tokenExists: fun('Check if token exists', [collectionParam, tokenParam], 'bool'),55 tokenExists: fun('Check if token exists', [collectionParam, tokenParam], 'bool'),
modifiedtests/src/interfaces/unique/types.tsdiffbeforeafterboth
449/** @name FrameSupportPalletId */449/** @name FrameSupportPalletId */
450export interface FrameSupportPalletId extends U8aFixed {}450export interface FrameSupportPalletId extends U8aFixed {}
451
452/** @name FrameSupportStorageBoundedBTreeSet */
453export interface FrameSupportStorageBoundedBTreeSet extends Vec<u32> {}
451454
452/** @name FrameSupportTokensMiscBalanceStatus */455/** @name FrameSupportTokensMiscBalanceStatus */
453export interface FrameSupportTokensMiscBalanceStatus extends Enum {456export interface FrameSupportTokensMiscBalanceStatus extends Enum {
890 readonly isAddressIsZero: boolean;893 readonly isAddressIsZero: boolean;
891 readonly isUnsupportedOperation: boolean;894 readonly isUnsupportedOperation: boolean;
892 readonly isNotSufficientFounds: boolean;895 readonly isNotSufficientFounds: boolean;
896 readonly isNestingIsDisabled: boolean;
897 readonly isOnlyOwnerAllowedToNest: boolean;
898 readonly isSourceCollectionIsNotAllowedToNest: boolean;
899 readonly isCollectionFieldSizeExceeded: boolean;
893 readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'TokenVariableDataLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds';900 readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'TokenVariableDataLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'NestingIsDisabled' | 'OnlyOwnerAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded';
894}901}
895902
896/** @name PalletCommonEvent */903/** @name PalletCommonEvent */
1069 readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;1076 readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;
1070 readonly isFungibleItemsHaveNoId: boolean;1077 readonly isFungibleItemsHaveNoId: boolean;
1071 readonly isFungibleItemsDontHaveData: boolean;1078 readonly isFungibleItemsDontHaveData: boolean;
1079 readonly isFungibleDisallowsNesting: boolean;
1072 readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData';1080 readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting';
1073}1081}
10741082
1075/** @name PalletInflationCall */1083/** @name PalletInflationCall */
1099export interface PalletRefungibleError extends Enum {1107export interface PalletRefungibleError extends Enum {
1100 readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;1108 readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;
1101 readonly isWrongRefungiblePieces: boolean;1109 readonly isWrongRefungiblePieces: boolean;
1110 readonly isRefungibleDisallowsNesting: boolean;
1102 readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces';1111 readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RefungibleDisallowsNesting';
1103}1112}
11041113
1105/** @name PalletRefungibleItemData */1114/** @name PalletRefungibleItemData */
1108 readonly variableData: Bytes;1117 readonly variableData: Bytes;
1109}1118}
1119
1120/** @name PalletStructureCall */
1121export interface PalletStructureCall extends Null {}
1122
1123/** @name PalletStructureError */
1124export interface PalletStructureError extends Enum {
1125 readonly isOuroborosDetected: boolean;
1126 readonly isDepthLimit: boolean;
1127 readonly isTokenNotFound: boolean;
1128 readonly type: 'OuroborosDetected' | 'DepthLimit' | 'TokenNotFound';
1129}
1130
1131/** @name PalletStructureEvent */
1132export interface PalletStructureEvent extends Enum {
1133 readonly isExecuted: boolean;
1134 readonly asExecuted: Result<Null, SpRuntimeDispatchError>;
1135 readonly type: 'Executed';
1136}
11101137
1111/** @name PalletSudoCall */1138/** @name PalletSudoCall */
1112export interface PalletSudoCall extends Enum {1139export interface PalletSudoCall extends Enum {
1402 readonly isSetCollectionLimits: boolean;1429 readonly isSetCollectionLimits: boolean;
1403 readonly asSetCollectionLimits: {1430 readonly asSetCollectionLimits: {
1404 readonly collectionId: u32;1431 readonly collectionId: u32;
1405 readonly newLimit: UpDataStructsCollectionLimits;1432 readonly newLimit: UpDataStructsCollectionLimitsVersion2;
1406 } & Struct;1433 } & Struct;
1407 readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'SetPublicAccessMode' | 'SetMintPermission' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetVariableMetaData' | 'SetMetaUpdatePermissionFlag' | 'SetSchemaVersion' | 'SetOffchainSchema' | 'SetConstOnChainSchema' | 'SetVariableOnChainSchema' | 'SetCollectionLimits';1434 readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'SetPublicAccessMode' | 'SetMintPermission' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetVariableMetaData' | 'SetMetaUpdatePermissionFlag' | 'SetSchemaVersion' | 'SetOffchainSchema' | 'SetConstOnChainSchema' | 'SetVariableOnChainSchema' | 'SetCollectionLimits';
1408}1435}
1567 readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail';1594 readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail';
1568}1595}
1596
1597/** @name PhantomTypeUpDataStructs */
1598export interface PhantomTypeUpDataStructs extends Vec<Lookup309> {}
15691599
1570/** @name PolkadotCorePrimitivesInboundDownwardMessage */1600/** @name PolkadotCorePrimitivesInboundDownwardMessage */
1571export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {1601export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {
1745 readonly type: 'Normal' | 'AllowList';1775 readonly type: 'Normal' | 'AllowList';
1746}1776}
17471777
1748/** @name UpDataStructsCollection */1778/** @name UpDataStructsCollectionField */
1749export interface UpDataStructsCollection extends Struct {1779export interface UpDataStructsCollectionField extends Enum {
1750 readonly owner: AccountId32;1780 readonly isVariableOnChainSchema: boolean;
1751 readonly mode: UpDataStructsCollectionMode;1781 readonly isConstOnChainSchema: boolean;
1752 readonly access: UpDataStructsAccessMode;1782 readonly isOffchainSchema: boolean;
1753 readonly name: Vec<u16>;1783 readonly type: 'VariableOnChainSchema' | 'ConstOnChainSchema' | 'OffchainSchema';
1754 readonly description: Vec<u16>;
1755 readonly tokenPrefix: Bytes;
1756 readonly mintMode: bool;
1757 readonly offchainSchema: Bytes;
1758 readonly schemaVersion: UpDataStructsSchemaVersion;
1759 readonly sponsorship: UpDataStructsSponsorshipState;
1760 readonly limits: UpDataStructsCollectionLimits;
1761 readonly variableOnChainSchema: Bytes;
1762 readonly constOnChainSchema: Bytes;
1763 readonly metaUpdatePermission: UpDataStructsMetaUpdatePermission;
1764}1784}
17651785
1766/** @name UpDataStructsCollectionLimits */1786/** @name UpDataStructsCollectionLimitsVersion2 */
1767export interface UpDataStructsCollectionLimits extends Struct {1787export interface UpDataStructsCollectionLimitsVersion2 extends Struct {
1768 readonly accountTokenOwnershipLimit: Option<u32>;1788 readonly accountTokenOwnershipLimit: Option<u32>;
1769 readonly sponsoredDataSize: Option<u32>;1789 readonly sponsoredDataSize: Option<u32>;
1770 readonly sponsoredDataRateLimit: Option<UpDataStructsSponsoringRateLimit>;1790 readonly sponsoredDataRateLimit: Option<UpDataStructsSponsoringRateLimit>;
1774 readonly ownerCanTransfer: Option<bool>;1794 readonly ownerCanTransfer: Option<bool>;
1775 readonly ownerCanDestroy: Option<bool>;1795 readonly ownerCanDestroy: Option<bool>;
1776 readonly transfersEnabled: Option<bool>;1796 readonly transfersEnabled: Option<bool>;
1797 readonly nestingRule: Option<UpDataStructsNestingRule>;
1777}1798}
17781799
1779/** @name UpDataStructsCollectionMode */1800/** @name UpDataStructsCollectionMode */
1792 readonly alive: u32;1813 readonly alive: u32;
1793}1814}
1815
1816/** @name UpDataStructsCollectionVersion2 */
1817export interface UpDataStructsCollectionVersion2 extends Struct {
1818 readonly owner: AccountId32;
1819 readonly mode: UpDataStructsCollectionMode;
1820 readonly access: UpDataStructsAccessMode;
1821 readonly name: Vec<u16>;
1822 readonly description: Vec<u16>;
1823 readonly tokenPrefix: Bytes;
1824 readonly mintMode: bool;
1825 readonly schemaVersion: UpDataStructsSchemaVersion;
1826 readonly sponsorship: UpDataStructsSponsorshipState;
1827 readonly limits: UpDataStructsCollectionLimitsVersion2;
1828 readonly metaUpdatePermission: UpDataStructsMetaUpdatePermission;
1829}
17941830
1795/** @name UpDataStructsCreateCollectionData */1831/** @name UpDataStructsCreateCollectionData */
1796export interface UpDataStructsCreateCollectionData extends Struct {1832export interface UpDataStructsCreateCollectionData extends Struct {
1802 readonly offchainSchema: Bytes;1838 readonly offchainSchema: Bytes;
1803 readonly schemaVersion: Option<UpDataStructsSchemaVersion>;1839 readonly schemaVersion: Option<UpDataStructsSchemaVersion>;
1804 readonly pendingSponsor: Option<AccountId32>;1840 readonly pendingSponsor: Option<AccountId32>;
1805 readonly limits: Option<UpDataStructsCollectionLimits>;1841 readonly limits: Option<UpDataStructsCollectionLimitsVersion2>;
1806 readonly variableOnChainSchema: Bytes;1842 readonly variableOnChainSchema: Bytes;
1807 readonly constOnChainSchema: Bytes;1843 readonly constOnChainSchema: Bytes;
1808 readonly metaUpdatePermission: Option<UpDataStructsMetaUpdatePermission>;1844 readonly metaUpdatePermission: Option<UpDataStructsMetaUpdatePermission>;
1872 readonly type: 'ItemOwner' | 'Admin' | 'None';1908 readonly type: 'ItemOwner' | 'Admin' | 'None';
1873}1909}
1910
1911/** @name UpDataStructsNestingRule */
1912export interface UpDataStructsNestingRule extends Enum {
1913 readonly isDisabled: boolean;
1914 readonly isOwner: boolean;
1915 readonly isOwnerRestricted: boolean;
1916 readonly asOwnerRestricted: FrameSupportStorageBoundedBTreeSet;
1917 readonly type: 'Disabled' | 'Owner' | 'OwnerRestricted';
1918}
1919
1920/** @name UpDataStructsRpcCollection */
1921export interface UpDataStructsRpcCollection extends Struct {
1922 readonly owner: AccountId32;
1923 readonly mode: UpDataStructsCollectionMode;
1924 readonly access: UpDataStructsAccessMode;
1925 readonly name: Vec<u16>;
1926 readonly description: Vec<u16>;
1927 readonly tokenPrefix: Bytes;
1928 readonly mintMode: bool;
1929 readonly offchainSchema: Bytes;
1930 readonly schemaVersion: UpDataStructsSchemaVersion;
1931 readonly sponsorship: UpDataStructsSponsorshipState;
1932 readonly limits: UpDataStructsCollectionLimitsVersion2;
1933 readonly variableOnChainSchema: Bytes;
1934 readonly constOnChainSchema: Bytes;
1935 readonly metaUpdatePermission: UpDataStructsMetaUpdatePermission;
1936}
18741937
1875/** @name UpDataStructsSchemaVersion */1938/** @name UpDataStructsSchemaVersion */
1876export interface UpDataStructsSchemaVersion extends Enum {1939export interface UpDataStructsSchemaVersion extends Enum {
modifiedtests/src/nesting/nest.test.tsdiffbeforeafterboth
2import {tokenIdToAddress} from '../eth/util/helpers';2import {tokenIdToAddress} from '../eth/util/helpers';
3import privateKey from '../substrate/privateKey';3import privateKey from '../substrate/privateKey';
4import usingApi from '../substrate/substrate-api';4import usingApi from '../substrate/substrate-api';
5import {createCollectionExpectSuccess, createItemExpectSuccess, getTokenOwner, setCollectionLimitsExpectSuccess, transferExpectSuccess, transferFromExpectSuccess} from '../util/helpers';5import {createCollectionExpectSuccess, createItemExpectSuccess, getTokenOwner, getTopmostTokenOwner, setCollectionLimitsExpectSuccess, transferExpectSuccess, transferFromExpectSuccess} from '../util/helpers';
66
7describe('nesting', () => {7describe.only('nesting', () => {
8 it('allows to nest/unnest token', async () => {8 it('allows to nest/unnest token', async () => {
9 await usingApi(async api => {9 await usingApi(async api => {
10 const alice = privateKey('//Alice');10 const alice = privateKey('//Alice');
19 // Nest19 // Nest
20 await transferExpectSuccess(collection, nestedToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)});20 await transferExpectSuccess(collection, nestedToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)});
21
22 expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address});
23 expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});
2124
22 // Move bundle to different user25 // Move bundle to different user
23 await transferExpectSuccess(collection, targetToken, alice, {Substrate: bob.address});26 await transferExpectSuccess(collection, targetToken, alice, {Substrate: bob.address});
27
28 expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: bob.address});
29 expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});
2430
25 // Unnest31 // Unnest
26 await transferFromExpectSuccess(collection, nestedToken, bob, {Ethereum: tokenIdToAddress(collection, targetToken)}, {Substrate: bob.address});32 await transferFromExpectSuccess(collection, nestedToken, bob, {Ethereum: tokenIdToAddress(collection, targetToken)}, {Substrate: bob.address});
modifiedtests/src/util/helpers.tsdiffbeforeafterboth
27import privateKey from '../substrate/privateKey';27import privateKey from '../substrate/privateKey';
28import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api';28import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api';
29import {hexToStr, strToUTF16, utf16ToStr} from './util';29import {hexToStr, strToUTF16, utf16ToStr} from './util';
30import {UpDataStructsCollection} from '@polkadot/types/lookup';30import {UpDataStructsRpcCollection} from '@polkadot/types/lookup';
3131
32chai.use(chaiAsPromised);32chai.use(chaiAsPromised);
33const expect = chai.expect;33const expect = chai.expect;
987): Promise<CrossAccountId> {987): Promise<CrossAccountId> {
988 return normalizeAccountId((await api.rpc.unique.tokenOwner(collectionId, token)).toJSON() as any);988 return normalizeAccountId((await api.rpc.unique.tokenOwner(collectionId, token)).toJSON() as any);
989}989}
990export async function getTopmostTokenOwner(
991 api: ApiPromise,
992 collectionId: number,
993 token: number,
994): Promise<CrossAccountId> {
995 return normalizeAccountId((await api.rpc.unique.topmostTokenOwner(collectionId, token)).toJSON() as any);
996}
990export async function isTokenExists(997export async function isTokenExists(
991 api: ApiPromise,998 api: ApiPromise,
992 collectionId: number,999 collectionId: number,
1256}1263}
12571264
1258export const getDetailedCollectionInfo = async (api: ApiPromise, collectionId: number)1265export const getDetailedCollectionInfo = async (api: ApiPromise, collectionId: number)
1259 : Promise<UpDataStructsCollection | null> => {1266 : Promise<UpDataStructsRpcCollection | null> => {
1260 return (await api.rpc.unique.collectionById(collectionId)).unwrapOr(null);1267 return (await api.rpc.unique.collectionById(collectionId)).unwrapOr(null);
1261};1268};
12621269
1265 return (await api.rpc.unique.collectionStats()).created.toNumber();1272 return (await api.rpc.unique.collectionStats()).created.toNumber();
1266};1273};
12671274
1268export async function queryCollectionExpectSuccess(api: ApiPromise, collectionId: number): Promise<UpDataStructsCollection> {1275export async function queryCollectionExpectSuccess(api: ApiPromise, collectionId: number): Promise<UpDataStructsRpcCollection> {
1269 return (await api.rpc.unique.collectionById(collectionId)).unwrap();1276 return (await api.rpc.unique.collectionById(collectionId)).unwrap();
1270}1277}
12711278