mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 21:17:56 +00:00
Fix Benchmark Regressions in Polkadot Parachain Auction System (#5139)
* integration tests use offset * fix slots * fix auctions * add auctions benchmark * fix crowdloan
This commit is contained in:
@@ -1772,6 +1772,10 @@ mod benchmarking {
|
||||
|
||||
// Worst case scenario a new bid comes in which kicks out an existing bid for the same slot.
|
||||
bid {
|
||||
// If there is an offset, we need to be on that block to be able to do lease things.
|
||||
let (_, offset) = T::Leaser::lease_period_length();
|
||||
frame_system::Pallet::<T>::set_block_number(offset + One::one());
|
||||
|
||||
// Create a new auction
|
||||
let duration = T::BlockNumber::max_value();
|
||||
let lease_period_index = LeasePeriodOf::<T>::zero();
|
||||
@@ -1818,8 +1822,12 @@ mod benchmarking {
|
||||
// Worst case: 10 bidders taking all wining spots, and we need to calculate the winner for auction end.
|
||||
// Entire winner map should be full and removed at the end of the benchmark.
|
||||
on_initialize {
|
||||
// If there is an offset, we need to be on that block to be able to do lease things.
|
||||
let (lease_length, offset) = T::Leaser::lease_period_length();
|
||||
frame_system::Pallet::<T>::set_block_number(offset + One::one());
|
||||
|
||||
// Create a new auction
|
||||
let duration: T::BlockNumber = 99u32.into();
|
||||
let duration: T::BlockNumber = lease_length / 2u32.into();
|
||||
let lease_period_index = LeasePeriodOf::<T>::zero();
|
||||
let now = frame_system::Pallet::<T>::block_number();
|
||||
Auctions::<T>::new_auction(RawOrigin::Root.into(), duration, lease_period_index)?;
|
||||
@@ -1857,8 +1865,12 @@ mod benchmarking {
|
||||
|
||||
// Worst case: 10 bidders taking all wining spots, and winning data is full.
|
||||
cancel_auction {
|
||||
// If there is an offset, we need to be on that block to be able to do lease things.
|
||||
let (lease_length, offset) = T::Leaser::lease_period_length();
|
||||
frame_system::Pallet::<T>::set_block_number(offset + One::one());
|
||||
|
||||
// Create a new auction
|
||||
let duration: T::BlockNumber = 99u32.into();
|
||||
let duration: T::BlockNumber = lease_length / 2u32.into();
|
||||
let lease_period_index = LeasePeriodOf::<T>::zero();
|
||||
let now = frame_system::Pallet::<T>::block_number();
|
||||
Auctions::<T>::new_auction(RawOrigin::Root.into(), duration, lease_period_index)?;
|
||||
|
||||
Reference in New Issue
Block a user