Skip to content

Commit

Permalink
add extrinsic to reset the price
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathy-bajo committed Jan 26, 2025
1 parent 88f18a5 commit e025963
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
26 changes: 0 additions & 26 deletions substrate/frame/broker/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,32 +1059,6 @@ mod benches {
Ok(())
}

#[benchmark]
fn reset_base_price() -> Result<(), BenchmarkError> {
let origin =
T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;

let new_price = 100u32.into(); // Example new price
#[extrinsic_call]
_(origin, new_price);

assert_eq!(OverriddenEndPrice::<T>::get(), Some(new_price));
Ok(())
}

#[benchmark]
fn clear_overridden_price() -> Result<(), BenchmarkError> {
OverriddenEndPrice::<T>::put(100u32.into()); // Set initial price
let origin =
T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;

#[extrinsic_call]
_(origin);

assert!(OverriddenEndPrice::<T>::get().is_none());
Ok(())
}

#[benchmark]
fn swap_leases() -> Result<(), BenchmarkError> {
let admin_origin =
Expand Down
1 change: 0 additions & 1 deletion substrate/frame/broker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,6 @@ pub mod pallet {
SovereignAccountNotFound,
/// Attempted to disable auto-renewal for a core that didn't have it enabled.
AutoRenewalNotEnabled,
InvalidPrice,
}

#[derive(frame_support::DefaultNoBound)]
Expand Down

0 comments on commit e025963

Please sign in to comment.