difftreelog
added the ability to configure pallet `app-promotion` via the `configuration` palette
in: master
14 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5524,13 +5524,14 @@
[[package]]
name = "pallet-app-promotion"
-version = "0.1.0"
+version = "0.1.1"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"pallet-balances",
"pallet-common",
+ "pallet-configuration",
"pallet-evm",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
@@ -5784,7 +5785,7 @@
[[package]]
name = "pallet-configuration"
-version = "0.1.1"
+version = "0.1.2"
dependencies = [
"fp-evm",
"frame-support",
pallets/app-promotion/CHANGELOG.mddiffbeforeafterboth--- /dev/null
+++ b/pallets/app-promotion/CHANGELOG.md
@@ -0,0 +1,11 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+
+<!-- bureaucrate goes here -->
+
+## [0.1.1] - 2022-12-13
+
+### Added
+
+- The ability to configure pallet `app-promotion` via the `configuration` palette
pallets/app-promotion/Cargo.tomldiffbeforeafterboth--- a/pallets/app-promotion/Cargo.toml
+++ b/pallets/app-promotion/Cargo.toml
@@ -9,7 +9,7 @@
license = 'GPLv3'
name = 'pallet-app-promotion'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.1.0'
+version = '0.1.1'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
@@ -68,6 +68,7 @@
up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
pallet-common = { default-features = false, path = "../common" }
+pallet-configuration = { default-features = false, path = "../configuration" }
pallet-unique = { default-features = false, path = "../unique" }
pallet-evm-contract-helpers = { default-features = false, path = "../evm-contract-helpers" }
pallet-evm-migration = { default-features = false, path = "../evm-migration" }
pallets/app-promotion/src/lib.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/lib.rs
+++ b/pallets/app-promotion/src/lib.rs
@@ -102,7 +102,9 @@
use frame_system::pallet_prelude::*;
#[pallet::config]
- pub trait Config: frame_system::Config + pallet_evm::Config {
+ pub trait Config:
+ frame_system::Config + pallet_evm::Config + pallet_configuration::Config
+ {
/// Type to interact with the native token
type Currency: ExtendedLockableCurrency<Self::AccountId>
+ ReservableCurrency<Self::AccountId>;
@@ -330,6 +332,7 @@
amount >= <BalanceOf<T>>::from(100u128) * T::Nominal::get(),
ArithmeticError::Underflow
);
+ let config = <PalletConfiguration<T>>::get();
let balance =
<<T as Config>::Currency as Currency<T::AccountId>>::free_balance(&staker_id);
@@ -351,7 +354,7 @@
// Calculation of the number of recalculation periods,
// after how much the first interest calculation should be performed for the stake
let recalculate_after_interval: T::BlockNumber =
- if block_number % T::RecalculationInterval::get() == 0u32.into() {
+ if block_number % config.recalculation_interval == 0u32.into() {
1u32.into()
} else {
2u32.into()
@@ -359,9 +362,9 @@
// Сalculation of the number of the relay block
// in which it is necessary to accrue remuneration for the stake.
- let recalc_block = (block_number / T::RecalculationInterval::get()
+ let recalc_block = (block_number / config.recalculation_interval
+ recalculate_after_interval)
- * T::RecalculationInterval::get();
+ * config.recalculation_interval;
<Staked<T>>::insert((&staker_id, block_number), {
let mut balance_and_recalc_block = <Staked<T>>::get((&staker_id, block_number));
@@ -393,9 +396,10 @@
#[pallet::weight(<T as Config>::WeightInfo::unstake())]
pub fn unstake(staker: OriginFor<T>) -> DispatchResultWithPostInfo {
let staker_id = ensure_signed(staker)?;
+ let config = <PalletConfiguration<T>>::get();
// calculate block number where the sum would be free
- let block = <frame_system::Pallet<T>>::block_number() + T::PendingInterval::get();
+ let block = <frame_system::Pallet<T>>::block_number() + config.pending_interval;
let mut pendings = <PendingUnstake<T>>::get(block);
@@ -568,15 +572,25 @@
admin_id == Admin::<T>::get().ok_or(Error::<T>::AdminNotSet)?,
Error::<T>::NoPermission
);
+ let config = <PalletConfiguration<T>>::get();
+ let mut stakers_number = stakers_number.unwrap_or(DEFAULT_NUMBER_PAYOUTS);
+
+ ensure!(
+ stakers_number <= config.max_stakers_per_calculation,
+ Error::<T>::NoPermission
+ );
+
// calculate the number of the current recalculation block,
// this is necessary in order to understand which stakers we should calculate interest
- let current_recalc_block =
- Self::get_current_recalc_block(T::RelayBlockNumberProvider::current_block_number());
+ let current_recalc_block = Self::get_current_recalc_block(
+ T::RelayBlockNumberProvider::current_block_number(),
+ &config,
+ );
// calculate the number of the next recalculation block,
// this value is set for the stakers to whom the recalculation will be performed
- let next_recalc_block = current_recalc_block + T::RecalculationInterval::get();
+ let next_recalc_block = current_recalc_block + config.recalculation_interval;
let mut storage_iterator = Self::get_next_calculated_key()
.map_or(Staked::<T>::iter(), |key| Staked::<T>::iter_from(key));
@@ -584,7 +598,6 @@
NextCalculatedRecord::<T>::set(None);
{
- let mut stakers_number = stakers_number.unwrap_or(20);
let last_id = RefCell::new(None);
let income_acc = RefCell::new(BalanceOf::<T>::default());
let amount_acc = RefCell::new(BalanceOf::<T>::default());
@@ -644,8 +657,8 @@
next_recalc_block,
amount,
((current_recalc_block - next_recalc_block_for_stake)
- / T::RecalculationInterval::get())
- .into() + 1,
+ / config.recalculation_interval)
+ .into() + 1,
&mut *income_acc.borrow_mut(),
);
}
@@ -810,15 +823,19 @@
where
I: EncodeLike<BalanceOf<T>> + Balance,
{
+ let config = <PalletConfiguration<T>>::get();
let mut income = base;
- (0..iters).for_each(|_| income += T::IntervalIncome::get() * income);
+ (0..iters).for_each(|_| income += config.interval_income * income);
income - base
}
- fn get_current_recalc_block(current_relay_block: T::BlockNumber) -> T::BlockNumber {
- (current_relay_block / T::RecalculationInterval::get()) * T::RecalculationInterval::get()
+ fn get_current_recalc_block(
+ current_relay_block: T::BlockNumber,
+ config: &PalletConfiguration<T>,
+ ) -> T::BlockNumber {
+ (current_relay_block / config.recalculation_interval) * config.recalculation_interval
}
fn get_next_calculated_key() -> Option<Vec<u8>> {
pallets/app-promotion/src/types.rsdiffbeforeafterboth1use codec::EncodeLike;2use frame_support::{traits::LockableCurrency, WeakBoundedVec, Parameter, dispatch::DispatchResult};34use pallet_balances::{BalanceLock, Config as BalancesConfig, Pallet as PalletBalances};5use pallet_common::CollectionHandle;67use sp_runtime::DispatchError;8use up_data_structs::{CollectionId};9use sp_std::borrow::ToOwned;10use pallet_evm_contract_helpers::{Pallet as EvmHelpersPallet, Config as EvmHelpersConfig};1112/// This trait was defined because `LockableCurrency`13/// has no way to know the state of the lock for an account.14pub trait ExtendedLockableCurrency<AccountId: Parameter>: LockableCurrency<AccountId> {15 /// Returns lock balance for an account. Allows to determine the cause of the lock.16 fn locks<KArg>(who: KArg) -> WeakBoundedVec<BalanceLock<Self::Balance>, Self::MaxLocks>17 where18 KArg: EncodeLike<AccountId>;19}2021impl<T: BalancesConfig<I>, I: 'static> ExtendedLockableCurrency<T::AccountId>22 for PalletBalances<T, I>23{24 fn locks<KArg>(who: KArg) -> WeakBoundedVec<BalanceLock<Self::Balance>, Self::MaxLocks>25 where26 KArg: EncodeLike<T::AccountId>,27 {28 Self::locks(who)29 }30}31/// Trait for interacting with collections.32pub trait CollectionHandler {33 type CollectionId;34 type AccountId;3536 /// Sets sponsor for a collection.37 ///38 /// - `sponsor_id`: the account of the sponsor-to-be.39 /// - `collection_id`: ID of the modified collection.40 fn set_sponsor(41 sponsor_id: Self::AccountId,42 collection_id: Self::CollectionId,43 ) -> DispatchResult;4445 /// Removes sponsor for a collection.46 ///47 /// - `collection_id`: ID of the modified collection.48 fn remove_collection_sponsor(collection_id: Self::CollectionId) -> DispatchResult;4950 /// Retuns the current sponsor for a collection if one is set.51 ///52 /// - `collection_id`: ID of the collection.53 fn sponsor(collection_id: Self::CollectionId)54 -> Result<Option<Self::AccountId>, DispatchError>;55}5657impl<T: pallet_unique::Config> CollectionHandler for pallet_unique::Pallet<T> {58 type CollectionId = CollectionId;5960 type AccountId = T::AccountId;6162 fn set_sponsor(63 sponsor_id: Self::AccountId,64 collection_id: Self::CollectionId,65 ) -> DispatchResult {66 Self::force_set_sponsor(sponsor_id, collection_id)67 }6869 fn remove_collection_sponsor(collection_id: Self::CollectionId) -> DispatchResult {70 Self::force_remove_collection_sponsor(collection_id)71 }7273 fn sponsor(74 collection_id: Self::CollectionId,75 ) -> Result<Option<Self::AccountId>, DispatchError> {76 Ok(<CollectionHandle<T>>::try_get(collection_id)?77 .sponsorship78 .sponsor()79 .map(|acc| acc.to_owned()))80 }81}82/// Trait for interacting with contracts.83pub trait ContractHandler {84 type ContractId;85 type AccountId;8687 /// Sets sponsor for a contract.88 ///89 /// - `sponsor_id`: the account of the sponsor-to-be.90 /// - `contract_address`: the address of the modified contract.91 fn set_sponsor(92 sponsor_id: Self::AccountId,93 contract_address: Self::ContractId,94 ) -> DispatchResult;9596 /// Removes sponsor for a contract.97 ///98 /// - `contract_address`: the address of the modified contract.99 fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult;100101 /// Retuns the current sponsor for a contract if one is set.102 ///103 /// - `contract_address`: the contract address.104 fn sponsor(105 contract_address: Self::ContractId,106 ) -> Result<Option<Self::AccountId>, DispatchError>;107}108109impl<T: EvmHelpersConfig> ContractHandler for EvmHelpersPallet<T> {110 type ContractId = sp_core::H160;111112 type AccountId = T::CrossAccountId;113114 fn set_sponsor(115 sponsor_id: Self::AccountId,116 contract_address: Self::ContractId,117 ) -> DispatchResult {118 Self::force_set_sponsor(contract_address, &sponsor_id)119 }120121 fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult {122 Self::force_remove_sponsor(contract_address)123 }124125 fn sponsor(126 contract_address: Self::ContractId,127 ) -> Result<Option<Self::AccountId>, DispatchError> {128 Ok(Self::get_sponsor(contract_address))129 }130}1use codec::EncodeLike;2use frame_support::{traits::LockableCurrency, WeakBoundedVec, Parameter, dispatch::DispatchResult};34use pallet_balances::{BalanceLock, Config as BalancesConfig, Pallet as PalletBalances};5use pallet_common::CollectionHandle;67use sp_runtime::{DispatchError, Perbill};8use up_data_structs::{CollectionId};9use sp_std::borrow::ToOwned;10use pallet_evm_contract_helpers::{Pallet as EvmHelpersPallet, Config as EvmHelpersConfig};11use pallet_configuration::{AppPromomotionConfigurationOverride};12use sp_core::Get;1314const MAX_NUMBER_PAYOUTS: u8 = 100;15pub(crate) const DEFAULT_NUMBER_PAYOUTS: u8 = 20;1617/// This trait was defined because `LockableCurrency`18/// has no way to know the state of the lock for an account.19pub trait ExtendedLockableCurrency<AccountId: Parameter>: LockableCurrency<AccountId> {20 /// Returns lock balance for an account. Allows to determine the cause of the lock.21 fn locks<KArg>(who: KArg) -> WeakBoundedVec<BalanceLock<Self::Balance>, Self::MaxLocks>22 where23 KArg: EncodeLike<AccountId>;24}2526impl<T: BalancesConfig<I>, I: 'static> ExtendedLockableCurrency<T::AccountId>27 for PalletBalances<T, I>28{29 fn locks<KArg>(who: KArg) -> WeakBoundedVec<BalanceLock<Self::Balance>, Self::MaxLocks>30 where31 KArg: EncodeLike<T::AccountId>,32 {33 Self::locks(who)34 }35}36/// Trait for interacting with collections.37pub trait CollectionHandler {38 type CollectionId;39 type AccountId;4041 /// Sets sponsor for a collection.42 ///43 /// - `sponsor_id`: the account of the sponsor-to-be.44 /// - `collection_id`: ID of the modified collection.45 fn set_sponsor(46 sponsor_id: Self::AccountId,47 collection_id: Self::CollectionId,48 ) -> DispatchResult;4950 /// Removes sponsor for a collection.51 ///52 /// - `collection_id`: ID of the modified collection.53 fn remove_collection_sponsor(collection_id: Self::CollectionId) -> DispatchResult;5455 /// Retuns the current sponsor for a collection if one is set.56 ///57 /// - `collection_id`: ID of the collection.58 fn sponsor(collection_id: Self::CollectionId)59 -> Result<Option<Self::AccountId>, DispatchError>;60}6162impl<T: pallet_unique::Config> CollectionHandler for pallet_unique::Pallet<T> {63 type CollectionId = CollectionId;6465 type AccountId = T::AccountId;6667 fn set_sponsor(68 sponsor_id: Self::AccountId,69 collection_id: Self::CollectionId,70 ) -> DispatchResult {71 Self::force_set_sponsor(sponsor_id, collection_id)72 }7374 fn remove_collection_sponsor(collection_id: Self::CollectionId) -> DispatchResult {75 Self::force_remove_collection_sponsor(collection_id)76 }7778 fn sponsor(79 collection_id: Self::CollectionId,80 ) -> Result<Option<Self::AccountId>, DispatchError> {81 Ok(<CollectionHandle<T>>::try_get(collection_id)?82 .sponsorship83 .sponsor()84 .map(|acc| acc.to_owned()))85 }86}87/// Trait for interacting with contracts.88pub trait ContractHandler {89 type ContractId;90 type AccountId;9192 /// Sets sponsor for a contract.93 ///94 /// - `sponsor_id`: the account of the sponsor-to-be.95 /// - `contract_address`: the address of the modified contract.96 fn set_sponsor(97 sponsor_id: Self::AccountId,98 contract_address: Self::ContractId,99 ) -> DispatchResult;100101 /// Removes sponsor for a contract.102 ///103 /// - `contract_address`: the address of the modified contract.104 fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult;105106 /// Retuns the current sponsor for a contract if one is set.107 ///108 /// - `contract_address`: the contract address.109 fn sponsor(110 contract_address: Self::ContractId,111 ) -> Result<Option<Self::AccountId>, DispatchError>;112}113114impl<T: EvmHelpersConfig> ContractHandler for EvmHelpersPallet<T> {115 type ContractId = sp_core::H160;116117 type AccountId = T::CrossAccountId;118119 fn set_sponsor(120 sponsor_id: Self::AccountId,121 contract_address: Self::ContractId,122 ) -> DispatchResult {123 Self::force_set_sponsor(contract_address, &sponsor_id)124 }125126 fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult {127 Self::force_remove_sponsor(contract_address)128 }129130 fn sponsor(131 contract_address: Self::ContractId,132 ) -> Result<Option<Self::AccountId>, DispatchError> {133 Ok(Self::get_sponsor(contract_address))134 }135}136pub(crate) struct PalletConfiguration<T: crate::Config> {137 /// In relay blocks.138 pub recalculation_interval: T::BlockNumber,139 /// In parachain blocks.140 pub pending_interval: T::BlockNumber,141 /// Value for `RecalculationInterval` based on 0.05% per 24h.142 pub interval_income: Perbill,143 /// Maximum allowable number of stakers calculated per call of the `app-promotion::PayoutStakers` extrinsic.144 pub max_stakers_per_calculation: u8,145}146impl<T: crate::Config> PalletConfiguration<T> {147 pub fn get() -> Self {148 let config = <AppPromomotionConfigurationOverride<T>>::get().unwrap_or_default();149 Self {150 recalculation_interval: config.0.unwrap_or(T::RecalculationInterval::get()),151 pending_interval: config.2.unwrap_or(T::PendingInterval::get()),152 interval_income: config.1.unwrap_or(T::IntervalIncome::get()),153 max_stakers_per_calculation: config.3.unwrap_or(MAX_NUMBER_PAYOUTS),154 }155 }156}pallets/configuration/CHANGELOG.mddiffbeforeafterboth--- a/pallets/configuration/CHANGELOG.md
+++ b/pallets/configuration/CHANGELOG.md
@@ -1,4 +1,10 @@
<!-- bureaucrate goes here -->
+## [0.1.2] - 2022-12-13
+
+### Added
+
+- The ability to configure pallet `app-promotion` via the `configuration` palette
+
## [v0.1.1] 2022-08-16
### Other changes
pallets/configuration/Cargo.tomldiffbeforeafterboth--- a/pallets/configuration/Cargo.toml
+++ b/pallets/configuration/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "pallet-configuration"
-version = "0.1.1"
+version = "0.1.2"
edition = "2021"
[dependencies]
pallets/configuration/src/lib.rsdiffbeforeafterboth--- a/pallets/configuration/src/lib.rs
+++ b/pallets/configuration/src/lib.rs
@@ -51,6 +51,10 @@
#[pallet::constant]
type MaxOverridedAllowedLocations: Get<u32>;
+ #[pallet::constant]
+ type AppPromotionDailyRate: Get<Perbill>;
+ #[pallet::constant]
+ type DayRelayBlocks: Get<Self::BlockNumber>;
}
#[pallet::storage]
@@ -70,6 +74,17 @@
QueryKind = OptionQuery,
>;
+ #[pallet::storage]
+ pub type AppPromomotionConfigurationOverride<T: Config> = StorageValue<
+ Value = (
+ Option<T::BlockNumber>,
+ Option<Perbill>,
+ Option<T::BlockNumber>,
+ Option<u8>,
+ ),
+ QueryKind = OptionQuery,
+ >;
+
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(T::DbWeight::get().writes(1))]
@@ -109,6 +124,39 @@
<XcmAllowedLocationsOverride<T>>::set(locations);
Ok(())
}
+
+ #[pallet::weight(T::DbWeight::get().writes(1))]
+ pub fn set_app_promotion_configuration_override(
+ origin: OriginFor<T>,
+ recalculation_interval: Option<T::BlockNumber>,
+ pending_interval: Option<T::BlockNumber>,
+ stakers_payout_limit: Option<u8>,
+ ) -> DispatchResult {
+ let _sender = ensure_root(origin)?;
+
+ if recalculation_interval.is_none()
+ && pending_interval.is_none()
+ && stakers_payout_limit.is_none()
+ {
+ <AppPromomotionConfigurationOverride<T>>::kill();
+ } else {
+ let mut current_config =
+ <AppPromomotionConfigurationOverride<T>>::take().unwrap_or_default();
+
+ recalculation_interval.map(|b| {
+ current_config.0 = Some(b);
+ current_config.1 = Some(
+ Perbill::from_rational(b, T::DayRelayBlocks::get())
+ * T::AppPromotionDailyRate::get(),
+ )
+ });
+ pending_interval.map(|b| current_config.2 = Some(b));
+ stakers_payout_limit.map(|p| current_config.3 = Some(p));
+ <AppPromomotionConfigurationOverride<T>>::set(Some(current_config));
+ }
+
+ Ok(())
+ }
}
#[pallet::pallet]
runtime/common/config/pallets/app_promotion.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/app_promotion.rs
+++ b/runtime/common/config/pallets/app_promotion.rs
@@ -26,16 +26,6 @@
types::Balance,
};
-#[cfg(all(not(feature = "unique-runtime"), not(feature = "quartz-runtime")))]
-parameter_types! {
- pub const AppPromotionId: PalletId = PalletId(*b"appstake");
- pub const RecalculationInterval: BlockNumber = 8;
- pub const PendingInterval: BlockNumber = 4;
- pub const Nominal: Balance = UNIQUE;
- pub IntervalIncome: Perbill = Perbill::from_rational(RecalculationInterval::get(), RELAY_DAYS) * Perbill::from_rational(5u32, 10_000);
-}
-
-#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))]
parameter_types! {
pub const AppPromotionId: PalletId = PalletId(*b"appstake");
pub const RecalculationInterval: BlockNumber = RELAY_DAYS;
runtime/common/config/pallets/mod.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -33,6 +33,7 @@
use up_data_structs::{
mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping},
};
+use sp_arithmetic::Perbill;
#[cfg(feature = "rmrk")]
pub mod rmrk;
@@ -98,10 +99,16 @@
type RefungibleExtensionsWeightInfo = CommonWeights<Self>;
}
+parameter_types! {
+ pub AppPromotionDailyRate: Perbill = Perbill::from_rational(5u32, 10_000);
+ pub const DayRelayBlocks: BlockNumber = RELAY_DAYS;
+}
impl pallet_configuration::Config for Runtime {
type DefaultWeightToFeeCoefficient = ConstU32<{ up_common::constants::WEIGHT_TO_FEE_COEFF }>;
type DefaultMinGasPrice = ConstU64<{ up_common::constants::MIN_GAS_PRICE }>;
type MaxOverridedAllowedLocations = ConstU32<16>;
+ type AppPromotionDailyRate = AppPromotionDailyRate;
+ type DayRelayBlocks = DayRelayBlocks;
}
impl pallet_maintenance::Config for Runtime {
tests/src/app-promotion.test.tsdiffbeforeafterboth--- a/tests/src/app-promotion.test.ts
+++ b/tests/src/app-promotion.test.ts
@@ -31,11 +31,14 @@
before(async function () {
await usingPlaygrounds(async (helper, privateKey) => {
requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]);
+ const alice = await privateKey('//Alice');
donor = await privateKey({filename: __filename});
palletAddress = helper.arrange.calculatePalletAddress('appstake');
palletAdmin = await privateKey('//PromotionAdmin');
nominal = helper.balance.getOneTokenNominal();
accounts = await helper.arrange.createCrowd(100, 1000n, donor); // create accounts-pool to speed up tests
+ const api = helper.getApi();
+ await helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.configuration.setAppPromotionConfigurationOverride(LOCKING_PERIOD, UNLOCKING_PERIOD, null)));
});
});
tests/src/interfaces/augment-api-consts.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-consts.ts
+++ b/tests/src/interfaces/augment-api-consts.ts
@@ -79,6 +79,8 @@
[key: string]: Codec;
};
configuration: {
+ appPromotionDailyRate: Perbill & AugmentedConst<ApiType>;
+ dayRelayBlocks: u32 & AugmentedConst<ApiType>;
defaultMinGasPrice: u64 & AugmentedConst<ApiType>;
defaultWeightToFeeCoefficient: u32 & AugmentedConst<ApiType>;
maxOverridedAllowedLocations: u32 & AugmentedConst<ApiType>;
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -8,8 +8,13 @@
import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types';
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';
+<<<<<<< HEAD
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerV2BlockAgenda, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, SpWeightsWeightV2Weight, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup';
+=======
+import type { AccountId32, H160, H256, Perbill, Weight } from '@polkadot/types/interfaces/runtime';
+import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerV2BlockAgenda, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup';
+>>>>>>> added the ability to configure pallet `app-promotion` via the `configuration` palette
import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -160,6 +165,7 @@
[key: string]: QueryableStorageEntry<ApiType>;
};
configuration: {
+ appPromomotionConfigurationOverride: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[Option<u32>, Option<Perbill>, Option<u32>, Option<u8>]>>>, []> & QueryableStorageEntry<ApiType, []>;
minGasPriceOverride: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
weightToFeeCoefficientOverride: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
xcmAllowedLocationsOverride: AugmentedQuery<ApiType, () => Observable<Option<Vec<XcmV1MultiLocation>>>, []> & QueryableStorageEntry<ApiType, []>;
tests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -215,6 +215,7 @@
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
configuration: {
+ setAppPromotionConfigurationOverride: AugmentedSubmittable<(recalculationInterval: Option<u32> | null | Uint8Array | u32 | AnyNumber, pendingInterval: Option<u32> | null | Uint8Array | u32 | AnyNumber, stakersPayoutLimit: Option<u8> | null | Uint8Array | u8 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u32>, Option<u32>, Option<u8>]>;
setMinGasPriceOverride: AugmentedSubmittable<(coeff: Option<u64> | null | Uint8Array | u64 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u64>]>;
setWeightToFeeCoefficientOverride: AugmentedSubmittable<(coeff: Option<u32> | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u32>]>;
setXcmAllowedLocations: AugmentedSubmittable<(locations: Option<Vec<XcmV1MultiLocation>> | null | Uint8Array | Vec<XcmV1MultiLocation> | (XcmV1MultiLocation | { parents?: any; interior?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Option<Vec<XcmV1MultiLocation>>]>;