mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 04:51:01 +00:00
Remove without_storage_info from pallet transaction-storage (#11668)
* Introduce BoundedVec * Fix typos * Add comments to the bounds * Remove migration * Improve bound value access syntax
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
use super::*;
|
||||
use frame_benchmarking::{benchmarks, whitelisted_caller};
|
||||
use frame_support::traits::{Currency, OnFinalize, OnInitialize};
|
||||
use frame_support::traits::{Currency, Get, OnFinalize, OnInitialize};
|
||||
use frame_system::{EventRecord, Pallet as System, RawOrigin};
|
||||
use sp_runtime::traits::{Bounded, One, Zero};
|
||||
use sp_std::*;
|
||||
@@ -126,7 +126,7 @@ pub fn run_to_block<T: Config>(n: T::BlockNumber) {
|
||||
|
||||
benchmarks! {
|
||||
store {
|
||||
let l in 1 .. MaxTransactionSize::<T>::get();
|
||||
let l in 1 .. T::MaxTransactionSize::get();
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
T::Currency::make_free_balance_be(&caller, BalanceOf::<T>::max_value());
|
||||
}: _(RawOrigin::Signed(caller.clone()), vec![0u8; l as usize])
|
||||
@@ -140,7 +140,7 @@ benchmarks! {
|
||||
T::Currency::make_free_balance_be(&caller, BalanceOf::<T>::max_value());
|
||||
TransactionStorage::<T>::store(
|
||||
RawOrigin::Signed(caller.clone()).into(),
|
||||
vec![0u8; MaxTransactionSize::<T>::get() as usize],
|
||||
vec![0u8; T::MaxTransactionSize::get() as usize],
|
||||
)?;
|
||||
run_to_block::<T>(1u32.into());
|
||||
}: _(RawOrigin::Signed(caller.clone()), T::BlockNumber::zero(), 0)
|
||||
@@ -152,10 +152,10 @@ benchmarks! {
|
||||
run_to_block::<T>(1u32.into());
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
T::Currency::make_free_balance_be(&caller, BalanceOf::<T>::max_value());
|
||||
for _ in 0 .. MaxBlockTransactions::<T>::get() {
|
||||
for _ in 0 .. T::MaxBlockTransactions::get() {
|
||||
TransactionStorage::<T>::store(
|
||||
RawOrigin::Signed(caller.clone()).into(),
|
||||
vec![0u8; MaxTransactionSize::<T>::get() as usize],
|
||||
vec![0u8; T::MaxTransactionSize::get() as usize],
|
||||
)?;
|
||||
}
|
||||
run_to_block::<T>(StoragePeriod::<T>::get() + T::BlockNumber::one());
|
||||
|
||||
Reference in New Issue
Block a user