git.delta.rocks / unique-network / refs/commits / f6a52db23434

difftreelog

Merge branch 'feature/pallet-structure-rebased' of https://github.com/UniqueNetwork/unique-chain into feature/pallet-structure-rebased

kryadinskii2022-05-20parents: #464a3c1 #5ace650.patch.diff
in: master

16 files changed

modifiedpallets/common/src/lib.rsdiffbeforeafterboth
59 Properties,59 Properties,
60 PropertiesPermissionMap,60 PropertiesPermissionMap,
61 PropertyKey,61 PropertyKey,
62 PropertyValue,
62 PropertyPermission,63 PropertyPermission,
63 PropertiesError,64 PropertiesError,
64 PropertyKeyPermission,65 PropertyKeyPermission,
902 Ok(())903 Ok(())
903 }904 }
905
906 pub fn get_collection_property(collection_id: CollectionId, key: &PropertyKey) -> Option<PropertyValue> {
907 Self::collection_properties(collection_id)
908 .get(key)
909 .cloned()
910 }
904911
905 pub fn bytes_keys_to_property_keys(912 pub fn bytes_keys_to_property_keys(
906 keys: Vec<Vec<u8>>,913 keys: Vec<Vec<u8>>,
12401247
1241 fn token_owner(&self, token: TokenId) -> Option<T::CrossAccountId>;1248 fn token_owner(&self, token: TokenId) -> Option<T::CrossAccountId>;
1242 fn const_metadata(&self, token: TokenId) -> Vec<u8>;1249 fn const_metadata(&self, token: TokenId) -> Vec<u8>;
1250 fn token_property(&self, token_id: TokenId, key: &PropertyKey) -> Option<PropertyValue>;
1243 fn token_properties(&self, token_id: TokenId, keys: Option<Vec<PropertyKey>>) -> Vec<Property>;1251 fn token_properties(&self, token_id: TokenId, keys: Option<Vec<PropertyKey>>) -> Vec<Property>;
1244 /// Amount of unique collection tokens1252 /// Amount of unique collection tokens
1245 fn total_supply(&self) -> u32;1253 fn total_supply(&self) -> u32;
modifiedpallets/fungible/src/common.rsdiffbeforeafterboth
21use pallet_common::{CommonCollectionOperations, CommonWeightInfo, with_weight};21use pallet_common::{CommonCollectionOperations, CommonWeightInfo, with_weight};
22use sp_runtime::ArithmeticError;22use sp_runtime::ArithmeticError;
23use sp_std::{vec::Vec, vec};23use sp_std::{vec::Vec, vec};
24use up_data_structs::{Property, PropertyKey, PropertyKeyPermission};24use up_data_structs::{Property, PropertyKey, PropertyValue, PropertyKeyPermission};
2525
26use crate::{26use crate::{
27 Allowance, Balance, Config, Error, FungibleHandle, Pallet, SelfWeightOf, weights::WeightInfo,27 Allowance, Balance, Config, Error, FungibleHandle, Pallet, SelfWeightOf, weights::WeightInfo,
319 Vec::new()319 Vec::new()
320 }320 }
321
322 fn token_property(&self, _token_id: TokenId, _key: &PropertyKey) -> Option<PropertyValue> {
323 None
324 }
321325
322 fn token_properties(326 fn token_properties(
323 &self,327 &self,
modifiedpallets/nonfungible/src/common.rsdiffbeforeafterboth
19use frame_support::{dispatch::DispatchResultWithPostInfo, ensure, fail, weights::Weight};19use frame_support::{dispatch::DispatchResultWithPostInfo, ensure, fail, weights::Weight};
20use up_data_structs::{20use up_data_structs::{
21 TokenId, CreateItemExData, CollectionId, budget::Budget, Property, PropertyKey,21 TokenId, CreateItemExData, CollectionId, budget::Budget, Property, PropertyKey,
22 PropertyKeyPermission,22 PropertyKeyPermission, PropertyValue,
23};23};
24use pallet_common::{CommonCollectionOperations, CommonWeightInfo, with_weight};24use pallet_common::{CommonCollectionOperations, CommonWeightInfo, with_weight};
25use sp_runtime::DispatchError;25use sp_runtime::DispatchError;
362 .into_inner()362 .into_inner()
363 }363 }
364
365 fn token_property(&self, token_id: TokenId, key: &PropertyKey) -> Option<PropertyValue> {
366 <Pallet<T>>::token_properties((self.id, token_id))
367 .get(key)
368 .cloned()
369 }
364370
365 fn token_properties(&self, token_id: TokenId, keys: Option<Vec<PropertyKey>>) -> Vec<Property> {371 fn token_properties(&self, token_id: TokenId, keys: Option<Vec<PropertyKey>>) -> Vec<Property> {
366 let properties = <Pallet<T>>::token_properties((self.id, token_id));372 let properties = <Pallet<T>>::token_properties((self.id, token_id));
addedpallets/proxy-rmrk-core/Cargo.tomldiffbeforeafterboth

no changes

addedpallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth

no changes

addedpallets/proxy-rmrk-core/src/misc.rsdiffbeforeafterboth

no changes

addedpallets/proxy-rmrk-core/src/property.rsdiffbeforeafterboth

no changes

modifiedpallets/refungible/src/common.rsdiffbeforeafterboth
20use frame_support::{dispatch::DispatchResultWithPostInfo, fail, weights::Weight};20use frame_support::{dispatch::DispatchResultWithPostInfo, fail, weights::Weight};
21use up_data_structs::{21use up_data_structs::{
22 CollectionId, TokenId, CreateItemExData, CreateRefungibleExData, budget::Budget, Property,22 CollectionId, TokenId, CreateItemExData, CreateRefungibleExData, budget::Budget, Property,
23 PropertyKey, PropertyKeyPermission,23 PropertyKey, PropertyValue, PropertyKeyPermission,
24};24};
25use pallet_common::{CommonCollectionOperations, CommonWeightInfo, with_weight};25use pallet_common::{CommonCollectionOperations, CommonWeightInfo, with_weight};
26use sp_runtime::DispatchError;26use sp_runtime::DispatchError;
340 .into_inner()340 .into_inner()
341 }341 }
342
343 fn token_property(&self, _token_id: TokenId, _key: &PropertyKey) -> Option<PropertyValue> {
344 None
345 }
342346
343 fn token_properties(347 fn token_properties(
344 &self,348 &self,
deletedpallets/rmrk-proxy/Cargo.tomldiffbeforeafterboth

no changes

deletedpallets/rmrk-proxy/src/lib.rsdiffbeforeafterboth

no changes

deletedpallets/rmrk-proxy/src/misc.rsdiffbeforeafterboth

no changes

modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
905 pub const RmrkPartsLimit: u32 = 3;905 pub const RmrkPartsLimit: u32 = 3;
906}906}
907907
908impl From<RmrkCollectionId> for CollectionId {
909 fn from(id: RmrkCollectionId) -> Self {
910 Self(id)
911 }
912}
913
914impl From<RmrkNftId> for TokenId {
915 fn from(id: RmrkNftId) -> Self {
916 Self(id)
917 }
918}
919
920pub type RmrkCollectionSymbol = BoundedVec<u8, RmrkCollectionSymbolLimit>;
908pub type RmrkCollectionInfo<AccountId> =921pub type RmrkCollectionInfo<AccountId> = CollectionInfo<RmrkString, RmrkCollectionSymbol, AccountId>;
909 CollectionInfo<RmrkString, BoundedVec<u8, RmrkCollectionSymbolLimit>, AccountId>;
910pub type RmrkInstanceInfo<AccountId> = NftInfo<AccountId, Permill, RmrkString>;922pub type RmrkInstanceInfo<AccountId> = NftInfo<AccountId, Permill, RmrkString>;
911pub type RmrkResourceInfo = ResourceInfo<923pub type RmrkResourceInfo = ResourceInfo<
912 BoundedVec<u8, RmrkResourceSymbolLimit>,924 BoundedVec<u8, RmrkResourceSymbolLimit>,
924pub type RmrkThemeName = RmrkRpcString;936pub type RmrkThemeName = RmrkRpcString;
925pub type RmrkPropertyKey = RmrkRpcString;937pub type RmrkPropertyKey = RmrkRpcString;
926938
927type RmrkString = BoundedVec<u8, RmrkStringLimit>;939pub type RmrkString = BoundedVec<u8, RmrkStringLimit>;
928940
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
33 'pallet-fungible/runtime-benchmarks',33 'pallet-fungible/runtime-benchmarks',
34 'pallet-refungible/runtime-benchmarks',34 'pallet-refungible/runtime-benchmarks',
35 'pallet-nonfungible/runtime-benchmarks',35 'pallet-nonfungible/runtime-benchmarks',
36 'pallet-rmrk-proxy/runtime-benchmarks',36 'pallet-proxy-rmrk-core/runtime-benchmarks',
37 'pallet-unique/runtime-benchmarks',37 'pallet-unique/runtime-benchmarks',
38 'pallet-inflation/runtime-benchmarks',38 'pallet-inflation/runtime-benchmarks',
39 'pallet-xcm/runtime-benchmarks',39 'pallet-xcm/runtime-benchmarks',
90 'pallet-fungible/std',90 'pallet-fungible/std',
91 'pallet-refungible/std',91 'pallet-refungible/std',
92 'pallet-nonfungible/std',92 'pallet-nonfungible/std',
93 'pallet-rmrk-proxy/std',93 'pallet-proxy-rmrk-core/std',
94 'pallet-unique/std',94 'pallet-unique/std',
95 'pallet-unq-scheduler/std',95 'pallet-unq-scheduler/std',
96 'pallet-charge-transaction/std',96 'pallet-charge-transaction/std',
417pallet-fungible = { default-features = false, path = "../../pallets/fungible" }417pallet-fungible = { default-features = false, path = "../../pallets/fungible" }
418pallet-refungible = { default-features = false, path = "../../pallets/refungible" }418pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
419pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }419pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
420pallet-rmrk-proxy = { default-features = false, path = "../../pallets/rmrk-proxy" }420pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
421pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }421pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }
422# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }422# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
423pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }423pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
901 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;901 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
902}902}
903903
904impl pallet_rmrk_proxy::Config for Runtime {904impl pallet_proxy_rmrk_core::Config for Runtime {
905 type Event = Event;905 type Event = Event;
906}906}
907907
1017 Refungible: pallet_refungible::{Pallet, Storage} = 68,1017 Refungible: pallet_refungible::{Pallet, Storage} = 68,
1018 Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,1018 Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
1019 Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,1019 Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
1020 RmrkProxy: pallet_rmrk_proxy::{Pallet, Call, Storage, Event<T>} = 71,1020 ProxyRmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,
10211021
1022 // Frontier1022 // Frontier
1023 EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,1023 EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
33 'pallet-fungible/runtime-benchmarks',33 'pallet-fungible/runtime-benchmarks',
34 'pallet-refungible/runtime-benchmarks',34 'pallet-refungible/runtime-benchmarks',
35 'pallet-nonfungible/runtime-benchmarks',35 'pallet-nonfungible/runtime-benchmarks',
36 'pallet-proxy-rmrk-core/runtime-benchmarks',
36 'pallet-unique/runtime-benchmarks',37 'pallet-unique/runtime-benchmarks',
37 'pallet-inflation/runtime-benchmarks',38 'pallet-inflation/runtime-benchmarks',
38 'pallet-xcm/runtime-benchmarks',39 'pallet-xcm/runtime-benchmarks',
89 'pallet-fungible/std',90 'pallet-fungible/std',
90 'pallet-refungible/std',91 'pallet-refungible/std',
91 'pallet-nonfungible/std',92 'pallet-nonfungible/std',
93 'pallet-proxy-rmrk-core/std',
92 'pallet-unique/std',94 'pallet-unique/std',
93 'pallet-unq-scheduler/std',95 'pallet-unq-scheduler/std',
94 'pallet-charge-transaction/std',96 'pallet-charge-transaction/std',
414pallet-fungible = { default-features = false, path = "../../pallets/fungible" }416pallet-fungible = { default-features = false, path = "../../pallets/fungible" }
415pallet-refungible = { default-features = false, path = "../../pallets/refungible" }417pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
416pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }418pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
419pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
417pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }420pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }
418# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }421# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
419pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }422pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
33 'pallet-fungible/runtime-benchmarks',33 'pallet-fungible/runtime-benchmarks',
34 'pallet-refungible/runtime-benchmarks',34 'pallet-refungible/runtime-benchmarks',
35 'pallet-nonfungible/runtime-benchmarks',35 'pallet-nonfungible/runtime-benchmarks',
36 'pallet-proxy-rmrk-core/runtime-benchmarks',
36 'pallet-unique/runtime-benchmarks',37 'pallet-unique/runtime-benchmarks',
37 'pallet-inflation/runtime-benchmarks',38 'pallet-inflation/runtime-benchmarks',
38 'pallet-xcm/runtime-benchmarks',39 'pallet-xcm/runtime-benchmarks',
89 'pallet-fungible/std',90 'pallet-fungible/std',
90 'pallet-refungible/std',91 'pallet-refungible/std',
91 'pallet-nonfungible/std',92 'pallet-nonfungible/std',
93 'pallet-proxy-rmrk-core/std',
92 'pallet-unique/std',94 'pallet-unique/std',
93 'pallet-unq-scheduler/std',95 'pallet-unq-scheduler/std',
94 'pallet-charge-transaction/std',96 'pallet-charge-transaction/std',
413pallet-fungible = { default-features = false, path = "../../pallets/fungible" }415pallet-fungible = { default-features = false, path = "../../pallets/fungible" }
414pallet-refungible = { default-features = false, path = "../../pallets/refungible" }416pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
415pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }417pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
418pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
416pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }419pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }
417# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }420# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
418pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }421pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }