git.delta.rocks / unique-network / refs/commits / 1bdec8235cab

difftreelog

fix export RpcCollection to metadata

Yaroslav Bolyukin2022-04-07parent: #6be1bb5.patch.diff
in: master

4 files changed

modifiedpallets/common/src/lib.rsdiffbeforeafterboth
33 COLLECTION_ADMINS_LIMIT, MetaUpdatePermission, TokenId, CollectionStats, MAX_TOKEN_OWNERSHIP,33 COLLECTION_ADMINS_LIMIT, MetaUpdatePermission, TokenId, CollectionStats, MAX_TOKEN_OWNERSHIP,
34 CollectionMode, NFT_SPONSOR_TRANSFER_TIMEOUT, FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,34 CollectionMode, NFT_SPONSOR_TRANSFER_TIMEOUT, FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,
35 REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, MAX_SPONSOR_TIMEOUT, CUSTOM_DATA_LIMIT, CollectionLimits,35 REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, MAX_SPONSOR_TIMEOUT, CUSTOM_DATA_LIMIT, CollectionLimits,
36 CustomDataLimit, CreateCollectionData, SponsorshipState, CreateItemExData, SponsoringRateLimit, budget::Budget, COLLECTION_FIELD_LIMIT, CollectionField,36 CustomDataLimit, CreateCollectionData, SponsorshipState, CreateItemExData, SponsoringRateLimit, budget::Budget, COLLECTION_FIELD_LIMIT, CollectionField, PhantomType,
37};37};
38pub use pallet::*;38pub use pallet::*;
39use sp_core::H160;39use sp_core::H160;
415415
416 /// Not used by code, exists only to provide some types to metadata416 /// Not used by code, exists only to provide some types to metadata
417 #[pallet::storage]417 #[pallet::storage]
418 pub type DummyStorageValue<T> =418 pub type DummyStorageValue<T: Config> =
419 StorageValue<Value = (CollectionStats, CollectionId, TokenId), QueryKind = OptionQuery>;419 StorageValue<Value = (CollectionStats, CollectionId, TokenId, PhantomType<RpcCollection<T::AccountId>>), QueryKind = OptionQuery>;
420420
421 #[pallet::hooks]421 #[pallet::hooks]
422 impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {422 impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
584 pub alive: u32,584 pub alive: u32,
585}585}
586586
587#[derive(Encode, Decode, PartialEq, Clone, Debug)]
588pub struct PhantomType<T>(core::marker::PhantomData<T>);
589
590impl<T: TypeInfo + 'static> TypeInfo for PhantomType<T> {
591 type Identity = PhantomType<T>;
592
593 fn type_info() -> scale_info::Type {
594 use scale_info::{Type, Path, build::{FieldsBuilder, UnnamedFields}};
595 Type::builder()
596 .path(Path::new("up_data_structs", "PhantomType"))
597 .composite(<FieldsBuilder<UnnamedFields>>::default().field(|b|
598 b.ty::<[T ;0]>()
599 ))
600 }
601}
602impl<T> MaxEncodedLen for PhantomType<T> {
603 fn max_encoded_len() -> usize {
604 0
605 }
606}
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
67 },67 },
68};68};
69use up_data_structs::mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping};69use up_data_structs::mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping};
70use up_data_structs::{CollectionId, TokenId, CollectionStats, Collection, RpcCollection};70use up_data_structs::{CollectionId, TokenId, CollectionStats, RpcCollection};
71// use pallet_contracts::weights::WeightInfo;71// use pallet_contracts::weights::WeightInfo;
72// #[cfg(any(feature = "std", test))]72// #[cfg(any(feature = "std", test))]
73use frame_system::{73use frame_system::{
modifiedtests/src/interfaces/unique/definitions.tsdiffbeforeafterboth
52 constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec<u8>'),52 constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec<u8>'),
53 variableMetadata: fun('Get token variable metadata', [collectionParam, tokenParam], 'Vec<u8>'),53 variableMetadata: fun('Get token variable metadata', [collectionParam, tokenParam], 'Vec<u8>'),
54 tokenExists: fun('Check if token exists', [collectionParam, tokenParam], 'bool'),54 tokenExists: fun('Check if token exists', [collectionParam, tokenParam], 'bool'),
55 collectionById: fun('Get collection by specified id', [collectionParam], 'Option<UpDataStructsCollection>'),55 collectionById: fun('Get collection by specified id', [collectionParam], 'Option<UpDataStructsRpcCollection>'),
56 collectionStats: fun('Get collection stats', [], 'UpDataStructsCollectionStats'),56 collectionStats: fun('Get collection stats', [], 'UpDataStructsCollectionStats'),
57 allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'),57 allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'),
58 nextSponsored: fun('Get number of blocks when sponsored transaction is available', [collectionParam, crossAccountParam(), tokenParam], 'Option<u64>'),58 nextSponsored: fun('Get number of blocks when sponsored transaction is available', [collectionParam, crossAccountParam(), tokenParam], 'Option<u64>'),