difftreelog
feautres: Pending interval is now tied to relay blocks, contract sponsors and `stopAppPromotion` added. Preparing to integrate the `app-promotion` palette to integrate with Unique and Quartz.
in: master
13 files changed
pallets/app-promotion/src/lib.rsdiffbeforeafterboth37pub mod weights;37pub mod weights;383839use sp_std::{vec::Vec, iter::Sum, borrow::ToOwned};39use sp_std::{vec::Vec, iter::Sum, borrow::ToOwned};40use sp_core::H160;40use codec::EncodeLike;41use codec::EncodeLike;41use pallet_balances::BalanceLock;42use pallet_balances::BalanceLock;42pub use types::ExtendedLockableCurrency;43pub use types::*;434444// use up_common::constants::{DAYS, UNIQUE};45// use up_common::constants::{DAYS, UNIQUE};45use up_data_structs::CollectionId;46use up_data_structs::CollectionId;78 use super::*;79 use super::*;79 use frame_support::{Blake2_128Concat, Twox64Concat, pallet_prelude::*, storage::Key, PalletId};80 use frame_support::{Blake2_128Concat, Twox64Concat, pallet_prelude::*, storage::Key, PalletId};80 use frame_system::pallet_prelude::*;81 use frame_system::pallet_prelude::*;81 use types::CollectionHandler;828283 #[pallet::config]83 #[pallet::config]84 pub trait Config: frame_system::Config + pallet_evm::account::Config {84 pub trait Config: frame_system::Config + pallet_evm::account::Config {89 CollectionId = CollectionId,89 CollectionId = CollectionId,90 >;90 >;919192 type ContractHandler: ContractHandler<AccountId = Self::CrossAccountId, ContractId = H160>;9392 type TreasuryAccountId: Get<Self::AccountId>;94 type TreasuryAccountId: Get<Self::AccountId>;939594 /// The app's pallet id, used for deriving its sovereign account ID.96 /// The app's pallet id, used for deriving its sovereign account ID.98 /// In relay blocks.100 /// In relay blocks.99 #[pallet::constant]101 #[pallet::constant]100 type RecalculationInterval: Get<Self::BlockNumber>;102 type RecalculationInterval: Get<Self::BlockNumber>;101 /// In chain blocks.103 /// In relay blocks.102 #[pallet::constant]104 #[pallet::constant]103 type PendingInterval: Get<Self::BlockNumber>;105 type PendingInterval: Get<Self::BlockNumber>;104106120122121 /// Events compatible with [`frame_system::Config::Event`].123 /// Events compatible with [`frame_system::Config::Event`].122 type Event: IsType<<Self as frame_system::Config>::Event> + From<Event<Self>>;124 type Event: IsType<<Self as frame_system::Config>::Event> + From<Event<Self>>;123124 // /// Number of blocks that pass between treasury balance updates due to inflation125 // #[pallet::constant]126 // type InterestBlockInterval: Get<Self::BlockNumber>;127128 // // Weight information for functions of this pallet.129 // type WeightInfo: WeightInfo;130 }125 }131126132 #[pallet::pallet]127 #[pallet::pallet]146141147 #[pallet::error]142 #[pallet::error]148 pub enum Error<T> {143 pub enum Error<T> {144 /// Error due to action requiring admin to be set149 AdminNotSet,145 AdminNotSet,150 /// No permission to perform action146 /// No permission to perform an action151 NoPermission,147 NoPermission,152 /// Insufficient funds to perform an action148 /// Insufficient funds to perform an action153 NotSufficientFounds,149 NotSufficientFounds,150 /// An error related to the fact that an invalid argument was passed to perform an action154 InvalidArgument,151 InvalidArgument,155 AlreadySponsored,156 }152 }157153158 #[pallet::storage]154 #[pallet::storage]183 QueryKind = ValueQuery,179 QueryKind = ValueQuery,184 >;180 >;185181186 /// A block when app-promotion has started182 /// A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`.187 #[pallet::storage]183 #[pallet::storage]188 pub type StartBlock<T: Config> = StorageValue<Value = T::BlockNumber, QueryKind = ValueQuery>;184 pub type StartBlock<T: Config> = StorageValue<Value = T::BlockNumber, QueryKind = ValueQuery>;189185285 Ok(())281 Ok(())286 }282 }287283284 #[pallet::weight(0)]285 pub fn stop_app_promotion(origin: OriginFor<T>) -> DispatchResult286 where287 <T as frame_system::Config>::BlockNumber: From<u32>,288 {289 ensure_root(origin)?;290291 if <StartBlock<T>>::get() != 0u32.into() {292 <StartBlock<T>>::set(T::BlockNumber::default());293 <NextInterestBlock<T>>::set(T::BlockNumber::default());294 }295296 Ok(())297 }298288 #[pallet::weight(T::WeightInfo::stake())]299 #[pallet::weight(T::WeightInfo::stake())]289 pub fn stake(staker: OriginFor<T>, amount: BalanceOf<T>) -> DispatchResult {300 pub fn stake(staker: OriginFor<T>, amount: BalanceOf<T>) -> DispatchResult {290 let staker_id = ensure_signed(staker)?;301 let staker_id = ensure_signed(staker)?;341 .ok_or(ArithmeticError::Underflow)?,352 .ok_or(ArithmeticError::Underflow)?,342 );353 );343354344 let block = frame_system::Pallet::<T>::block_number() + T::PendingInterval::get();355 let block =356 T::RelayBlockNumberProvider::current_block_number() + T::PendingInterval::get();345 <PendingUnstake<T>>::insert(357 <PendingUnstake<T>>::insert(346 (&staker_id, block),358 (&staker_id, block),347 <PendingUnstake<T>>::get((&staker_id, block))359 <PendingUnstake<T>>::get((&staker_id, block))415 );427 );416 T::CollectionHandler::remove_collection_sponsor(collection_id)428 T::CollectionHandler::remove_collection_sponsor(collection_id)417 }429 }418 }419}420430421impl<T: Config> Pallet<T> {431 #[pallet::weight(0)]422 // pub fn stake(staker: &T::AccountId, amount: BalanceOf<T>) -> DispatchResult {432 pub fn sponsor_conract(admin: OriginFor<T>, contract_id: H160) -> DispatchResult {423 // let balance = <<T as Config>::Currency as Currency<T::AccountId>>::free_balance(staker);433 let admin_id = ensure_signed(admin)?;424434425 // ensure!(balance >= amount, ArithmeticError::Underflow);435 ensure!(436 admin_id == Admin::<T>::get().ok_or(Error::<T>::AdminNotSet)?,437 Error::<T>::NoPermission438 );426439427 // Self::set_lock_unchecked(staker, amount);440 T::ContractHandler::set_sponsor(441 T::CrossAccountId::from_sub(Self::account_id()),442 contract_id,443 )444 }428445429 // let block_number = <T::BlockNumberProvider as BlockNumberProvider>::current_block_number();446 #[pallet::weight(0)]447 pub fn stop_sponsorign_contract(admin: OriginFor<T>, contract_id: H160) -> DispatchResult {448 let admin_id = ensure_signed(admin)?;430449431 // <Staked<T>>::insert(450 ensure!(432 // (staker, block_number),451 admin_id == Admin::<T>::get().ok_or(Error::<T>::AdminNotSet)?,433 // <Staked<T>>::get((staker, block_number))434 // .checked_add(&amount)435 // .ok_or(ArithmeticError::Overflow)?,452 Error::<T>::NoPermission436 // );453 );437454438 // <TotalStaked<T>>::set(455 ensure!(439 // <TotalStaked<T>>::get()456 T::ContractHandler::get_sponsor(contract_id)?.ok_or(<Error<T>>::InvalidArgument)?440 // .checked_add(&amount)457 == T::CrossAccountId::from_sub(Self::account_id()),441 // .ok_or(ArithmeticError::Overflow)?,458 <Error<T>>::NoPermission442 // );459 );443460 T::ContractHandler::remove_contract_sponsor(contract_id)444 // Ok(())461 }445 // }446447 // pub fn unstake(staker: &T::AccountId, amount: BalanceOf<T>) -> DispatchResult {448 // let mut stakes = Staked::<T>::iter_prefix((staker,)).collect::<Vec<_>>();449450 // let total_staked = stakes451 // .iter()452 // .fold(<BalanceOf<T>>::default(), |acc, (_, amount)| acc + *amount);453454 // ensure!(total_staked >= amount, ArithmeticError::Underflow);455456 // <TotalStaked<T>>::set(457 // <TotalStaked<T>>::get()458 // .checked_sub(&amount)459 // .ok_or(ArithmeticError::Underflow)?,460 // );461462 // let block = <T::BlockNumberProvider>::current_block_number() + WEEK.into();463 // <PendingUnstake<T>>::insert(464 // (staker, block),465 // <PendingUnstake<T>>::get((staker, block))466 // .checked_add(&amount)467 // .ok_or(ArithmeticError::Overflow)?,468 // );469470 // stakes.sort_by_key(|(block, _)| *block);471472 // let mut acc_amount = amount;473 // let new_state = stakes474 // .into_iter()475 // .map_while(|(block, balance_per_block)| {476 // if acc_amount == <BalanceOf<T>>::default() {477 // return None;478 // }479 // if acc_amount <= balance_per_block {480 // let res = (block, balance_per_block - acc_amount, acc_amount);481 // acc_amount = <BalanceOf<T>>::default();482 // return Some(res);483 // } else {484 // acc_amount -= balance_per_block;485 // return Some((block, <BalanceOf<T>>::default(), acc_amount));486 // }487 // })488 // .collect::<Vec<_>>();489490 // new_state491 // .into_iter()492 // .for_each(|(block, to_staked, _to_pending)| {493 // if to_staked == <BalanceOf<T>>::default() {494 // <Staked<T>>::remove((staker, block));495 // } else {496 // <Staked<T>>::insert((staker, block), to_staked);497 // }498 // });499500 // Ok(())501 // }502503 // pub fn sponsor_collection(admin: T::AccountId, collection_id: u32) -> DispatchResult {504 // Ok(())505 // }506507 // pub fn stop_sponsorign_collection(admin: T::AccountId, collection_id: u32) -> DispatchResult {508 // Ok(())509 // }510511 pub fn sponsor_conract(admin: T::AccountId, app_id: u32) -> DispatchResult {512 Ok(())513 }462 }463}514464515 pub fn stop_sponsorign_contract(admin: T::AccountId, app_id: u32) -> DispatchResult {465impl<T: Config> Pallet<T> {516 Ok(())517 }518519 pub fn account_id() -> T::AccountId {466 pub fn account_id() -> T::AccountId {520 T::PalletId::get().into_account_truncating()467 T::PalletId::get().into_account_truncating()521 }468 }522}523469524impl<T: Config> Pallet<T> {525 fn unlock_balance_unchecked(staker: &T::AccountId, amount: BalanceOf<T>) {470 fn unlock_balance_unchecked(staker: &T::AccountId, amount: BalanceOf<T>) {526 let mut locked_balance = Self::get_locked_balance(staker).map(|l| l.amount).unwrap();471 let mut locked_balance = Self::get_locked_balance(staker).map(|l| l.amount).unwrap();527 locked_balance -= amount;472 locked_balance -= amount;pallets/app-promotion/src/types.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/types.rs
+++ b/pallets/app-promotion/src/types.rs
@@ -9,7 +9,7 @@
use sp_runtime::DispatchError;
use up_data_structs::{CollectionId, SponsorshipState};
use sp_std::borrow::ToOwned;
-
+use pallet_evm_contract_helpers::{Pallet as EvmHelpersPallet, Config as EvmHelpersConfig, Sponsoring};
pub trait ExtendedLockableCurrency<AccountId: Parameter>: LockableCurrency<AccountId> {
fn locks<KArg>(who: KArg) -> WeakBoundedVec<BalanceLock<Self::Balance>, Self::MaxLocks>
@@ -94,3 +94,40 @@
.map(|acc| acc.to_owned()))
}
}
+
+pub trait ContractHandler {
+ type ContractId;
+ type AccountId;
+
+ fn set_sponsor(sponsor_id: Self::AccountId, contract_id: Self::ContractId) -> DispatchResult;
+
+ fn remove_contract_sponsor(collection_id: Self::ContractId) -> DispatchResult;
+
+ fn get_sponsor(contract_id: Self::ContractId)
+ -> Result<Option<Self::AccountId>, DispatchError>;
+}
+
+impl<T: EvmHelpersConfig> ContractHandler for EvmHelpersPallet<T> {
+ type ContractId = sp_core::H160;
+
+ type AccountId = T::CrossAccountId;
+
+ fn set_sponsor(sponsor_id: Self::AccountId, contract_id: Self::ContractId) -> DispatchResult {
+ Sponsoring::<T>::insert(
+ contract_id,
+ SponsorshipState::<T::CrossAccountId>::Confirmed(sponsor_id),
+ );
+ Ok(())
+ }
+
+ fn remove_contract_sponsor(contract_id: Self::ContractId) -> DispatchResult {
+ Sponsoring::<T>::remove(contract_id);
+ Ok(())
+ }
+
+ fn get_sponsor(
+ contract_id: Self::ContractId,
+ ) -> Result<Option<Self::AccountId>, DispatchError> {
+ Ok(Self::get_sponsor(contract_id))
+ }
+}
pallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/lib.rs
+++ b/pallets/evm-contract-helpers/src/lib.rs
@@ -75,7 +75,7 @@
/// * **Key** - contract address.
/// * **Value** - sponsorship state.
#[pallet::storage]
- pub(super) type Sponsoring<T: Config> = StorageMap<
+ pub type Sponsoring<T: Config> = StorageMap<
Hasher = Twox64Concat,
Key = H160,
Value = SponsorshipState<T::CrossAccountId>,
primitives/common/src/constants.rsdiffbeforeafterboth--- a/primitives/common/src/constants.rs
+++ b/primitives/common/src/constants.rs
@@ -22,6 +22,7 @@
use crate::types::{BlockNumber, Balance};
pub const MILLISECS_PER_BLOCK: u64 = 12000;
+pub const MILLISECS_PER_RELAY_BLOCK: u64 = 6000;
pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
@@ -30,6 +31,11 @@
pub const HOURS: BlockNumber = MINUTES * 60;
pub const DAYS: BlockNumber = HOURS * 24;
+// These time units are defined in number of relay blocks.
+pub const RELAY_MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_RELAY_BLOCK as BlockNumber);
+pub const RELAY_HOURS: BlockNumber = RELAY_MINUTES * 60;
+pub const RELAY_DAYS: BlockNumber = RELAY_HOURS * 24;
+
pub const MICROUNIQUE: Balance = 1_000_000_000_000;
pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE;
pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE;
runtime/common/config/pallets/app_promotion.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/app_promotion.rs
+++ b/runtime/common/config/pallets/app_promotion.rs
@@ -16,28 +16,40 @@
use crate::{
runtime_common::config::pallets::{TreasuryAccountId, RelayChainBlockNumberProvider},
- Runtime, Balances, BlockNumber, Unique, Event,
+ Runtime, Balances, BlockNumber, Unique, Event, EvmContractHelpers,
};
use frame_support::{parameter_types, PalletId};
use sp_arithmetic::Perbill;
use up_common::{
- constants::{DAYS, UNIQUE},
+ constants::{DAYS, UNIQUE, RELAY_DAYS},
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 = 20;
- pub const PendingInterval: BlockNumber = 10;
+ pub const PendingInterval: BlockNumber = 20;
pub const Nominal: Balance = UNIQUE;
pub const Day: BlockNumber = DAYS;
- pub IntervalIncome: Perbill = Perbill::from_rational(RecalculationInterval::get(), 2 * DAYS) * Perbill::from_rational(5u32, 10_000);
+ 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;
+ pub const PendingInterval: BlockNumber = 7 * RELAY_DAYS;
+ pub const Nominal: Balance = UNIQUE;
+ pub const Day: BlockNumber = RELAY_DAYS;
+ pub IntervalIncome: Perbill = Perbill::from_rational(5u32, 10_000);
}
impl pallet_app_promotion::Config for Runtime {
type PalletId = AppPromotionId;
type CollectionHandler = Unique;
+ type ContractHandler = EvmContractHelpers;
type Currency = Balances;
type WeightInfo = pallet_app_promotion::weights::SubstrateWeight<Self>;
type TreasuryAccountId = TreasuryAccountId;
tests/src/app-promotion.test.tsdiffbeforeafterboth--- a/tests/src/app-promotion.test.ts
+++ b/tests/src/app-promotion.test.ts
@@ -706,6 +706,12 @@
nominal = helper.balance.getOneTokenNominal();
});
});
+
+ after(async function () {
+ await usingPlaygrounds(async (helper) => {
+ await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.stopAppPromotion()));
+ });
+ });
it('will credit 0.05% for staking period', async () => {
// arrange: bob.stake(10000);
@@ -770,39 +776,24 @@
const staker = await createUser(40n * nominal);
await waitForRecalculationBlock(helper.api!);
- // const foo = await helper.api!.registry.getChainProperties().
+
await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled;
- // await waitNewBlocks(helper.api!, 1);
+
await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled;
- // await waitNewBlocks(helper.api!, 1);
+
await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled;
- // console.log(await helper.balance.getSubstrate(staker.address));
- // await waitNewBlocks(helper.api!, 17);
+
await waitForRelayBlock(helper.api!, 34);
expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker)))
.map(([_, amount]) => amount.toBigInt()))
.to.be.deep.equal([calculateIncome(10n * nominal, 10n), calculateIncome(10n * nominal, 10n), calculateIncome(10n * nominal, 10n)]);
- // console.log(await getBlockNumber(helper.api!));
- // console.log((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([block, amount]) => [block.toBigInt(), amount.toBigInt()]));
- // console.log(`${calculateIncome(10n * nominal, 10n)} || ${calculateIncome(10n * nominal, 10n, 2)}`);
- // await waitNewBlocks(helper.api!, 10);
await waitForRelayBlock(helper.api!, 20);
- // console.log((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()));
- // console.log(await helper.balance.getSubstrate(staker.address));
await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(calculateIncome(10n * nominal, 10n, 2) - 10n * nominal))).to.be.eventually.fulfilled;
- // console.log(calculateIncome(10n * nominal, 10n, 2));
- // console.log(calculateIncome(10n * nominal, 10n, 3));
- // console.log(calculateIncome(10n * nominal, 10n, 4));
- // console.log(calculateIncome(10n * nominal, 10n, 5));
expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker)))
.map(([_, amount]) => amount.toBigInt()))
.to.be.deep.equal([10n * nominal, calculateIncome(10n * nominal, 10n, 2), calculateIncome(10n * nominal, 10n, 2)]);
-
- // console.log((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()));
-
- // console.log(await helper.balance.getSubstrate(staker.address));
});
});
tests/src/interfaces/augment-api-consts.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-consts.ts
+++ b/tests/src/interfaces/augment-api-consts.ts
@@ -78,7 +78,7 @@
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
- * In chain blocks.
+ * In relay blocks.
**/
pendingInterval: u32 & AugmentedConst<ApiType>;
/**
tests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-errors.ts
+++ b/tests/src/interfaces/augment-api-errors.ts
@@ -430,11 +430,16 @@
[key: string]: AugmentedError<ApiType>;
};
promotion: {
+ /**
+ * Error due to action requiring admin to be set
+ **/
AdminNotSet: AugmentedError<ApiType>;
- AlreadySponsored: AugmentedError<ApiType>;
+ /**
+ * An error related to the fact that an invalid argument was passed to perform an action
+ **/
InvalidArgument: AugmentedError<ApiType>;
/**
- * No permission to perform action
+ * No permission to perform an action
**/
NoPermission: AugmentedError<ApiType>;
/**
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -525,7 +525,7 @@
**/
staked: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<u128>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
/**
- * A block when app-promotion has started
+ * A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`.
**/
startBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
totalStaked: AugmentedQuery<ApiType, () => Observable<u128>, []> & 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
@@ -365,9 +365,12 @@
promotion: {
setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr]>;
sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ sponsorConract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
startAppPromotion: AugmentedSubmittable<(promotionStartRelayBlock: Option<u32> | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u32>]>;
+ stopAppPromotion: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
stopSponsorignCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ stopSponsorignContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
unstake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
/**
* Generic tx
tests/src/interfaces/default/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/default/types.ts
+++ b/tests/src/interfaces/default/types.ts
@@ -816,6 +816,7 @@
readonly asStartAppPromotion: {
readonly promotionStartRelayBlock: Option<u32>;
} & Struct;
+ readonly isStopAppPromotion: boolean;
readonly isStake: boolean;
readonly asStake: {
readonly amount: u128;
@@ -832,7 +833,15 @@
readonly asStopSponsorignCollection: {
readonly collectionId: u32;
} & Struct;
- readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection';
+ readonly isSponsorConract: boolean;
+ readonly asSponsorConract: {
+ readonly contractId: H160;
+ } & Struct;
+ readonly isStopSponsorignContract: boolean;
+ readonly asStopSponsorignContract: {
+ readonly contractId: H160;
+ } & Struct;
+ readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection' | 'SponsorConract' | 'StopSponsorignContract';
}
/** @name PalletAppPromotionError */
@@ -841,8 +850,7 @@
readonly isNoPermission: boolean;
readonly isNotSufficientFounds: boolean;
readonly isInvalidArgument: boolean;
- readonly isAlreadySponsored: boolean;
- readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument' | 'AlreadySponsored';
+ readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument';
}
/** @name PalletAppPromotionEvent */
tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -2463,6 +2463,7 @@
start_app_promotion: {
promotionStartRelayBlock: 'Option<u32>',
},
+ stop_app_promotion: 'Null',
stake: {
amount: 'u128',
},
@@ -2473,7 +2474,13 @@
collectionId: 'u32',
},
stop_sponsorign_collection: {
- collectionId: 'u32'
+ collectionId: 'u32',
+ },
+ sponsor_conract: {
+ contractId: 'H160',
+ },
+ stop_sponsorign_contract: {
+ contractId: 'H160'
}
}
},
@@ -3098,7 +3105,7 @@
* Lookup410: pallet_app_promotion::pallet::Error<T>
**/
PalletAppPromotionError: {
- _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'InvalidArgument', 'AlreadySponsored']
+ _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'InvalidArgument']
},
/**
* Lookup413: pallet_evm::pallet::Error<T>
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -2669,6 +2669,7 @@
readonly asStartAppPromotion: {
readonly promotionStartRelayBlock: Option<u32>;
} & Struct;
+ readonly isStopAppPromotion: boolean;
readonly isStake: boolean;
readonly asStake: {
readonly amount: u128;
@@ -2685,7 +2686,15 @@
readonly asStopSponsorignCollection: {
readonly collectionId: u32;
} & Struct;
- readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection';
+ readonly isSponsorConract: boolean;
+ readonly asSponsorConract: {
+ readonly contractId: H160;
+ } & Struct;
+ readonly isStopSponsorignContract: boolean;
+ readonly asStopSponsorignContract: {
+ readonly contractId: H160;
+ } & Struct;
+ readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection' | 'SponsorConract' | 'StopSponsorignContract';
}
/** @name PalletEvmCall (305) */
@@ -3288,8 +3297,7 @@
readonly isNoPermission: boolean;
readonly isNotSufficientFounds: boolean;
readonly isInvalidArgument: boolean;
- readonly isAlreadySponsored: boolean;
- readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument' | 'AlreadySponsored';
+ readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument';
}
/** @name PalletEvmError (413) */