difftreelog
feat Separate rpc calls to own group
in: master
31 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -113,6 +113,20 @@
checksum = "508b352bb5c066aac251f6daf6b36eccd03e8a88e8081cd44959ea277a3af9a8"
[[package]]
+name = "app-promotion-rpc"
+version = "0.1.0"
+dependencies = [
+ "pallet-common",
+ "pallet-evm",
+ "parity-scale-codec 3.1.5",
+ "sp-api",
+ "sp-core",
+ "sp-runtime",
+ "sp-std",
+ "up-data-structs",
+]
+
+[[package]]
name = "approx"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5127,6 +5141,7 @@
name = "opal-runtime"
version = "0.9.27"
dependencies = [
+ "app-promotion-rpc",
"cumulus-pallet-aura-ext",
"cumulus-pallet-dmp-queue",
"cumulus-pallet-parachain-system",
@@ -8358,6 +8373,7 @@
name = "quartz-runtime"
version = "0.9.27"
dependencies = [
+ "app-promotion-rpc",
"cumulus-pallet-aura-ext",
"cumulus-pallet-dmp-queue",
"cumulus-pallet-parachain-system",
@@ -8381,6 +8397,7 @@
"hex-literal",
"log",
"orml-vesting",
+ "pallet-app-promotion",
"pallet-aura",
"pallet-balances",
"pallet-base-fee",
@@ -12132,6 +12149,7 @@
version = "0.1.3"
dependencies = [
"anyhow",
+ "app-promotion-rpc",
"jsonrpsee",
"pallet-common",
"pallet-evm",
@@ -12210,6 +12228,7 @@
name = "unique-node"
version = "0.9.27"
dependencies = [
+ "app-promotion-rpc",
"clap",
"cumulus-client-cli",
"cumulus-client-collator",
@@ -12298,6 +12317,7 @@
name = "unique-rpc"
version = "0.1.1"
dependencies = [
+ "app-promotion-rpc",
"fc-db",
"fc-mapping-sync",
"fc-rpc",
@@ -12347,6 +12367,7 @@
name = "unique-runtime"
version = "0.9.27"
dependencies = [
+ "app-promotion-rpc",
"cumulus-pallet-aura-ext",
"cumulus-pallet-dmp-queue",
"cumulus-pallet-parachain-system",
@@ -12370,6 +12391,7 @@
"hex-literal",
"log",
"orml-vesting",
+ "pallet-app-promotion",
"pallet-aura",
"pallet-balances",
"pallet-base-fee",
client/rpc/Cargo.tomldiffbeforeafterboth--- a/client/rpc/Cargo.toml
+++ b/client/rpc/Cargo.toml
@@ -8,6 +8,7 @@
pallet-common = { default-features = false, path = '../../pallets/common' }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
up-rpc = { path = "../../primitives/rpc" }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc"}
rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
codec = { package = "parity-scale-codec", version = "3.1.2" }
jsonrpsee = { version = "0.14.0", features = ["server", "macros"] }
client/rpc/src/lib.rsdiffbeforeafterboth--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -31,6 +31,7 @@
use sp_api::{BlockId, BlockT, ProvideRuntimeApi, ApiExt};
use sp_blockchain::HeaderBackend;
use up_rpc::UniqueApi as UniqueRuntimeApi;
+use app_promotion_rpc::AppPromotionApi as AppPromotionRuntimeApi;
// RMRK
use rmrk_rpc::RmrkApi as RmrkRuntimeApi;
@@ -38,6 +39,7 @@
RmrkCollectionId, RmrkNftId, RmrkBaseId, RmrkNftChild, RmrkThemeName, RmrkResourceId,
};
+pub use app_promotion_unique_rpc::AppPromotionApiServer;
pub use rmrk_unique_rpc::RmrkApiServer;
#[rpc(server)]
@@ -244,39 +246,48 @@
token_id: TokenId,
at: Option<BlockHash>,
) -> Result<Option<String>>;
+}
+
+mod app_promotion_unique_rpc {
+ use super::*;
+
+ #[rpc(server)]
+ #[async_trait]
+ pub trait AppPromotionApi<BlockHash, BlockNumber, CrossAccountId, AccountId> {
+ /// Returns the total amount of staked tokens.
+ #[method(name = "appPromotion_totalStaked")]
+ fn total_staked(&self, staker: Option<CrossAccountId>, at: Option<BlockHash>)
+ -> Result<String>;
- /// Returns the total amount of staked tokens.
- #[method(name = "unique_totalStaked")]
- fn total_staked(&self, staker: Option<CrossAccountId>, at: Option<BlockHash>)
- -> Result<String>;
+ ///Returns the total amount of staked tokens per block when staked.
+ #[method(name = "appPromotion_totalStakedPerBlock")]
+ fn total_staked_per_block(
+ &self,
+ staker: CrossAccountId,
+ at: Option<BlockHash>,
+ ) -> Result<Vec<(BlockNumber, String)>>;
- ///Returns the total amount of staked tokens per block when staked.
- #[method(name = "unique_totalStakedPerBlock")]
- fn total_staked_per_block(
- &self,
- staker: CrossAccountId,
- at: Option<BlockHash>,
- ) -> Result<Vec<(BlockNumber, String)>>;
+ /// Returns the total amount locked by staking tokens.
+ #[method(name = "appPromotion_totalStakingLocked")]
+ fn total_staking_locked(&self, staker: CrossAccountId, at: Option<BlockHash>)
+ -> Result<String>;
- /// Returns the total amount locked by staking tokens.
- #[method(name = "unique_totalStakingLocked")]
- fn total_staking_locked(&self, staker: CrossAccountId, at: Option<BlockHash>)
- -> Result<String>;
+ /// Returns the total amount of tokens pending withdrawal from staking.
+ #[method(name = "appPromotion_pendingUnstake")]
+ fn pending_unstake(
+ &self,
+ staker: Option<CrossAccountId>,
+ at: Option<BlockHash>,
+ ) -> Result<String>;
- /// Returns the total amount of tokens pending withdrawal from staking.
- #[method(name = "unique_pendingUnstake")]
- fn pending_unstake(
- &self,
- staker: Option<CrossAccountId>,
- at: Option<BlockHash>,
- ) -> Result<String>;
- /// Returns the total amount of tokens pending withdrawal from staking per block.
- #[method(name = "unique_pendingUnstakePerBlock")]
- fn pending_unstake_per_block(
- &self,
- staker: CrossAccountId,
- at: Option<BlockHash>,
- ) -> Result<Vec<(BlockNumber, String)>>;
+ /// Returns the total amount of tokens pending withdrawal from staking per block.
+ #[method(name = "appPromotion_pendingUnstakePerBlock")]
+ fn pending_unstake_per_block(
+ &self,
+ staker: CrossAccountId,
+ at: Option<BlockHash>,
+ ) -> Result<Vec<(BlockNumber, String)>>;
+ }
}
mod rmrk_unique_rpc {
@@ -415,6 +426,20 @@
}
}
+pub struct AppPromotion<C, P> {
+ client: Arc<C>,
+ _marker: std::marker::PhantomData<P>,
+}
+
+impl<C, P> AppPromotion<C, P> {
+ pub fn new(client: Arc<C>) -> Self {
+ Self {
+ client,
+ _marker: Default::default(),
+ }
+ }
+}
+
pub struct Rmrk<C, P> {
client: Arc<C>,
_marker: std::marker::PhantomData<P>,
@@ -474,6 +499,12 @@
};
}
+macro_rules! app_promotion_api {
+ () => {
+ dyn AppPromotionRuntimeApi<Block, BlockNumber, CrossAccountId, AccountId>
+ };
+}
+
macro_rules! rmrk_api {
() => {
dyn RmrkRuntimeApi<Block, AccountId, CollectionInfo, NftInfo, ResourceInfo, PropertyInfo, BaseInfo, PartType, Theme>
@@ -556,7 +587,20 @@
pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option<CollectionLimits>, unique_api);
pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option<String> => |o| o.map(|number| number.to_string()) , unique_api);
pass_method!(token_owners(collection: CollectionId, token: TokenId) -> Vec<CrossAccountId>, unique_api);
- pass_method!(total_staked(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), unique_api);
+}
+
+impl<C, Block, BlockNumber, CrossAccountId, AccountId>
+ app_promotion_unique_rpc::AppPromotionApiServer<<Block as BlockT>::Hash, BlockNumber, CrossAccountId, AccountId>
+ for AppPromotion<C, Block>
+where
+ Block: BlockT,
+ BlockNumber: Decode + Member + AtLeast32BitUnsigned,
+ AccountId: Decode,
+ C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,
+ C::Api: AppPromotionRuntimeApi<Block, BlockNumber, CrossAccountId, AccountId>,
+ CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,
+{
+ pass_method!(total_staked(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), app_promotion_api);
pass_method!(total_staked_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> =>
|v| v
.into_iter()
node/cli/Cargo.tomldiffbeforeafterboth--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -318,6 +318,7 @@
pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
unique-rpc = { default-features = false, path = "../rpc" }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false}
rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
[features]
node/cli/src/service.rsdiffbeforeafterboth--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -364,6 +364,7 @@
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
+ sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>
+ up_rpc::UniqueApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>
+ + app_promotion_rpc::AppPromotionApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>
+ rmrk_rpc::RmrkApi<
Block,
AccountId,
@@ -665,6 +666,7 @@
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
+ sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>
+ up_rpc::UniqueApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>
+ + app_promotion_rpc::AppPromotionApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>
+ rmrk_rpc::RmrkApi<
Block,
AccountId,
@@ -809,6 +811,7 @@
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
+ sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>
+ up_rpc::UniqueApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>
+ + app_promotion_rpc::AppPromotionApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>
+ rmrk_rpc::RmrkApi<
Block,
AccountId,
node/rpc/Cargo.tomldiffbeforeafterboth--- a/node/rpc/Cargo.toml
+++ b/node/rpc/Cargo.toml
@@ -53,6 +53,7 @@
pallet-unique = { path = "../../pallets/unique" }
uc-rpc = { path = "../../client/rpc" }
up-rpc = { path = "../../primitives/rpc" }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc"}
rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
node/rpc/src/lib.rsdiffbeforeafterboth--- a/node/rpc/src/lib.rs
+++ b/node/rpc/src/lib.rs
@@ -38,6 +38,7 @@
use sp_block_builder::BlockBuilder;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
use sc_service::TransactionPool;
+use uc_rpc::AppPromotion;
use std::{collections::BTreeMap, sync::Arc};
use up_common::types::opaque::{Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance};
@@ -147,6 +148,7 @@
C::Api: fp_rpc::ConvertTransactionRuntimeApi<Block>,
C::Api:
up_rpc::UniqueApi<Block, BlockNumber, <R as RuntimeInstance>::CrossAccountId, AccountId>,
+ C::Api: app_promotion_rpc::AppPromotionApi<Block, BlockNumber, <R as RuntimeInstance>::CrossAccountId, AccountId>,
C::Api: rmrk_rpc::RmrkApi<
Block,
AccountId,
@@ -171,6 +173,7 @@
EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer,
};
use uc_rpc::{UniqueApiServer, Unique};
+ use uc_rpc::{AppPromotionApiServer, AppPromotion};
#[cfg(not(feature = "unique-runtime"))]
use uc_rpc::{RmrkApiServer, Rmrk};
@@ -229,6 +232,9 @@
io.merge(Unique::new(client.clone()).into_rpc())?;
+ // #[cfg(not(feature = "unique-runtime"))]
+ io.merge(AppPromotion::new(client.clone()).into_rpc())?;
+
#[cfg(not(feature = "unique-runtime"))]
io.merge(Rmrk::new(client.clone()).into_rpc())?;
primitives/app_promotion_rpc/CHANGELOG.mddiffbeforeafterboth--- /dev/null
+++ b/primitives/app_promotion_rpc/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+
+<!-- bureaucrate goes here -->
primitives/app_promotion_rpc/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/primitives/app_promotion_rpc/Cargo.toml
@@ -0,0 +1,29 @@
+[package]
+name = "app-promotion-rpc"
+version = "0.1.0"
+license = "GPLv3"
+edition = "2021"
+
+[dependencies]
+pallet-common = { default-features = false, path = '../../pallets/common' }
+up-data-structs = { default-features = false, path = '../data-structs' }
+codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [
+ "derive",
+] }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+
+[features]
+default = ["std"]
+std = [
+ "codec/std",
+ "sp-core/std",
+ "sp-std/std",
+ "sp-api/std",
+ "sp-runtime/std",
+ "pallet-common/std",
+ "up-data-structs/std",
+]
primitives/app_promotion_rpc/src/lib.rsdiffbeforeafterboth--- /dev/null
+++ b/primitives/app_promotion_rpc/src/lib.rs
@@ -0,0 +1,47 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+#![cfg_attr(not(feature = "std"), no_std)]
+
+use up_data_structs::{
+ CollectionId, TokenId, RpcCollection, CollectionStats, CollectionLimits, Property,
+ PropertyKeyPermission, TokenData, TokenChild,
+};
+
+use sp_std::vec::Vec;
+use codec::Decode;
+use sp_runtime::{
+ DispatchError,
+ traits::{AtLeast32BitUnsigned, Member},
+};
+
+type Result<T> = core::result::Result<T, DispatchError>;
+
+sp_api::decl_runtime_apis! {
+ #[api_version(2)]
+ /// Trait for generate rpc.
+ pub trait AppPromotionApi<BlockNumber ,CrossAccountId, AccountId> where
+ BlockNumber: Decode + Member + AtLeast32BitUnsigned,
+ AccountId: Decode,
+ CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,
+ {
+ fn total_staked(staker: Option<CrossAccountId>) -> Result<u128>;
+ fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;
+ fn total_staking_locked(staker: CrossAccountId) -> Result<u128>;
+ fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128>;
+ fn pending_unstake_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;
+ }
+}
primitives/rpc/src/lib.rsdiffbeforeafterboth--- a/primitives/rpc/src/lib.rs
+++ b/primitives/rpc/src/lib.rs
@@ -127,11 +127,5 @@
fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result<Option<u128>>;
fn token_owners(collection: CollectionId, token: TokenId) -> Result<Vec<CrossAccountId>>;
- fn total_staked(staker: Option<CrossAccountId>) -> Result<u128>;
- fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;
- fn total_staking_locked(staker: CrossAccountId) -> Result<u128>;
- fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128>;
- fn pending_unstake_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;
-
}
}
runtime/common/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -187,25 +187,47 @@
fn total_pieces(collection: CollectionId, token_id: TokenId) -> Result<Option<u128>, DispatchError> {
dispatch_unique_runtime!(collection.total_pieces(token_id))
}
+ }
+ impl app_promotion_rpc::AppPromotionApi<Block, BlockNumber, CrossAccountId, AccountId> for Runtime {
fn total_staked(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {
- Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked(staker).unwrap_or_default())
- }
+ #[cfg(not(feature = "app-promotion"))]
+ return unsupported!();
+ #[cfg(feature = "app-promotion")]
+ return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked(staker).unwrap_or_default());
+ }
+
fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>, DispatchError> {
- Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked_per_block(staker))
+ #[cfg(not(feature = "app-promotion"))]
+ return unsupported!();
+
+ #[cfg(feature = "app-promotion")]
+ return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked_per_block(staker));
}
fn total_staking_locked(staker: CrossAccountId) -> Result<u128, DispatchError> {
- Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_locked_balance(staker))
+ #[cfg(not(feature = "app-promotion"))]
+ return unsupported!();
+
+ #[cfg(feature = "app-promotion")]
+ return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_locked_balance(staker));
}
fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {
- Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_pending_unstake(staker))
+ #[cfg(not(feature = "app-promotion"))]
+ return unsupported!();
+
+ #[cfg(feature = "app-promotion")]
+ return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_pending_unstake(staker));
}
fn pending_unstake_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>, DispatchError> {
- Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_pending_unstake_per_block(staker))
+ #[cfg(not(feature = "app-promotion"))]
+ return unsupported!();
+
+ #[cfg(feature = "app-promotion")]
+ return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_pending_unstake_per_block(staker))
}
}
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -83,6 +83,7 @@
'pallet-base-fee/std',
'fp-rpc/std',
'up-rpc/std',
+ 'app-promotion-rpc/std',
'fp-evm-mapping/std',
'fp-self-contained/std',
'parachain-info/std',
@@ -414,6 +415,7 @@
derivative = "2.2.0"
pallet-unique = { path = '../../pallets/unique', default-features = false }
up-rpc = { path = "../../primitives/rpc", default-features = false }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false}
rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }
fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
pallet-inflation = { path = '../../pallets/inflation', default-features = false }
runtime/quartz/Cargo.tomldiffbeforeafterboth1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Quartz Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'quartz-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version = '0.9.27'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std', 'quartz-runtime']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-structure/runtime-benchmarks',33 'pallet-fungible/runtime-benchmarks',34 'pallet-refungible/runtime-benchmarks',35 'pallet-nonfungible/runtime-benchmarks',36 'pallet-proxy-rmrk-core/runtime-benchmarks',37 'pallet-proxy-rmrk-equip/runtime-benchmarks',38 'pallet-unique/runtime-benchmarks',39 'pallet-inflation/runtime-benchmarks',40 'pallet-unique-scheduler/runtime-benchmarks',41 'pallet-xcm/runtime-benchmarks',42 'sp-runtime/runtime-benchmarks',43 'xcm-builder/runtime-benchmarks',44]45try-runtime = [46 'frame-try-runtime',47 'frame-executive/try-runtime',48 'frame-system/try-runtime',49]50std = [51 'codec/std',52 'cumulus-pallet-aura-ext/std',53 'cumulus-pallet-parachain-system/std',54 'cumulus-pallet-xcm/std',55 'cumulus-pallet-xcmp-queue/std',56 'cumulus-primitives-core/std',57 'cumulus-primitives-utility/std',58 'frame-try-runtime/std',59 'frame-executive/std',60 'frame-support/std',61 'frame-system/std',62 'frame-system-rpc-runtime-api/std',63 'pallet-aura/std',64 'pallet-balances/std',65 # 'pallet-contracts/std',66 # 'pallet-contracts-primitives/std',67 # 'pallet-contracts-rpc-runtime-api/std',68 # 'pallet-contract-helpers/std',69 'pallet-randomness-collective-flip/std',70 'pallet-sudo/std',71 'pallet-timestamp/std',72 'pallet-transaction-payment/std',73 'pallet-transaction-payment-rpc-runtime-api/std',74 'pallet-treasury/std',75 # 'pallet-vesting/std',76 'pallet-evm/std',77 'pallet-evm-migration/std',78 'pallet-evm-contract-helpers/std',79 'pallet-evm-transaction-payment/std',80 'pallet-evm-coder-substrate/std',81 'pallet-ethereum/std',82 'pallet-base-fee/std',83 'fp-rpc/std',84 'up-rpc/std',85 'fp-evm-mapping/std',86 'fp-self-contained/std',87 'parachain-info/std',88 'serde',89 'pallet-inflation/std',90 'pallet-configuration/std',91 'pallet-common/std',92 'pallet-structure/std',93 'pallet-fungible/std',94 'pallet-refungible/std',95 'pallet-nonfungible/std',96 'pallet-proxy-rmrk-core/std',97 'pallet-proxy-rmrk-equip/std',98 'pallet-unique/std',99 'pallet-unique-scheduler/std',100 'pallet-charge-transaction/std',101 'up-data-structs/std',102 'sp-api/std',103 'sp-block-builder/std',104 "sp-consensus-aura/std",105 'sp-core/std',106 'sp-inherents/std',107 'sp-io/std',108 'sp-offchain/std',109 'sp-runtime/std',110 'sp-session/std',111 'sp-std/std',112 'sp-transaction-pool/std',113 'sp-version/std',114 'xcm/std',115 'xcm-builder/std',116 'xcm-executor/std',117 'up-common/std',118119 "orml-vesting/std",120]121limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']122quartz-runtime = []123124refungible = []125scheduler = []126rmrk = []127128################################################################################129# Substrate Dependencies130131[dependencies.codec]132default-features = false133features = ['derive']134package = 'parity-scale-codec'135version = '3.1.2'136137[dependencies.frame-benchmarking]138default-features = false139git = "https://github.com/paritytech/substrate"140optional = true141branch = "polkadot-v0.9.27"142143[dependencies.frame-try-runtime]144default-features = false145git = "https://github.com/paritytech/substrate"146optional = true147branch = "polkadot-v0.9.27"148149[dependencies.frame-executive]150default-features = false151git = "https://github.com/paritytech/substrate"152branch = "polkadot-v0.9.27"153154[dependencies.frame-support]155default-features = false156git = "https://github.com/paritytech/substrate"157branch = "polkadot-v0.9.27"158159[dependencies.frame-system]160default-features = false161git = "https://github.com/paritytech/substrate"162branch = "polkadot-v0.9.27"163164[dependencies.frame-system-benchmarking]165default-features = false166git = "https://github.com/paritytech/substrate"167optional = true168branch = "polkadot-v0.9.27"169170[dependencies.frame-system-rpc-runtime-api]171default-features = false172git = "https://github.com/paritytech/substrate"173branch = "polkadot-v0.9.27"174175[dependencies.hex-literal]176optional = true177version = '0.3.3'178179[dependencies.serde]180default-features = false181features = ['derive']182optional = true183version = '1.0.130'184185[dependencies.pallet-aura]186default-features = false187git = "https://github.com/paritytech/substrate"188branch = "polkadot-v0.9.27"189190[dependencies.pallet-balances]191default-features = false192git = "https://github.com/paritytech/substrate"193branch = "polkadot-v0.9.27"194195# Contracts specific packages196# [dependencies.pallet-contracts]197# git = 'https://github.com/paritytech/substrate'198# default-features = false199# branch = 'master'200# version = '4.0.0-dev'201202# [dependencies.pallet-contracts-primitives]203# git = 'https://github.com/paritytech/substrate'204# default-features = false205# branch = 'master'206# version = '4.0.0-dev'207208# [dependencies.pallet-contracts-rpc-runtime-api]209# git = 'https://github.com/paritytech/substrate'210# default-features = false211# branch = 'master'212# version = '4.0.0-dev'213214[dependencies.pallet-randomness-collective-flip]215default-features = false216git = "https://github.com/paritytech/substrate"217branch = "polkadot-v0.9.27"218219[dependencies.pallet-sudo]220default-features = false221git = "https://github.com/paritytech/substrate"222branch = "polkadot-v0.9.27"223224[dependencies.pallet-timestamp]225default-features = false226git = "https://github.com/paritytech/substrate"227branch = "polkadot-v0.9.27"228229[dependencies.pallet-transaction-payment]230default-features = false231git = "https://github.com/paritytech/substrate"232branch = "polkadot-v0.9.27"233234[dependencies.pallet-transaction-payment-rpc-runtime-api]235default-features = false236git = "https://github.com/paritytech/substrate"237branch = "polkadot-v0.9.27"238239[dependencies.pallet-treasury]240default-features = false241git = "https://github.com/paritytech/substrate"242branch = "polkadot-v0.9.27"243244# [dependencies.pallet-vesting]245# default-features = false246# git = 'https://github.com/paritytech/substrate'247# branch = 'master'248249[dependencies.sp-arithmetic]250default-features = false251git = "https://github.com/paritytech/substrate"252branch = "polkadot-v0.9.27"253254[dependencies.sp-api]255default-features = false256git = "https://github.com/paritytech/substrate"257branch = "polkadot-v0.9.27"258259[dependencies.sp-block-builder]260default-features = false261git = "https://github.com/paritytech/substrate"262branch = "polkadot-v0.9.27"263264[dependencies.sp-core]265default-features = false266git = "https://github.com/paritytech/substrate"267branch = "polkadot-v0.9.27"268269[dependencies.sp-consensus-aura]270default-features = false271git = "https://github.com/paritytech/substrate"272branch = "polkadot-v0.9.27"273274[dependencies.sp-inherents]275default-features = false276git = "https://github.com/paritytech/substrate"277branch = "polkadot-v0.9.27"278279[dependencies.sp-io]280default-features = false281git = "https://github.com/paritytech/substrate"282branch = "polkadot-v0.9.27"283284[dependencies.sp-offchain]285default-features = false286git = "https://github.com/paritytech/substrate"287branch = "polkadot-v0.9.27"288289[dependencies.sp-runtime]290default-features = false291git = "https://github.com/paritytech/substrate"292branch = "polkadot-v0.9.27"293294[dependencies.sp-session]295default-features = false296git = "https://github.com/paritytech/substrate"297branch = "polkadot-v0.9.27"298299[dependencies.sp-std]300default-features = false301git = "https://github.com/paritytech/substrate"302branch = "polkadot-v0.9.27"303304[dependencies.sp-transaction-pool]305default-features = false306git = "https://github.com/paritytech/substrate"307branch = "polkadot-v0.9.27"308309[dependencies.sp-version]310default-features = false311git = "https://github.com/paritytech/substrate"312branch = "polkadot-v0.9.27"313314[dependencies.smallvec]315version = '1.6.1'316317################################################################################318# Cumulus dependencies319320[dependencies.parachain-info]321default-features = false322git = "https://github.com/paritytech/cumulus"323branch = "polkadot-v0.9.27"324325[dependencies.cumulus-pallet-aura-ext]326git = "https://github.com/paritytech/cumulus"327branch = "polkadot-v0.9.27"328default-features = false329330[dependencies.cumulus-pallet-parachain-system]331git = "https://github.com/paritytech/cumulus"332branch = "polkadot-v0.9.27"333default-features = false334335[dependencies.cumulus-primitives-core]336git = "https://github.com/paritytech/cumulus"337branch = "polkadot-v0.9.27"338default-features = false339340[dependencies.cumulus-pallet-xcm]341git = "https://github.com/paritytech/cumulus"342branch = "polkadot-v0.9.27"343default-features = false344345[dependencies.cumulus-pallet-dmp-queue]346git = "https://github.com/paritytech/cumulus"347branch = "polkadot-v0.9.27"348default-features = false349350[dependencies.cumulus-pallet-xcmp-queue]351git = "https://github.com/paritytech/cumulus"352branch = "polkadot-v0.9.27"353default-features = false354355[dependencies.cumulus-primitives-utility]356git = "https://github.com/paritytech/cumulus"357branch = "polkadot-v0.9.27"358default-features = false359360[dependencies.cumulus-primitives-timestamp]361git = "https://github.com/paritytech/cumulus"362branch = "polkadot-v0.9.27"363default-features = false364365################################################################################366# Polkadot dependencies367368[dependencies.polkadot-parachain]369git = "https://github.com/paritytech/polkadot"370branch = "release-v0.9.27"371default-features = false372373[dependencies.xcm]374git = "https://github.com/paritytech/polkadot"375branch = "release-v0.9.27"376default-features = false377378[dependencies.xcm-builder]379git = "https://github.com/paritytech/polkadot"380branch = "release-v0.9.27"381default-features = false382383[dependencies.xcm-executor]384git = "https://github.com/paritytech/polkadot"385branch = "release-v0.9.27"386default-features = false387388[dependencies.pallet-xcm]389git = "https://github.com/paritytech/polkadot"390branch = "release-v0.9.27"391default-features = false392393[dependencies.orml-vesting]394git = "https://github.com/open-web3-stack/open-runtime-module-library"395branch = "polkadot-v0.9.27"396version = "0.4.1-dev"397default-features = false398399################################################################################400# RMRK dependencies401402# todo git403[dependencies.rmrk-rpc]404default-features = false405path = "../../primitives/rmrk-rpc"406407################################################################################408# local dependencies409410[dependencies]411log = { version = "0.4.16", default-features = false }412up-common = { path = "../../primitives/common", default-features = false }413scale-info = { version = "2.0.1", default-features = false, features = [414 "derive",415] }416derivative = "2.2.0"417pallet-unique = { path = '../../pallets/unique', default-features = false }418up-rpc = { path = "../../primitives/rpc", default-features = false }419fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }420pallet-inflation = { path = '../../pallets/inflation', default-features = false }421up-data-structs = { path = '../../primitives/data-structs', default-features = false }422pallet-configuration = { default-features = false, path = "../../pallets/configuration" }423pallet-common = { default-features = false, path = "../../pallets/common" }424pallet-structure = { default-features = false, path = "../../pallets/structure" }425pallet-fungible = { default-features = false, path = "../../pallets/fungible" }426pallet-refungible = { default-features = false, path = "../../pallets/refungible" }427pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }428pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }429pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }430pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }431# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }432pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }433pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }434pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }435pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }436pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }437pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }438pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }439pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }440fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }441fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }442evm-coder = { default-features = false, path = '../../crates/evm-coder' }443up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }444445################################################################################446# Build Dependencies447448[build-dependencies.substrate-wasm-builder]449git = "https://github.com/paritytech/substrate"450branch = "polkadot-v0.9.27"runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -83,6 +83,7 @@
'pallet-base-fee/std',
'fp-rpc/std',
'up-rpc/std',
+ 'app-promotion-rpc/std',
'fp-evm-mapping/std',
'fp-self-contained/std',
'parachain-info/std',
@@ -409,8 +410,10 @@
derivative = "2.2.0"
pallet-unique = { path = '../../pallets/unique', default-features = false }
up-rpc = { path = "../../primitives/rpc", default-features = false }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false}
rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }
pallet-inflation = { path = '../../pallets/inflation', default-features = false }
+pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }
up-data-structs = { path = '../../primitives/data-structs', default-features = false }
pallet-configuration = { default-features = false, path = "../../pallets/configuration" }
pallet-common = { default-features = false, path = "../../pallets/common" }
tests/src/interfaces/appPromotion/definitions.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/appPromotion/definitions.ts
@@ -0,0 +1,66 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+type RpcParam = {
+ name: string;
+ type: string;
+ isOptional?: true;
+};
+
+const CROSS_ACCOUNT_ID_TYPE = 'PalletEvmAccountBasicCrossAccountIdRepr';
+
+const collectionParam = {name: 'collection', type: 'u32'};
+const tokenParam = {name: 'tokenId', type: 'u32'};
+const propertyKeysParam = {name: 'propertyKeys', type: 'Vec<String>', isOptional: true};
+const crossAccountParam = (name = 'account') => ({name, type: CROSS_ACCOUNT_ID_TYPE});
+const atParam = {name: 'at', type: 'Hash', isOptional: true};
+
+const fun = (description: string, params: RpcParam[], type: string) => ({
+ description,
+ params: [...params, atParam],
+ type,
+});
+
+export default {
+ types: {},
+ rpc: {
+ totalStaked: fun(
+ 'Returns the total amount of staked tokens',
+ [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}],
+ 'u128',
+ ),
+ totalStakedPerBlock: fun(
+ 'Returns the total amount of staked tokens per block when staked',
+ [crossAccountParam('staker')],
+ 'Vec<(u32, u128)>',
+ ),
+ totalStakingLocked: fun(
+ 'Return the total amount locked by staking tokens',
+ [crossAccountParam('staker')],
+ 'u128',
+ ),
+ pendingUnstake: fun(
+ 'Returns the total amount of unstaked tokens',
+ [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}],
+ 'u128',
+ ),
+ pendingUnstakePerBlock: fun(
+ 'Returns the total amount of unstaked tokens per block',
+ [crossAccountParam('staker')],
+ 'Vec<(u32, u128)>',
+ ),
+ },
+};
tests/src/interfaces/appPromotion/index.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/appPromotion/index.ts
@@ -0,0 +1,4 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+export * from './types';
tests/src/interfaces/appPromotion/types.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/appPromotion/types.ts
@@ -0,0 +1,4 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+export type PHANTOM_APPPROMOTION = 'appPromotion';
tests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-errors.ts
+++ b/tests/src/interfaces/augment-api-errors.ts
@@ -269,7 +269,7 @@
**/
NoPendingSponsor: AugmentedError<ApiType>;
/**
- * This method is only executable by owner.
+ * This method is only executable by contract owner
**/
NoPermission: AugmentedError<ApiType>;
/**
@@ -278,7 +278,13 @@
[key: string]: AugmentedError<ApiType>;
};
evmMigration: {
+ /**
+ * Migration of this account is not yet started, or already finished.
+ **/
AccountIsNotMigrating: AugmentedError<ApiType>;
+ /**
+ * Can only migrate to empty address.
+ **/
AccountNotEmpty: AugmentedError<ApiType>;
/**
* Generic error
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -335,7 +335,7 @@
*
* Currently used to store RMRK data.
**/
- tokenAuxProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: UpDataStructsPropertyScope | 'None' | 'Rmrk' | 'Eth' | number | Uint8Array, arg4: Bytes | string | Uint8Array) => Observable<Option<Bytes>>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry<ApiType, [u32, u32, UpDataStructsPropertyScope, Bytes]>;
+ tokenAuxProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: UpDataStructsPropertyScope | 'None' | 'Rmrk' | number | Uint8Array, arg4: Bytes | string | Uint8Array) => Observable<Option<Bytes>>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry<ApiType, [u32, u32, UpDataStructsPropertyScope, Bytes]>;
/**
* Used to enumerate token's children.
**/
tests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-rpc.ts
+++ b/tests/src/interfaces/augment-api-rpc.ts
@@ -35,6 +35,28 @@
declare module '@polkadot/rpc-core/types/jsonrpc' {
interface RpcInterface {
+ appPromotion: {
+ /**
+ * Returns the total amount of unstaked tokens
+ **/
+ pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
+ /**
+ * Returns the total amount of unstaked tokens per block
+ **/
+ pendingUnstakePerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;
+ /**
+ * Returns the total amount of staked tokens
+ **/
+ totalStaked: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
+ /**
+ * Returns the total amount of staked tokens per block when staked
+ **/
+ totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;
+ /**
+ * Return the total amount locked by staking tokens
+ **/
+ totalStakingLocked: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
+ };
author: {
/**
* Returns true if the keystore has private keys for the given public key and key type.
@@ -702,15 +724,7 @@
* Get the number of blocks until sponsoring a transaction is available
**/
nextSponsored: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u64>>>;
- /**
- * Returns the total amount of unstaked tokens
- **/
- pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
/**
- * Returns the total amount of unstaked tokens per block
- **/
- pendingUnstakePerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;
- /**
* Get property permissions, optionally limited to the provided keys
**/
propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsPropertyKeyPermission>>>;
@@ -746,18 +760,6 @@
* Get the total amount of pieces of an RFT
**/
totalPieces: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u128>>>;
- /**
- * Returns the total amount of staked tokens
- **/
- totalStaked: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
- /**
- * Returns the total amount of staked tokens per block when staked
- **/
- totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;
- /**
- * Return the total amount locked by staking tokens
- **/
- totalStakingLocked: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
/**
* Get the amount of distinctive tokens present in a collection
**/
tests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -181,8 +181,21 @@
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
evmMigration: {
+ /**
+ * Start contract migration, inserts contract stub at target address,
+ * and marks account as pending, allowing to insert storage
+ **/
begin: AugmentedSubmittable<(address: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
+ /**
+ * Finish contract migration, allows it to be called.
+ * It is not possible to alter contract storage via [`Self::set_data`]
+ * after this call.
+ **/
finish: AugmentedSubmittable<(address: H160 | string | Uint8Array, code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160, Bytes]>;
+ /**
+ * Insert items into contract storage, this method can be called
+ * multiple times
+ **/
setData: AugmentedSubmittable<(address: H160 | string | Uint8Array, data: Vec<ITuple<[H256, H256]>> | ([H256 | string | Uint8Array, H256 | string | Uint8Array])[]) => SubmittableExtrinsic<ApiType>, [H160, Vec<ITuple<[H256, H256]>>]>;
/**
* Generic tx
@@ -372,7 +385,7 @@
stopAppPromotion: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
- unstake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
+ unstake: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* Generic tx
**/
tests/src/interfaces/default/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/default/types.ts
+++ b/tests/src/interfaces/default/types.ts
@@ -822,9 +822,6 @@
readonly amount: u128;
} & Struct;
readonly isUnstake: boolean;
- readonly asUnstake: {
- readonly amount: u128;
- } & Struct;
readonly isSponsorCollection: boolean;
readonly asSponsorCollection: {
readonly collectionId: u32;
@@ -2639,8 +2636,7 @@
export interface UpDataStructsPropertyScope extends Enum {
readonly isNone: boolean;
readonly isRmrk: boolean;
- readonly isEth: boolean;
- readonly type: 'None' | 'Rmrk' | 'Eth';
+ readonly type: 'None' | 'Rmrk';
}
/** @name UpDataStructsRpcCollection */
tests/src/interfaces/definitions.tsdiffbeforeafterboth--- a/tests/src/interfaces/definitions.ts
+++ b/tests/src/interfaces/definitions.ts
@@ -15,5 +15,6 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
export {default as unique} from './unique/definitions';
+export {default as appPromotion} from './appPromotion/definitions';
export {default as rmrk} from './rmrk/definitions';
export {default as default} from './default/definitions';
\ No newline at end of file
tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -2467,9 +2467,7 @@
stake: {
amount: 'u128',
},
- unstake: {
- amount: 'u128',
- },
+ unstake: 'Null',
sponsor_collection: {
collectionId: 'u32',
},
@@ -3078,7 +3076,7 @@
* Lookup403: up_data_structs::PropertyScope
**/
UpDataStructsPropertyScope: {
- _enum: ['None', 'Rmrk', 'Eth']
+ _enum: ['None', 'Rmrk']
},
/**
* Lookup405: pallet_nonfungible::pallet::Error<T>
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -2675,9 +2675,6 @@
readonly amount: u128;
} & Struct;
readonly isUnstake: boolean;
- readonly asUnstake: {
- readonly amount: u128;
- } & Struct;
readonly isSponsorCollection: boolean;
readonly asSponsorCollection: {
readonly collectionId: u32;
@@ -3238,8 +3235,7 @@
interface UpDataStructsPropertyScope extends Enum {
readonly isNone: boolean;
readonly isRmrk: boolean;
- readonly isEth: boolean;
- readonly type: 'None' | 'Rmrk' | 'Eth';
+ readonly type: 'None' | 'Rmrk';
}
/** @name PalletNonfungibleError (405) */
tests/src/interfaces/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/types.ts
+++ b/tests/src/interfaces/types.ts
@@ -2,5 +2,6 @@
/* eslint-disable */
export * from './unique/types';
+export * from './appPromotion/types';
export * from './rmrk/types';
export * from './default/types';
tests/src/interfaces/unique/definitions.tsdiffbeforeafterboth--- a/tests/src/interfaces/unique/definitions.ts
+++ b/tests/src/interfaces/unique/definitions.ts
@@ -175,30 +175,5 @@
[collectionParam, tokenParam],
'Option<u128>',
),
- totalStaked: fun(
- 'Returns the total amount of staked tokens',
- [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}],
- 'u128',
- ),
- totalStakedPerBlock: fun(
- 'Returns the total amount of staked tokens per block when staked',
- [crossAccountParam('staker')],
- 'Vec<(u32, u128)>',
- ),
- totalStakingLocked: fun(
- 'Return the total amount locked by staking tokens',
- [crossAccountParam('staker')],
- 'u128',
- ),
- pendingUnstake: fun(
- 'Returns the total amount of unstaked tokens',
- [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}],
- 'u128',
- ),
- pendingUnstakePerBlock: fun(
- 'Returns the total amount of unstaked tokens per block',
- [crossAccountParam('staker')],
- 'Vec<(u32, u128)>',
- ),
},
};
tests/src/substrate/substrate-api.tsdiffbeforeafterboth--- a/tests/src/substrate/substrate-api.ts
+++ b/tests/src/substrate/substrate-api.ts
@@ -42,6 +42,7 @@
},
rpc: {
unique: defs.unique.rpc,
+ appPromotion: defs.appPromotion.rpc,
rmrk: defs.rmrk.rpc,
eth: {
feeHistory: {
tests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.dev.ts
+++ b/tests/src/util/playgrounds/unique.dev.ts
@@ -35,6 +35,7 @@
},
rpc: {
unique: defs.unique.rpc,
+ appPromotion: defs.appPromotion.rpc,
rmrk: defs.rmrk.rpc,
eth: {
feeHistory: {
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.ts
+++ b/tests/src/util/playgrounds/unique.ts
@@ -2027,24 +2027,24 @@
}
async getTotalStaked(address?: ICrossAccountId): Promise<bigint> {
- if (address) return (await this.helper.callRpc('api.rpc.unique.totalStaked', [address])).toBigInt();
- return (await this.helper.callRpc('api.rpc.unique.totalStaked')).toBigInt();
+ if (address) return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked', [address])).toBigInt();
+ return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked')).toBigInt();
}
async getTotalStakingLocked(address: ICrossAccountId): Promise<bigint> {
- return (await this.helper.callRpc('api.rpc.unique.totalStakingLocked', [address])).toBigInt();
+ return (await this.helper.callRpc('api.rpc.appPromotion.totalStakingLocked', [address])).toBigInt();
}
async getTotalStakedPerBlock(address: ICrossAccountId): Promise<bigint[][]> {
- return (await this.helper.callRpc('api.rpc.unique.totalStakedPerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]);
+ return (await this.helper.callRpc('api.rpc.appPromotion.totalStakedPerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]);
}
async getPendingUnstake(address: ICrossAccountId): Promise<bigint> {
- return (await this.helper.callRpc('api.rpc.unique.pendingUnstake', [address])).toBigInt();
+ return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstake', [address])).toBigInt();
}
async getPendingUnstakePerBlock(address: ICrossAccountId): Promise<bigint[][]> {
- return (await this.helper.callRpc('api.rpc.unique.pendingUnstakePerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]);
+ return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstakePerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]);
}
}