difftreelog
feat add structure pallet
in: master
6 files changed
pallets/structure/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/pallets/structure/Cargo.toml
@@ -0,0 +1,29 @@
+[package]
+name = "pallet-structure"
+version = "0.1.0"
+edition = "2021"
+
+[dependencies]
+frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }
+frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }
+sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }
+pallet-common = { path = "../common", default-features = false }
+parity-scale-codec = { version = "2.0.0", default-features = false, features = [
+ "derive",
+] }
+scale-info = { version = "1.0.0", default-features = false, features = [
+ "derive",
+] }
+up-data-structs = { path = "../../primitives/data-structs", default-features = false }
+
+[features]
+default = ["std"]
+std = [
+ "frame-support/std",
+ "frame-system/std",
+ "sp-std/std",
+ "pallet-common/std",
+ "scale-info/std",
+ "parity-scale-codec/std",
+ "up-data-structs/std",
+]
pallets/structure/src/lib.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/structure/src/lib.rs
@@ -0,0 +1,159 @@
+#![cfg_attr(not(feature = "std"), no_std)]
+
+use sp_std::collections::btree_set::BTreeSet;
+
+use frame_support::dispatch::DispatchError;
+use frame_support::fail;
+pub use pallet::*;
+use pallet_common::{dispatch::CollectionDispatch, CollectionHandle};
+use up_data_structs::{CollectionId, TokenId, mapping::TokenAddressMapping};
+
+#[frame_support::pallet]
+pub mod pallet {
+ use frame_support::Parameter;
+ use frame_support::dispatch::{GetDispatchInfo, UnfilteredDispatchable};
+ use frame_support::pallet_prelude::*;
+ use frame_system::pallet_prelude::*;
+
+ use super::*;
+
+ #[pallet::error]
+ pub enum Error<T> {
+ /// While searched for owner, got already checked account
+ OuroborosDetected,
+ /// While searched for owner, encountered depth limit
+ DepthLimit,
+ /// While searched for owner, found token owner by not-yet-existing token
+ TokenNotFound,
+ }
+
+ #[pallet::event]
+ pub enum Event<T> {
+ /// Executed call on behalf of token
+ Executed(DispatchResult),
+ }
+
+ #[pallet::config]
+ pub trait Config: frame_system::Config + pallet_common::Config {
+ type Event: IsType<<Self as frame_system::Config>::Event> + From<Event<Self>>;
+ type Call: Parameter + UnfilteredDispatchable<Origin = Self::Origin> + GetDispatchInfo;
+ }
+
+ #[pallet::pallet]
+ pub struct Pallet<T>(_);
+
+ #[pallet::call]
+ impl<T: Config> Pallet<T> {
+ // #[pallet::weight({
+ // let dispatch_info = call.get_dispatch_info();
+
+ // (
+ // dispatch_info.weight
+ // // Cost of dereferencing parent
+ // .saturating_add(T::DbWeight::get().reads(2 * *max_depth as Weight))
+ // .saturating_add(4000 * *max_depth as Weight),
+ // dispatch_info.class)
+ // })]
+ // pub fn execute(
+ // origin: OriginFor<T>,
+ // call: Box<<T as Config>::Call>,
+ // max_depth: u32,
+ // ) -> DispatchResult {
+ }
+}
+
+#[derive(PartialEq)]
+pub enum Parent<CrossAccountId> {
+ /// Token owned by normal account
+ Normal(CrossAccountId),
+ /// Passed token not found
+ TokenNotFound,
+ /// Token owner is another token (target token still may not exist)
+ Token(CollectionId, TokenId),
+}
+
+impl<T: Config> Pallet<T> {
+ pub fn find_parent(
+ collection: CollectionId,
+ token: TokenId,
+ ) -> Result<Parent<T::CrossAccountId>, DispatchError> {
+ // TODO: Reduce cost by not reading collection config
+ let handle = match CollectionHandle::try_get(collection) {
+ Ok(v) => v,
+ Err(_) => return Ok(Parent::TokenNotFound),
+ };
+ let handle = T::CollectionDispatch::dispatch(handle);
+ let handle = handle.as_dyn();
+
+ Ok(match handle.token_owner(token) {
+ Some(owner) => match T::CrossTokenAddressMapping::address_to_token(&owner) {
+ Some((collection, token)) => Parent::Token(collection, token),
+ None => Parent::Normal(owner),
+ },
+ None => Parent::TokenNotFound,
+ })
+ }
+
+ pub fn parent_chain(
+ mut collection: CollectionId,
+ mut token: TokenId,
+ ) -> impl Iterator<Item = Result<Parent<T::CrossAccountId>, DispatchError>> {
+ let mut finished = false;
+ let mut visited = BTreeSet::new();
+ visited.insert((collection, token));
+ core::iter::from_fn(move || {
+ if finished {
+ return None;
+ }
+ let parent = Self::find_parent(collection, token);
+ match parent {
+ Ok(Parent::Token(new_collection, new_token)) => {
+ collection = new_collection;
+ token = new_token;
+ if !visited.insert((new_collection, new_token)) {
+ finished = true;
+ return Some(Err(<Error<T>>::OuroborosDetected.into()));
+ }
+ }
+ _ => finished = true,
+ }
+ Some(parent as Result<_, DispatchError>)
+ })
+ }
+
+ /// Try to dereference address, until finding top level owner
+ ///
+ /// May return token address if parent token not yet exists
+ pub fn find_topmost_owner(
+ collection: CollectionId,
+ token: TokenId,
+ max_depth: u32,
+ ) -> Result<T::CrossAccountId, DispatchError> {
+ let owner = Self::parent_chain(collection, token)
+ .take(max_depth as usize)
+ .find(|p| matches!(p, Ok(Parent::Normal(_) | Parent::TokenNotFound)))
+ .ok_or(<Error<T>>::DepthLimit)??;
+
+ Ok(match owner {
+ Parent::Normal(v) => v,
+ _ => fail!(<Error<T>>::TokenNotFound),
+ })
+ }
+
+ /// Check if token indirectly owned by specified user
+ pub fn indirectly_owned(
+ user: T::CrossAccountId,
+ collection: CollectionId,
+ token: TokenId,
+ max_depth: u32,
+ ) -> Result<bool, DispatchError> {
+ let target_parent = match T::CrossTokenAddressMapping::address_to_token(&user) {
+ Some((collection, token)) => Parent::Token(collection, token),
+ None => Parent::Normal(user),
+ };
+
+ Ok(Self::parent_chain(collection, token)
+ .take(max_depth as usize)
+ .any(|parent| Ok(&target_parent) == parent.as_ref()))
+ }
+}
runtime/opal/Cargo.tomldiffbeforeafterboth1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Opal Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'opal-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version = '0.9.20'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-ethereum/runtime-benchmarks',27 'pallet-evm-migration/runtime-benchmarks',28 'pallet-evm-coder-substrate/runtime-benchmarks',29 'pallet-balances/runtime-benchmarks',30 'pallet-timestamp/runtime-benchmarks',31 'pallet-common/runtime-benchmarks',32 'pallet-fungible/runtime-benchmarks',33 'pallet-refungible/runtime-benchmarks',34 'pallet-nonfungible/runtime-benchmarks',35 'pallet-unique/runtime-benchmarks',36 'pallet-inflation/runtime-benchmarks',37 'pallet-xcm/runtime-benchmarks',38 'sp-runtime/runtime-benchmarks',39 'xcm-builder/runtime-benchmarks',40]41try-runtime = [42 'frame-try-runtime',43 'frame-executive/try-runtime',44 'frame-system/try-runtime',45]46std = [47 'codec/std',48 'cumulus-pallet-aura-ext/std',49 'cumulus-pallet-parachain-system/std',50 'cumulus-pallet-xcm/std',51 'cumulus-pallet-xcmp-queue/std',52 'cumulus-primitives-core/std',53 'cumulus-primitives-utility/std',54 'frame-try-runtime/std',55 'frame-executive/std',56 'frame-support/std',57 'frame-system/std',58 'frame-system-rpc-runtime-api/std',59 'pallet-aura/std',60 'pallet-balances/std',61 # 'pallet-contracts/std',62 # 'pallet-contracts-primitives/std',63 # 'pallet-contracts-rpc-runtime-api/std',64 # 'pallet-contract-helpers/std',65 'pallet-randomness-collective-flip/std',66 'pallet-sudo/std',67 'pallet-timestamp/std',68 'pallet-transaction-payment/std',69 'pallet-transaction-payment-rpc-runtime-api/std',70 'pallet-treasury/std',71 # 'pallet-vesting/std',72 'pallet-evm/std',73 'pallet-evm-migration/std',74 'pallet-evm-contract-helpers/std',75 'pallet-evm-transaction-payment/std',76 'pallet-evm-coder-substrate/std',77 'pallet-ethereum/std',78 'pallet-base-fee/std',79 'fp-rpc/std',80 'up-rpc/std',81 'fp-evm-mapping/std',82 'fp-self-contained/std',83 'parachain-info/std',84 'serde',85 'pallet-inflation/std',86 'pallet-common/std',87 'pallet-fungible/std',88 'pallet-refungible/std',89 'pallet-nonfungible/std',90 'pallet-unique/std',91 'pallet-unq-scheduler/std',92 'pallet-charge-transaction/std',93 'up-data-structs/std',94 'sp-api/std',95 'sp-block-builder/std',96 "sp-consensus-aura/std",97 'sp-core/std',98 'sp-inherents/std',99 'sp-io/std',100 'sp-offchain/std',101 'sp-runtime/std',102 'sp-session/std',103 'sp-std/std',104 'sp-transaction-pool/std',105 'sp-version/std',106 'xcm/std',107 'xcm-builder/std',108 'xcm-executor/std',109 'unique-runtime-common/std',110111 "orml-vesting/std",112]113limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']114115################################################################################116# Substrate Dependencies117118[dependencies.codec]119default-features = false120features = ['derive']121package = 'parity-scale-codec'122version = '3.1.2'123124[dependencies.frame-benchmarking]125default-features = false126git = "https://github.com/paritytech/substrate"127optional = true128branch = "polkadot-v0.9.20"129130[dependencies.frame-try-runtime]131default-features = false132git = 'https://github.com/paritytech/substrate.git'133optional = true134branch = 'polkadot-v0.9.17'135136[dependencies.frame-executive]137default-features = false138git = "https://github.com/paritytech/substrate"139branch = "polkadot-v0.9.20"140141[dependencies.frame-support]142default-features = false143git = "https://github.com/paritytech/substrate"144branch = "polkadot-v0.9.20"145146[dependencies.frame-system]147default-features = false148git = "https://github.com/paritytech/substrate"149branch = "polkadot-v0.9.20"150151[dependencies.frame-system-benchmarking]152default-features = false153git = "https://github.com/paritytech/substrate"154optional = true155branch = "polkadot-v0.9.20"156157[dependencies.frame-system-rpc-runtime-api]158default-features = false159git = "https://github.com/paritytech/substrate"160branch = "polkadot-v0.9.20"161162[dependencies.hex-literal]163optional = true164version = '0.3.3'165166[dependencies.serde]167default-features = false168features = ['derive']169optional = true170version = '1.0.130'171172[dependencies.pallet-aura]173default-features = false174git = "https://github.com/paritytech/substrate"175branch = "polkadot-v0.9.20"176177[dependencies.pallet-balances]178default-features = false179git = "https://github.com/paritytech/substrate"180branch = "polkadot-v0.9.20"181182# Contracts specific packages183# [dependencies.pallet-contracts]184# git = 'https://github.com/paritytech/substrate'185# default-features = false186# branch = 'master'187# version = '4.0.0-dev'188189# [dependencies.pallet-contracts-primitives]190# git = 'https://github.com/paritytech/substrate'191# default-features = false192# branch = 'master'193# version = '4.0.0-dev'194195# [dependencies.pallet-contracts-rpc-runtime-api]196# git = 'https://github.com/paritytech/substrate'197# default-features = false198# branch = 'master'199# version = '4.0.0-dev'200201[dependencies.pallet-randomness-collective-flip]202default-features = false203git = "https://github.com/paritytech/substrate"204branch = "polkadot-v0.9.20"205206[dependencies.pallet-sudo]207default-features = false208git = "https://github.com/paritytech/substrate"209branch = "polkadot-v0.9.20"210211[dependencies.pallet-timestamp]212default-features = false213git = "https://github.com/paritytech/substrate"214branch = "polkadot-v0.9.20"215216[dependencies.pallet-transaction-payment]217default-features = false218git = "https://github.com/paritytech/substrate"219branch = "polkadot-v0.9.20"220221[dependencies.pallet-transaction-payment-rpc-runtime-api]222default-features = false223git = "https://github.com/paritytech/substrate"224branch = "polkadot-v0.9.20"225226[dependencies.pallet-treasury]227default-features = false228git = "https://github.com/paritytech/substrate"229branch = "polkadot-v0.9.20"230231# [dependencies.pallet-vesting]232# default-features = false233# git = 'https://github.com/paritytech/substrate'234# branch = 'master'235236[dependencies.sp-arithmetic]237default-features = false238git = "https://github.com/paritytech/substrate"239branch = "polkadot-v0.9.20"240241[dependencies.sp-api]242default-features = false243git = "https://github.com/paritytech/substrate"244branch = "polkadot-v0.9.20"245246[dependencies.sp-block-builder]247default-features = false248git = "https://github.com/paritytech/substrate"249branch = "polkadot-v0.9.20"250251[dependencies.sp-core]252default-features = false253git = "https://github.com/paritytech/substrate"254branch = "polkadot-v0.9.20"255256[dependencies.sp-consensus-aura]257default-features = false258git = "https://github.com/paritytech/substrate"259branch = "polkadot-v0.9.20"260261[dependencies.sp-inherents]262default-features = false263git = "https://github.com/paritytech/substrate"264branch = "polkadot-v0.9.20"265266[dependencies.sp-io]267default-features = false268git = "https://github.com/paritytech/substrate"269branch = "polkadot-v0.9.20"270271[dependencies.sp-offchain]272default-features = false273git = "https://github.com/paritytech/substrate"274branch = "polkadot-v0.9.20"275276[dependencies.sp-runtime]277default-features = false278git = "https://github.com/paritytech/substrate"279branch = "polkadot-v0.9.20"280281[dependencies.sp-session]282default-features = false283git = "https://github.com/paritytech/substrate"284branch = "polkadot-v0.9.20"285286[dependencies.sp-std]287default-features = false288git = "https://github.com/paritytech/substrate"289branch = "polkadot-v0.9.20"290291[dependencies.sp-transaction-pool]292default-features = false293git = "https://github.com/paritytech/substrate"294branch = "polkadot-v0.9.20"295296[dependencies.sp-version]297default-features = false298git = "https://github.com/paritytech/substrate"299branch = "polkadot-v0.9.20"300301[dependencies.smallvec]302version = '1.6.1'303304################################################################################305# Cumulus dependencies306307[dependencies.parachain-info]308default-features = false309git = "https://github.com/paritytech/cumulus"310branch = "polkadot-v0.9.20"311312[dependencies.cumulus-pallet-aura-ext]313git = "https://github.com/paritytech/cumulus"314branch = "polkadot-v0.9.20"315default-features = false316317[dependencies.cumulus-pallet-parachain-system]318git = "https://github.com/paritytech/cumulus"319branch = "polkadot-v0.9.20"320default-features = false321322[dependencies.cumulus-primitives-core]323git = "https://github.com/paritytech/cumulus"324branch = "polkadot-v0.9.20"325default-features = false326327[dependencies.cumulus-pallet-xcm]328git = "https://github.com/paritytech/cumulus"329branch = "polkadot-v0.9.20"330default-features = false331332[dependencies.cumulus-pallet-dmp-queue]333git = "https://github.com/paritytech/cumulus"334branch = "polkadot-v0.9.20"335default-features = false336337[dependencies.cumulus-pallet-xcmp-queue]338git = "https://github.com/paritytech/cumulus"339branch = "polkadot-v0.9.20"340default-features = false341342[dependencies.cumulus-primitives-utility]343git = "https://github.com/paritytech/cumulus"344branch = "polkadot-v0.9.20"345default-features = false346347[dependencies.cumulus-primitives-timestamp]348git = "https://github.com/paritytech/cumulus"349branch = "polkadot-v0.9.20"350default-features = false351352################################################################################353# Polkadot dependencies354355[dependencies.polkadot-parachain]356git = "https://github.com/paritytech/polkadot"357branch = "release-v0.9.20"358default-features = false359360[dependencies.xcm]361git = "https://github.com/paritytech/polkadot"362branch = "release-v0.9.20"363default-features = false364365[dependencies.xcm-builder]366git = "https://github.com/paritytech/polkadot"367branch = "release-v0.9.20"368default-features = false369370[dependencies.xcm-executor]371git = "https://github.com/paritytech/polkadot"372branch = "release-v0.9.20"373default-features = false374375[dependencies.pallet-xcm]376git = "https://github.com/paritytech/polkadot"377branch = "release-v0.9.20"378default-features = false379380[dependencies.orml-vesting]381git = "https://github.com/uniquenetwork/open-runtime-module-library"382branch = "unique-polkadot-v0.9.20"383version = "0.4.1-dev"384default-features = false385386################################################################################387# local dependencies388389[dependencies]390log = { version = "0.4.16", default-features = false }391unique-runtime-common = { path = "../common", default-features = false }392scale-info = { version = "2.0.1", default-features = false, features = [393 "derive",394] }395derivative = "2.2.0"396pallet-unique = { path = '../../pallets/unique', default-features = false }397up-rpc = { path = "../../primitives/rpc", default-features = false }398fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }399pallet-inflation = { path = '../../pallets/inflation', default-features = false }400up-data-structs = { path = '../../primitives/data-structs', default-features = false }401pallet-common = { default-features = false, path = "../../pallets/common" }402pallet-fungible = { default-features = false, path = "../../pallets/fungible" }403pallet-refungible = { default-features = false, path = "../../pallets/refungible" }404pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }405pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }406# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }407pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.20", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }408pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }409pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }410pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }411pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }412pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }413pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }414pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }415fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }416fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }417418################################################################################419# Build Dependencies420421[build-dependencies.substrate-wasm-builder]422git = "https://github.com/paritytech/substrate"423branch = "polkadot-v0.9.20"1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Opal Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'opal-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version = '0.9.20'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-ethereum/runtime-benchmarks',27 'pallet-evm-migration/runtime-benchmarks',28 'pallet-evm-coder-substrate/runtime-benchmarks',29 'pallet-balances/runtime-benchmarks',30 'pallet-timestamp/runtime-benchmarks',31 'pallet-common/runtime-benchmarks',32 'pallet-fungible/runtime-benchmarks',33 'pallet-refungible/runtime-benchmarks',34 'pallet-nonfungible/runtime-benchmarks',35 'pallet-unique/runtime-benchmarks',36 'pallet-inflation/runtime-benchmarks',37 'pallet-xcm/runtime-benchmarks',38 'sp-runtime/runtime-benchmarks',39 'xcm-builder/runtime-benchmarks',40]41try-runtime = [42 'frame-try-runtime',43 'frame-executive/try-runtime',44 'frame-system/try-runtime',45]46std = [47 'codec/std',48 'cumulus-pallet-aura-ext/std',49 'cumulus-pallet-parachain-system/std',50 'cumulus-pallet-xcm/std',51 'cumulus-pallet-xcmp-queue/std',52 'cumulus-primitives-core/std',53 'cumulus-primitives-utility/std',54 'frame-try-runtime/std',55 'frame-executive/std',56 'frame-support/std',57 'frame-system/std',58 'frame-system-rpc-runtime-api/std',59 'pallet-aura/std',60 'pallet-balances/std',61 # 'pallet-contracts/std',62 # 'pallet-contracts-primitives/std',63 # 'pallet-contracts-rpc-runtime-api/std',64 # 'pallet-contract-helpers/std',65 'pallet-randomness-collective-flip/std',66 'pallet-sudo/std',67 'pallet-timestamp/std',68 'pallet-transaction-payment/std',69 'pallet-transaction-payment-rpc-runtime-api/std',70 'pallet-treasury/std',71 # 'pallet-vesting/std',72 'pallet-evm/std',73 'pallet-evm-migration/std',74 'pallet-evm-contract-helpers/std',75 'pallet-evm-transaction-payment/std',76 'pallet-evm-coder-substrate/std',77 'pallet-ethereum/std',78 'pallet-base-fee/std',79 'fp-rpc/std',80 'up-rpc/std',81 'fp-evm-mapping/std',82 'fp-self-contained/std',83 'parachain-info/std',84 'serde',85 'pallet-inflation/std',86 'pallet-common/std',87 'pallet-fungible/std',88 'pallet-refungible/std',89 'pallet-nonfungible/std',90 'pallet-unique/std',91 'pallet-unq-scheduler/std',92 'pallet-charge-transaction/std',93 'up-data-structs/std',94 'sp-api/std',95 'sp-block-builder/std',96 "sp-consensus-aura/std",97 'sp-core/std',98 'sp-inherents/std',99 'sp-io/std',100 'sp-offchain/std',101 'sp-runtime/std',102 'sp-session/std',103 'sp-std/std',104 'sp-transaction-pool/std',105 'sp-version/std',106 'xcm/std',107 'xcm-builder/std',108 'xcm-executor/std',109 'unique-runtime-common/std',110111 "orml-vesting/std",112]113limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']114115################################################################################116# Substrate Dependencies117118[dependencies.codec]119default-features = false120features = ['derive']121package = 'parity-scale-codec'122version = '3.1.2'123124[dependencies.frame-benchmarking]125default-features = false126git = "https://github.com/paritytech/substrate"127optional = true128branch = "polkadot-v0.9.20"129130[dependencies.frame-try-runtime]131default-features = false132git = 'https://github.com/paritytech/substrate.git'133optional = true134branch = 'polkadot-v0.9.17'135136[dependencies.frame-executive]137default-features = false138git = "https://github.com/paritytech/substrate"139branch = "polkadot-v0.9.20"140141[dependencies.frame-support]142default-features = false143git = "https://github.com/paritytech/substrate"144branch = "polkadot-v0.9.20"145146[dependencies.frame-system]147default-features = false148git = "https://github.com/paritytech/substrate"149branch = "polkadot-v0.9.20"150151[dependencies.frame-system-benchmarking]152default-features = false153git = "https://github.com/paritytech/substrate"154optional = true155branch = "polkadot-v0.9.20"156157[dependencies.frame-system-rpc-runtime-api]158default-features = false159git = "https://github.com/paritytech/substrate"160branch = "polkadot-v0.9.20"161162[dependencies.hex-literal]163optional = true164version = '0.3.3'165166[dependencies.serde]167default-features = false168features = ['derive']169optional = true170version = '1.0.130'171172[dependencies.pallet-aura]173default-features = false174git = "https://github.com/paritytech/substrate"175branch = "polkadot-v0.9.20"176177[dependencies.pallet-balances]178default-features = false179git = "https://github.com/paritytech/substrate"180branch = "polkadot-v0.9.20"181182# Contracts specific packages183# [dependencies.pallet-contracts]184# git = 'https://github.com/paritytech/substrate'185# default-features = false186# branch = 'master'187# version = '4.0.0-dev'188189# [dependencies.pallet-contracts-primitives]190# git = 'https://github.com/paritytech/substrate'191# default-features = false192# branch = 'master'193# version = '4.0.0-dev'194195# [dependencies.pallet-contracts-rpc-runtime-api]196# git = 'https://github.com/paritytech/substrate'197# default-features = false198# branch = 'master'199# version = '4.0.0-dev'200201[dependencies.pallet-randomness-collective-flip]202default-features = false203git = "https://github.com/paritytech/substrate"204branch = "polkadot-v0.9.20"205206[dependencies.pallet-sudo]207default-features = false208git = "https://github.com/paritytech/substrate"209branch = "polkadot-v0.9.20"210211[dependencies.pallet-timestamp]212default-features = false213git = "https://github.com/paritytech/substrate"214branch = "polkadot-v0.9.20"215216[dependencies.pallet-transaction-payment]217default-features = false218git = "https://github.com/paritytech/substrate"219branch = "polkadot-v0.9.20"220221[dependencies.pallet-transaction-payment-rpc-runtime-api]222default-features = false223git = "https://github.com/paritytech/substrate"224branch = "polkadot-v0.9.20"225226[dependencies.pallet-treasury]227default-features = false228git = "https://github.com/paritytech/substrate"229branch = "polkadot-v0.9.20"230231# [dependencies.pallet-vesting]232# default-features = false233# git = 'https://github.com/paritytech/substrate'234# branch = 'master'235236[dependencies.sp-arithmetic]237default-features = false238git = "https://github.com/paritytech/substrate"239branch = "polkadot-v0.9.20"240241[dependencies.sp-api]242default-features = false243git = "https://github.com/paritytech/substrate"244branch = "polkadot-v0.9.20"245246[dependencies.sp-block-builder]247default-features = false248git = "https://github.com/paritytech/substrate"249branch = "polkadot-v0.9.20"250251[dependencies.sp-core]252default-features = false253git = "https://github.com/paritytech/substrate"254branch = "polkadot-v0.9.20"255256[dependencies.sp-consensus-aura]257default-features = false258git = "https://github.com/paritytech/substrate"259branch = "polkadot-v0.9.20"260261[dependencies.sp-inherents]262default-features = false263git = "https://github.com/paritytech/substrate"264branch = "polkadot-v0.9.20"265266[dependencies.sp-io]267default-features = false268git = "https://github.com/paritytech/substrate"269branch = "polkadot-v0.9.20"270271[dependencies.sp-offchain]272default-features = false273git = "https://github.com/paritytech/substrate"274branch = "polkadot-v0.9.20"275276[dependencies.sp-runtime]277default-features = false278git = "https://github.com/paritytech/substrate"279branch = "polkadot-v0.9.20"280281[dependencies.sp-session]282default-features = false283git = "https://github.com/paritytech/substrate"284branch = "polkadot-v0.9.20"285286[dependencies.sp-std]287default-features = false288git = "https://github.com/paritytech/substrate"289branch = "polkadot-v0.9.20"290291[dependencies.sp-transaction-pool]292default-features = false293git = "https://github.com/paritytech/substrate"294branch = "polkadot-v0.9.20"295296[dependencies.sp-version]297default-features = false298git = "https://github.com/paritytech/substrate"299branch = "polkadot-v0.9.20"300301[dependencies.smallvec]302version = '1.6.1'303304################################################################################305# Cumulus dependencies306307[dependencies.parachain-info]308default-features = false309git = "https://github.com/paritytech/cumulus"310branch = "polkadot-v0.9.20"311312[dependencies.cumulus-pallet-aura-ext]313git = "https://github.com/paritytech/cumulus"314branch = "polkadot-v0.9.20"315default-features = false316317[dependencies.cumulus-pallet-parachain-system]318git = "https://github.com/paritytech/cumulus"319branch = "polkadot-v0.9.20"320default-features = false321322[dependencies.cumulus-primitives-core]323git = "https://github.com/paritytech/cumulus"324branch = "polkadot-v0.9.20"325default-features = false326327[dependencies.cumulus-pallet-xcm]328git = "https://github.com/paritytech/cumulus"329branch = "polkadot-v0.9.20"330default-features = false331332[dependencies.cumulus-pallet-dmp-queue]333git = "https://github.com/paritytech/cumulus"334branch = "polkadot-v0.9.20"335default-features = false336337[dependencies.cumulus-pallet-xcmp-queue]338git = "https://github.com/paritytech/cumulus"339branch = "polkadot-v0.9.20"340default-features = false341342[dependencies.cumulus-primitives-utility]343git = "https://github.com/paritytech/cumulus"344branch = "polkadot-v0.9.20"345default-features = false346347[dependencies.cumulus-primitives-timestamp]348git = "https://github.com/paritytech/cumulus"349branch = "polkadot-v0.9.20"350default-features = false351352################################################################################353# Polkadot dependencies354355[dependencies.polkadot-parachain]356git = "https://github.com/paritytech/polkadot"357branch = "release-v0.9.20"358default-features = false359360[dependencies.xcm]361git = "https://github.com/paritytech/polkadot"362branch = "release-v0.9.20"363default-features = false364365[dependencies.xcm-builder]366git = "https://github.com/paritytech/polkadot"367branch = "release-v0.9.20"368default-features = false369370[dependencies.xcm-executor]371git = "https://github.com/paritytech/polkadot"372branch = "release-v0.9.20"373default-features = false374375[dependencies.pallet-xcm]376git = "https://github.com/paritytech/polkadot"377branch = "release-v0.9.20"378default-features = false379380[dependencies.orml-vesting]381git = "https://github.com/uniquenetwork/open-runtime-module-library"382branch = "unique-polkadot-v0.9.20"383version = "0.4.1-dev"384default-features = false385386################################################################################387# local dependencies388389[dependencies]390log = { version = "0.4.16", default-features = false }391unique-runtime-common = { path = "../common", default-features = false }392scale-info = { version = "2.0.1", default-features = false, features = [393 "derive",394] }395derivative = "2.2.0"396pallet-unique = { path = '../../pallets/unique', default-features = false }397up-rpc = { path = "../../primitives/rpc", default-features = false }398fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }399pallet-inflation = { path = '../../pallets/inflation', default-features = false }400up-data-structs = { path = '../../primitives/data-structs', default-features = false }401pallet-common = { default-features = false, path = "../../pallets/common" }402pallet-structure = { default-features = false, path = "../../pallets/structure" }403pallet-fungible = { default-features = false, path = "../../pallets/fungible" }404pallet-refungible = { default-features = false, path = "../../pallets/refungible" }405pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }406pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }407# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }408pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.20", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }409pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }410pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }411pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }412pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }413pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }414pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }415pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }416fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }417fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.20" }418419################################################################################420# Build Dependencies421422[build-dependencies.substrate-wasm-builder]423git = "https://github.com/paritytech/substrate"424branch = "polkadot-v0.9.20"runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -886,7 +886,6 @@
impl pallet_structure::Config for Runtime {
type Event = Event;
type Call = Call;
- type WeightInfo = pallet_structure::weights::SubstrateWeight<Self>;
}
impl pallet_fungible::Config for Runtime {
@@ -1009,6 +1008,7 @@
Fungible: pallet_fungible::{Pallet, Storage} = 67,
Refungible: pallet_refungible::{Pallet, Storage} = 68,
Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
+ Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
// Frontier
EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -84,6 +84,7 @@
'serde',
'pallet-inflation/std',
'pallet-common/std',
+ 'pallet-structure/std',
'pallet-fungible/std',
'pallet-refungible/std',
'pallet-nonfungible/std',
@@ -399,6 +400,7 @@
pallet-inflation = { path = '../../pallets/inflation', default-features = false }
up-data-structs = { path = '../../primitives/data-structs', default-features = false }
pallet-common = { default-features = false, path = "../../pallets/common" }
+pallet-structure = { default-features = false, path = "../../pallets/structure" }
pallet-fungible = { default-features = false, path = "../../pallets/fungible" }
pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -84,6 +84,7 @@
'serde',
'pallet-inflation/std',
'pallet-common/std',
+ 'pallet-structure/std',
'pallet-fungible/std',
'pallet-refungible/std',
'pallet-nonfungible/std',
@@ -398,6 +399,7 @@
pallet-inflation = { path = '../../pallets/inflation', default-features = false }
up-data-structs = { path = '../../primitives/data-structs', default-features = false }
pallet-common = { default-features = false, path = "../../pallets/common" }
+pallet-structure = { default-features = false, path = "../../pallets/structure" }
pallet-fungible = { default-features = false, path = "../../pallets/fungible" }
pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }