Skip to content

Commit

Permalink
Force calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Dec 21, 2023
1 parent 9c7e61a commit 14f5c04
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions pallets/dapp-staking-v3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,36 @@ pub mod pallet {

Ok(())
}

// TODO: remove this prior to Astar launch, to be only used for testing
#[pallet::call_index(100)]
#[pallet::weight(T::DbWeight::get().writes(1))]
pub fn force_set_tier_params(
origin: OriginFor<T>,
value: TierParameters<T::NumberOfTiers>,
) -> DispatchResult {
Self::ensure_pallet_enabled()?;
T::ManagerOrigin::ensure_origin(origin)?;

StaticTierParams::<T>::put(value);

Ok(())
}

// TODO: remove this prior to Astar launch, to be only used for testing
#[pallet::call_index(101)]
#[pallet::weight(T::DbWeight::get().writes(1))]
pub fn force_set_tier_config(
origin: OriginFor<T>,
value: TiersConfiguration<T::NumberOfTiers>,
) -> DispatchResult {
Self::ensure_pallet_enabled()?;
T::ManagerOrigin::ensure_origin(origin)?;

TierConfig::<T>::put(value);

Ok(())
}
}

impl<T: Config> Pallet<T> {
Expand Down

0 comments on commit 14f5c04

Please sign in to comment.