Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unused method #1964

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions pallets/liquid-staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,6 @@ benchmarks! {
assert_eq!(CommissionRate::<T>::get(), COMMISSION_RATE);
}

update_incentive {
}: _(SystemOrigin::Root, BalanceOf::<T>::one())
verify {
assert_eq!(Incentive::<T>::get(), BalanceOf::<T>::one());
}

update_staking_ledger_cap {
}: _(SystemOrigin::Root, STAKING_LEDGER_CAP)
verify {
Expand Down
25 changes: 2 additions & 23 deletions pallets/liquid-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,6 @@ pub mod pallet {
/// Fast Unstake Matched
/// [unstaker, received_staking_amount, matched_liquid_amount, fee_in_liquid_currency]
FastUnstakeMatched(T::AccountId, BalanceOf<T>, BalanceOf<T>, BalanceOf<T>),
/// Incentive amount was updated
IncentiveUpdated(BalanceOf<T>),
/// Unstake_reserve_factor was updated
UnstakeReserveFactorUpdated(Ratio),
/// Event emitted when the unstake reserves are reduced
Expand Down Expand Up @@ -449,11 +447,6 @@ pub mod pallet {
#[pallet::getter(fn is_matched)]
pub type IsMatched<T: Config> = StorageValue<_, bool, ValueQuery>;

/// Incentive for users who successfully update era/ledger
#[pallet::storage]
#[pallet::getter(fn incentive)]
pub type Incentive<T: Config> = StorageValue<_, BalanceOf<T>, ValueQuery>;

#[derive(Default)]
#[pallet::genesis_config]
pub struct GenesisConfig {
Expand Down Expand Up @@ -1084,22 +1077,8 @@ pub mod pallet {
Ok(())
}

/// Update incentive amount
#[pallet::call_index(23)]
#[pallet::weight(<T as Config>::WeightInfo::update_incentive())]
#[transactional]
pub fn update_incentive(
origin: OriginFor<T>,
#[pallet::compact] amount: BalanceOf<T>,
) -> DispatchResult {
T::UpdateOrigin::ensure_origin(origin)?;
Incentive::<T>::put(amount);
Self::deposit_event(Event::<T>::IncentiveUpdated(amount));
Ok(())
}

/// Update insurance pool's unstake_reserve_factor
#[pallet::call_index(24)]
#[pallet::call_index(23)]
#[pallet::weight(<T as Config>::WeightInfo::update_reserve_factor())]
#[transactional]
pub fn update_unstake_reserve_factor(
Expand All @@ -1125,7 +1104,7 @@ pub mod pallet {
}

/// Reduces unstake reserves by transferring to receiver.
#[pallet::call_index(25)]
#[pallet::call_index(24)]
#[pallet::weight(<T as Config>::WeightInfo::reduce_reserves())]
#[transactional]
pub fn reduce_unstake_reserves(
Expand Down
12 changes: 0 additions & 12 deletions pallets/liquid-staking/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ pub trait WeightInfo {
fn cancel_unstake() -> Weight;
fn update_commission_rate() -> Weight;
fn fast_match_unstake(n: u32, ) -> Weight;
fn update_incentive() -> Weight;
}

/// Weights for pallet_liquid_staking using the Substrate node and recommended hardware.
Expand Down Expand Up @@ -383,11 +382,6 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
.saturating_add(T::DbWeight::get().writes(4 as u64))
.saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(n as u64)))
}
fn update_incentive() -> Weight {
Weight::from_ref_time(40_612_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
}

// For backwards compatibility and tests
Expand Down Expand Up @@ -702,10 +696,4 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().writes(4 as u64))
.saturating_add(RocksDbWeight::get().writes((4 as u64).saturating_mul(n as u64)))
}

fn update_incentive() -> Weight {
Weight::from_ref_time(40_612_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
}
6 changes: 0 additions & 6 deletions runtime/heiko/src/weights/pallet_liquid_staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,6 @@ impl<T: frame_system::Config> pallet_liquid_staking::WeightInfo for WeightInfo<T
Weight::from_ref_time(26_265_000)
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: LiquidStaking Incentive (r:0 w:1)
fn update_incentive() -> Weight {
// Minimum execution time: 25_703 nanoseconds.
Weight::from_ref_time(26_527_000)
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: LiquidStaking StakingLedgerCap (r:1 w:1)
fn update_staking_ledger_cap() -> Weight {
// Minimum execution time: 29_266 nanoseconds.
Expand Down
6 changes: 0 additions & 6 deletions runtime/kerria/src/weights/pallet_liquid_staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,4 @@ impl<T: frame_system::Config> pallet_liquid_staking::WeightInfo for WeightInfo<T
.saturating_add(T::DbWeight::get().writes(4 as u64))
.saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(n as u64)))
}

fn update_incentive() -> Weight {
Weight::from_ref_time(39_392_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
}
6 changes: 0 additions & 6 deletions runtime/parallel/src/weights/pallet_liquid_staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,6 @@ impl<T: frame_system::Config> pallet_liquid_staking::WeightInfo for WeightInfo<T
Weight::from_ref_time(25_664_000)
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: LiquidStaking Incentive (r:0 w:1)
fn update_incentive() -> Weight {
// Minimum execution time: 25_110 nanoseconds.
Weight::from_ref_time(25_596_000)
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: LiquidStaking StakingLedgerCap (r:1 w:1)
fn update_staking_ledger_cap() -> Weight {
// Minimum execution time: 28_073 nanoseconds.
Expand Down
5 changes: 0 additions & 5 deletions runtime/vanilla/src/weights/pallet_liquid_staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,4 @@ impl<T: frame_system::Config> pallet_liquid_staking::WeightInfo for WeightInfo<T
.saturating_add(T::DbWeight::get().writes(4 as u64))
.saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(n as u64)))
}
fn update_incentive() -> Weight {
Weight::from_ref_time(39_392_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
}
Loading