difftreelog
fix some rpc fixes
in: master
3 files changed
client/rpc/src/lib.rsdiffbeforeafterboth--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -412,47 +412,27 @@
}
}
-pub struct Unique<C, P> {
- client: Arc<C>,
- _marker: std::marker::PhantomData<P>,
-}
-
-impl<C, P> Unique<C, P> {
- pub fn new(client: Arc<C>) -> Self {
- Self {
- client,
- _marker: Default::default(),
+macro_rules! define_struct_for_server_api {
+ ($name:ident) => {
+ pub struct $name<C, P> {
+ client: Arc<C>,
+ _marker: std::marker::PhantomData<P>,
}
- }
-}
-
-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(),
+
+ impl<C, P> $name<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>,
+ };
}
-impl<C, P> Rmrk<C, P> {
- pub fn new(client: Arc<C>) -> Self {
- Self {
- client,
- _marker: Default::default(),
- }
- }
-}
+define_struct_for_server_api!(Unique);
+define_struct_for_server_api!(AppPromotion);
+define_struct_for_server_api!(Rmrk);
macro_rules! pass_method {
(
@@ -605,14 +585,14 @@
|v| v
.into_iter()
.map(|(b, a)| (b, a.to_string()))
- .collect::<Vec<_>>(), unique_api);
- pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), unique_api);
- pass_method!(pending_unstake(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), unique_api);
+ .collect::<Vec<_>>(), app_promotion_api);
+ pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), app_promotion_api);
+ pass_method!(pending_unstake(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), app_promotion_api);
pass_method!(pending_unstake_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> =>
|v| v
.into_iter()
.map(|(b, a)| (b, a.to_string()))
- .collect::<Vec<_>>(), unique_api);
+ .collect::<Vec<_>>(), app_promotion_api);
}
#[allow(deprecated)]
node/rpc/src/lib.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use sp_runtime::traits::BlakeTwo256;18use fc_rpc::{19 EthBlockDataCacheTask, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override,20 StorageOverride, SchemaV2Override, SchemaV3Override,21};22use jsonrpsee::RpcModule;23use fc_rpc_core::types::{FilterPool, FeeHistoryCache};24use fp_storage::EthereumStorageSchema;25use sc_client_api::{26 backend::{AuxStore, StorageProvider},27 client::BlockchainEvents,28 StateBackend, Backend,29};30use sc_finality_grandpa::{31 FinalityProofProvider, GrandpaJustificationStream, SharedAuthoritySet, SharedVoterState,32};33use sc_network::NetworkService;34use sc_rpc::SubscriptionTaskExecutor;35pub use sc_rpc_api::DenyUnsafe;36use sc_transaction_pool::{ChainApi, Pool};37use sp_api::ProvideRuntimeApi;38use sp_block_builder::BlockBuilder;39use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};40use sc_service::TransactionPool;41use uc_rpc::AppPromotion;42use std::{collections::BTreeMap, sync::Arc};4344use up_common::types::opaque::{Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance};4546// RMRK47use up_data_structs::{48 RmrkCollectionInfo, RmrkInstanceInfo, RmrkResourceInfo, RmrkPropertyInfo, RmrkBaseInfo,49 RmrkPartType, RmrkTheme,50};5152/// Extra dependencies for GRANDPA53pub struct GrandpaDeps<B> {54 /// Voting round info.55 pub shared_voter_state: SharedVoterState,56 /// Authority set info.57 pub shared_authority_set: SharedAuthoritySet<Hash, BlockNumber>,58 /// Receives notifications about justification events from Grandpa.59 pub justification_stream: GrandpaJustificationStream<Block>,60 /// Executor to drive the subscription manager in the Grandpa RPC handler.61 pub subscription_executor: SubscriptionTaskExecutor,62 /// Finality proof provider.63 pub finality_provider: Arc<FinalityProofProvider<B, Block>>,64}6566/// Full client dependencies.67pub struct FullDeps<C, P, SC, CA: ChainApi> {68 /// The client instance to use.69 pub client: Arc<C>,70 /// Transaction pool instance.71 pub pool: Arc<P>,72 /// Graph pool instance.73 pub graph: Arc<Pool<CA>>,74 /// The SelectChain Strategy75 pub select_chain: SC,76 /// The Node authority flag77 pub is_authority: bool,78 /// Whether to enable dev signer79 pub enable_dev_signer: bool,80 /// Network service81 pub network: Arc<NetworkService<Block, Hash>>,82 /// Whether to deny unsafe calls83 pub deny_unsafe: DenyUnsafe,84 /// EthFilterApi pool.85 pub filter_pool: Option<FilterPool>,86 /// Backend.87 pub backend: Arc<fc_db::Backend<Block>>,88 /// Maximum number of logs in a query.89 pub max_past_logs: u32,90 /// Maximum fee history cache size.91 pub fee_history_limit: u64,92 /// Fee history cache.93 pub fee_history_cache: FeeHistoryCache,94 /// Cache for Ethereum block data.95 pub block_data_cache: Arc<EthBlockDataCacheTask<Block>>,96}9798pub fn overrides_handle<C, BE, R>(client: Arc<C>) -> Arc<OverrideHandle<Block>>99where100 C: ProvideRuntimeApi<Block> + StorageProvider<Block, BE> + AuxStore,101 C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError>,102 C: Send + Sync + 'static,103 C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,104 C::Api:105 up_rpc::UniqueApi<Block, BlockNumber, <R as RuntimeInstance>::CrossAccountId, AccountId>,106 BE: Backend<Block> + 'static,107 BE::State: StateBackend<BlakeTwo256>,108 R: RuntimeInstance + Send + Sync + 'static,109{110 let mut overrides_map = BTreeMap::new();111 overrides_map.insert(112 EthereumStorageSchema::V1,113 Box::new(SchemaV1Override::new(client.clone()))114 as Box<dyn StorageOverride<_> + Send + Sync>,115 );116 overrides_map.insert(117 EthereumStorageSchema::V2,118 Box::new(SchemaV2Override::new(client.clone()))119 as Box<dyn StorageOverride<_> + Send + Sync>,120 );121 overrides_map.insert(122 EthereumStorageSchema::V3,123 Box::new(SchemaV3Override::new(client.clone()))124 as Box<dyn StorageOverride<_> + Send + Sync>,125 );126127 Arc::new(OverrideHandle {128 schemas: overrides_map,129 fallback: Box::new(RuntimeApiStorageOverride::new(client)),130 })131}132133/// Instantiate all Full RPC extensions.134pub fn create_full<C, P, SC, CA, R, A, B>(135 deps: FullDeps<C, P, SC, CA>,136 subscription_task_executor: SubscriptionTaskExecutor,137) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>138where139 C: ProvideRuntimeApi<Block> + StorageProvider<Block, B> + AuxStore,140 C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static,141 C: Send + Sync + 'static,142 C: BlockchainEvents<Block>,143 C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,144 C::Api: BlockBuilder<Block>,145 // C::Api: pallet_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber, Hash>,146 C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,147 C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,148 C::Api: fp_rpc::ConvertTransactionRuntimeApi<Block>,149 C::Api:150 up_rpc::UniqueApi<Block, BlockNumber, <R as RuntimeInstance>::CrossAccountId, AccountId>,151 C::Api: app_promotion_rpc::AppPromotionApi<Block, BlockNumber, <R as RuntimeInstance>::CrossAccountId, AccountId>,152 C::Api: rmrk_rpc::RmrkApi<153 Block,154 AccountId,155 RmrkCollectionInfo<AccountId>,156 RmrkInstanceInfo<AccountId>,157 RmrkResourceInfo,158 RmrkPropertyInfo,159 RmrkBaseInfo<AccountId>,160 RmrkPartType,161 RmrkTheme,162 >,163 B: sc_client_api::Backend<Block> + Send + Sync + 'static,164 B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashFor<Block>>,165 P: TransactionPool<Block = Block> + 'static,166 CA: ChainApi<Block = Block> + 'static,167 R: RuntimeInstance + Send + Sync + 'static,168 <R as RuntimeInstance>::CrossAccountId: serde::Serialize,169 for<'de> <R as RuntimeInstance>::CrossAccountId: serde::Deserialize<'de>,170{171 use fc_rpc::{172 Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub,173 EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer,174 };175 use uc_rpc::{UniqueApiServer, Unique};176 use uc_rpc::{AppPromotionApiServer, AppPromotion};177178 #[cfg(not(feature = "unique-runtime"))]179 use uc_rpc::{RmrkApiServer, Rmrk};180181 // use pallet_contracts_rpc::{Contracts, ContractsApi};182 use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};183 use substrate_frame_rpc_system::{System, SystemApiServer};184185 let mut io = RpcModule::new(());186 let FullDeps {187 client,188 pool,189 graph,190 select_chain: _,191 fee_history_limit,192 fee_history_cache,193 block_data_cache,194 enable_dev_signer,195 is_authority,196 network,197 deny_unsafe,198 filter_pool,199 backend,200 max_past_logs,201 } = deps;202203 io.merge(System::new(Arc::clone(&client), Arc::clone(&pool), deny_unsafe).into_rpc())?;204 io.merge(TransactionPayment::new(Arc::clone(&client)).into_rpc())?;205206 // io.extend_with(ContractsApi::to_delegate(Contracts::new(client.clone())));207208 let mut signers = Vec::new();209 if enable_dev_signer {210 signers.push(Box::new(EthDevSigner::new()) as Box<dyn EthSigner>);211 }212213 let overrides = overrides_handle::<_, _, R>(client.clone());214215 io.merge(216 Eth::new(217 client.clone(),218 pool.clone(),219 graph,220 Some(<R as RuntimeInstance>::get_transaction_converter()),221 network.clone(),222 signers,223 overrides.clone(),224 backend.clone(),225 is_authority,226 block_data_cache.clone(),227 fee_history_cache,228 fee_history_limit,229 )230 .into_rpc(),231 )?;232233 io.merge(Unique::new(client.clone()).into_rpc())?;234235 // #[cfg(not(feature = "unique-runtime"))]236 io.merge(AppPromotion::new(client.clone()).into_rpc())?;237238 #[cfg(not(feature = "unique-runtime"))]239 io.merge(Rmrk::new(client.clone()).into_rpc())?;240241 if let Some(filter_pool) = filter_pool {242 io.merge(243 EthFilter::new(244 client.clone(),245 backend,246 filter_pool,247 500_usize, // max stored filters248 max_past_logs,249 block_data_cache,250 )251 .into_rpc(),252 )?;253 }254255 io.merge(256 Net::new(257 client.clone(),258 network.clone(),259 // Whether to format the `peer_count` response as Hex (default) or not.260 true,261 )262 .into_rpc(),263 )?;264265 io.merge(Web3::new(client.clone()).into_rpc())?;266267 io.merge(268 EthPubSub::new(pool, client, network, subscription_task_executor, overrides).into_rpc(),269 )?;270271 Ok(io)272}1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use sp_runtime::traits::BlakeTwo256;18use fc_rpc::{19 EthBlockDataCacheTask, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override,20 StorageOverride, SchemaV2Override, SchemaV3Override,21};22use jsonrpsee::RpcModule;23use fc_rpc_core::types::{FilterPool, FeeHistoryCache};24use fp_storage::EthereumStorageSchema;25use sc_client_api::{26 backend::{AuxStore, StorageProvider},27 client::BlockchainEvents,28 StateBackend, Backend,29};30use sc_finality_grandpa::{31 FinalityProofProvider, GrandpaJustificationStream, SharedAuthoritySet, SharedVoterState,32};33use sc_network::NetworkService;34use sc_rpc::SubscriptionTaskExecutor;35pub use sc_rpc_api::DenyUnsafe;36use sc_transaction_pool::{ChainApi, Pool};37use sp_api::ProvideRuntimeApi;38use sp_block_builder::BlockBuilder;39use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};40use sc_service::TransactionPool;41use std::{collections::BTreeMap, sync::Arc};4243use up_common::types::opaque::{Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance};4445// RMRK46use up_data_structs::{47 RmrkCollectionInfo, RmrkInstanceInfo, RmrkResourceInfo, RmrkPropertyInfo, RmrkBaseInfo,48 RmrkPartType, RmrkTheme,49};5051/// Extra dependencies for GRANDPA52pub struct GrandpaDeps<B> {53 /// Voting round info.54 pub shared_voter_state: SharedVoterState,55 /// Authority set info.56 pub shared_authority_set: SharedAuthoritySet<Hash, BlockNumber>,57 /// Receives notifications about justification events from Grandpa.58 pub justification_stream: GrandpaJustificationStream<Block>,59 /// Executor to drive the subscription manager in the Grandpa RPC handler.60 pub subscription_executor: SubscriptionTaskExecutor,61 /// Finality proof provider.62 pub finality_provider: Arc<FinalityProofProvider<B, Block>>,63}6465/// Full client dependencies.66pub struct FullDeps<C, P, SC, CA: ChainApi> {67 /// The client instance to use.68 pub client: Arc<C>,69 /// Transaction pool instance.70 pub pool: Arc<P>,71 /// Graph pool instance.72 pub graph: Arc<Pool<CA>>,73 /// The SelectChain Strategy74 pub select_chain: SC,75 /// The Node authority flag76 pub is_authority: bool,77 /// Whether to enable dev signer78 pub enable_dev_signer: bool,79 /// Network service80 pub network: Arc<NetworkService<Block, Hash>>,81 /// Whether to deny unsafe calls82 pub deny_unsafe: DenyUnsafe,83 /// EthFilterApi pool.84 pub filter_pool: Option<FilterPool>,85 /// Backend.86 pub backend: Arc<fc_db::Backend<Block>>,87 /// Maximum number of logs in a query.88 pub max_past_logs: u32,89 /// Maximum fee history cache size.90 pub fee_history_limit: u64,91 /// Fee history cache.92 pub fee_history_cache: FeeHistoryCache,93 /// Cache for Ethereum block data.94 pub block_data_cache: Arc<EthBlockDataCacheTask<Block>>,95}9697pub fn overrides_handle<C, BE, R>(client: Arc<C>) -> Arc<OverrideHandle<Block>>98where99 C: ProvideRuntimeApi<Block> + StorageProvider<Block, BE> + AuxStore,100 C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError>,101 C: Send + Sync + 'static,102 C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,103 C::Api:104 up_rpc::UniqueApi<Block, BlockNumber, <R as RuntimeInstance>::CrossAccountId, AccountId>,105 BE: Backend<Block> + 'static,106 BE::State: StateBackend<BlakeTwo256>,107 R: RuntimeInstance + Send + Sync + 'static,108{109 let mut overrides_map = BTreeMap::new();110 overrides_map.insert(111 EthereumStorageSchema::V1,112 Box::new(SchemaV1Override::new(client.clone()))113 as Box<dyn StorageOverride<_> + Send + Sync>,114 );115 overrides_map.insert(116 EthereumStorageSchema::V2,117 Box::new(SchemaV2Override::new(client.clone()))118 as Box<dyn StorageOverride<_> + Send + Sync>,119 );120 overrides_map.insert(121 EthereumStorageSchema::V3,122 Box::new(SchemaV3Override::new(client.clone()))123 as Box<dyn StorageOverride<_> + Send + Sync>,124 );125126 Arc::new(OverrideHandle {127 schemas: overrides_map,128 fallback: Box::new(RuntimeApiStorageOverride::new(client)),129 })130}131132/// Instantiate all Full RPC extensions.133pub fn create_full<C, P, SC, CA, R, A, B>(134 deps: FullDeps<C, P, SC, CA>,135 subscription_task_executor: SubscriptionTaskExecutor,136) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>137where138 C: ProvideRuntimeApi<Block> + StorageProvider<Block, B> + AuxStore,139 C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static,140 C: Send + Sync + 'static,141 C: BlockchainEvents<Block>,142 C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,143 C::Api: BlockBuilder<Block>,144 // C::Api: pallet_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber, Hash>,145 C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,146 C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,147 C::Api: fp_rpc::ConvertTransactionRuntimeApi<Block>,148 C::Api:149 up_rpc::UniqueApi<Block, BlockNumber, <R as RuntimeInstance>::CrossAccountId, AccountId>,150 C::Api: app_promotion_rpc::AppPromotionApi<Block, BlockNumber, <R as RuntimeInstance>::CrossAccountId, AccountId>,151 C::Api: rmrk_rpc::RmrkApi<152 Block,153 AccountId,154 RmrkCollectionInfo<AccountId>,155 RmrkInstanceInfo<AccountId>,156 RmrkResourceInfo,157 RmrkPropertyInfo,158 RmrkBaseInfo<AccountId>,159 RmrkPartType,160 RmrkTheme,161 >,162 B: sc_client_api::Backend<Block> + Send + Sync + 'static,163 B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashFor<Block>>,164 P: TransactionPool<Block = Block> + 'static,165 CA: ChainApi<Block = Block> + 'static,166 R: RuntimeInstance + Send + Sync + 'static,167 <R as RuntimeInstance>::CrossAccountId: serde::Serialize,168 for<'de> <R as RuntimeInstance>::CrossAccountId: serde::Deserialize<'de>,169{170 use fc_rpc::{171 Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub,172 EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer,173 };174 use uc_rpc::{UniqueApiServer, Unique};175 use uc_rpc::{AppPromotionApiServer, AppPromotion};176177 #[cfg(not(feature = "unique-runtime"))]178 use uc_rpc::{RmrkApiServer, Rmrk};179180 // use pallet_contracts_rpc::{Contracts, ContractsApi};181 use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};182 use substrate_frame_rpc_system::{System, SystemApiServer};183184 let mut io = RpcModule::new(());185 let FullDeps {186 client,187 pool,188 graph,189 select_chain: _,190 fee_history_limit,191 fee_history_cache,192 block_data_cache,193 enable_dev_signer,194 is_authority,195 network,196 deny_unsafe,197 filter_pool,198 backend,199 max_past_logs,200 } = deps;201202 io.merge(System::new(Arc::clone(&client), Arc::clone(&pool), deny_unsafe).into_rpc())?;203 io.merge(TransactionPayment::new(Arc::clone(&client)).into_rpc())?;204205 // io.extend_with(ContractsApi::to_delegate(Contracts::new(client.clone())));206207 let mut signers = Vec::new();208 if enable_dev_signer {209 signers.push(Box::new(EthDevSigner::new()) as Box<dyn EthSigner>);210 }211212 let overrides = overrides_handle::<_, _, R>(client.clone());213214 io.merge(215 Eth::new(216 client.clone(),217 pool.clone(),218 graph,219 Some(<R as RuntimeInstance>::get_transaction_converter()),220 network.clone(),221 signers,222 overrides.clone(),223 backend.clone(),224 is_authority,225 block_data_cache.clone(),226 fee_history_cache,227 fee_history_limit,228 )229 .into_rpc(),230 )?;231232 io.merge(Unique::new(client.clone()).into_rpc())?;233234 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]235 io.merge(AppPromotion::new(client.clone()).into_rpc())?;236237 #[cfg(not(feature = "unique-runtime"))]238 io.merge(Rmrk::new(client.clone()).into_rpc())?;239240 if let Some(filter_pool) = filter_pool {241 io.merge(242 EthFilter::new(243 client.clone(),244 backend,245 filter_pool,246 500_usize, // max stored filters247 max_past_logs,248 block_data_cache,249 )250 .into_rpc(),251 )?;252 }253254 io.merge(255 Net::new(256 client.clone(),257 network.clone(),258 // Whether to format the `peer_count` response as Hex (default) or not.259 true,260 )261 .into_rpc(),262 )?;263264 io.merge(Web3::new(client.clone()).into_rpc())?;265266 io.merge(267 EthPubSub::new(pool, client, network, subscription_task_executor, overrides).into_rpc(),268 )?;269270 Ok(io)271}tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -6,7 +6,7 @@
import '@polkadot/api-base/types/storage';
import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types';
-import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
+import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild } from '@polkadot/types/lookup';
@@ -513,10 +513,10 @@
promotion: {
admin: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
- * Stores the address of the staker for which the last revenue recalculation was performed.
+ * Stores hash a record for which the last revenue recalculation was performed.
* If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers.
**/
- lastCalcucaltedStaker: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
+ nextCalculatedRecord: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[AccountId32, u32]>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Next target block when interest is recalculated
**/
@@ -530,6 +530,10 @@
**/
staked: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[u128, u32]>>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
/**
+ * Amount of stakes for an Account
+ **/
+ stakesPerAccount: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<u8>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
+ /**
* A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`.
**/
startBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;