Skip to content

Commit

Permalink
fix timegraph benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
haider-rs committed Oct 3, 2024
1 parent adc2c68 commit bb0df96
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pallets/timegraph/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod benchmarks {
fn deposit() {
let caller = whitelisted_caller();
let recipient = account("recipient", 0, 1);
let amount: BalanceOf<T> = 500_000_000_u32.into();
let amount: BalanceOf<T> = 5_000_000_u32.into();
let amount_be: BalanceOf<T> = amount * 100u32.into();
T::Currency::make_free_balance_be(&caller, amount_be);
#[extrinsic_call]
Expand All @@ -27,7 +27,7 @@ mod benchmarks {
fn withdraw() {
let caller = whitelisted_caller();
let recipient = account("recipient", 0, 1);
let amount: BalanceOf<T> = 500_000_000_u32.into();
let amount: BalanceOf<T> = 5_000_000_u32.into();
let sequence = 1;
let amount_be: BalanceOf<T> = amount * 100u32.into();
T::Currency::make_free_balance_be(&caller, amount_be);
Expand Down
8 changes: 8 additions & 0 deletions runtimes/mainnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,21 @@ impl pallet_babe::Config for Runtime {
pallet_babe::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>;
}

#[cfg(not(feature = "runtime-benchmarks"))]
parameter_types! {
pub const ExistentialDeposit: Balance = 1 * MILLIANLOG;
}
parameter_types! {
// For weight estimation, we assume that the most locks on an individual account will be 50.
// This number may need to be adjusted in the future if this assumption no longer holds true.
pub const MaxLocks: u32 = 50;
pub const MaxReserves: u32 = 50;
}
#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
// Use more u32 friendly value for benchmark runtime and AtLeast32Bit
pub const ExistentialDeposit: Balance = 1_000_000;
}

impl pallet_balances::Config for Runtime {
type RuntimeHoldReason = RuntimeHoldReason;
Expand Down

0 comments on commit bb0df96

Please sign in to comment.