Skip to content

Commit

Permalink
fix benchmarks for higher ED (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi authored Aug 11, 2024
1 parent 6df6036 commit d9223be
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions teerdays/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,37 @@ benchmarks! {
bond {
pallet_timestamp::Pallet::<T>::set_timestamp(0u32.into());
let signer: T::AccountId = account("alice", 1, 1);
T::Currency::make_free_balance_be(&signer, 10_000u32.into());
}: _(RawOrigin::Signed(signer.clone()), 1_000u32.into())
T::Currency::make_free_balance_be(&signer, 4_000_000_000u32.into());
}: _(RawOrigin::Signed(signer.clone()), 2_000_000_000u32.into())
verify {
assert!(TeerDays::<T>::teerday_bonds(&signer).is_some());
}

unbond {
pallet_timestamp::Pallet::<T>::set_timestamp(0u32.into());
let signer: T::AccountId = account("alice", 1, 1);
T::Currency::make_free_balance_be(&signer, 10_000u32.into());
TeerDays::<T>::bond(RawOrigin::Signed(signer.clone()).into(), 1_000u32.into())?;
}: _(RawOrigin::Signed(signer.clone()), 500u32.into())
T::Currency::make_free_balance_be(&signer, 4_000_000_000u32.into());
TeerDays::<T>::bond(RawOrigin::Signed(signer.clone()).into(), 2_000_000_000u32.into())?;
}: _(RawOrigin::Signed(signer.clone()), 1_000_000_000u32.into())
verify {
assert!(TeerDays::<T>::teerday_bonds(&signer).is_some());
}

update_other {
pallet_timestamp::Pallet::<T>::set_timestamp(0u32.into());
let signer: T::AccountId = account("alice", 1, 1);
T::Currency::make_free_balance_be(&signer, 10_000u32.into());
TeerDays::<T>::bond(RawOrigin::Signed(signer.clone()).into(), 1_000u32.into())?;
T::Currency::make_free_balance_be(&signer, 4_000_000_000u32.into());
TeerDays::<T>::bond(RawOrigin::Signed(signer.clone()).into(), 1_000_000_000u32.into())?;
}: _(RawOrigin::Signed(signer.clone()), signer.clone())
verify {
assert!(TeerDays::<T>::teerday_bonds(&signer).is_some());
}
withdraw_unbonded {
pallet_timestamp::Pallet::<T>::set_timestamp(42u32.into());
let signer: T::AccountId = account("alice", 1, 1);
T::Currency::make_free_balance_be(&signer, 10_000u32.into());
T::Currency::set_lock(TEERDAYS_ID, &signer, 1_000u32.into(), WithdrawReasons::all());
PendingUnlock::<T>::insert::<_, (T::Moment, BalanceOf<T>)>(&signer, (42u32.into(), 1_000u32.into()));
T::Currency::make_free_balance_be(&signer, 4_000_000_000u32.into());
T::Currency::set_lock(TEERDAYS_ID, &signer, 1_000_000_000u32.into(), WithdrawReasons::all());
PendingUnlock::<T>::insert::<_, (T::Moment, BalanceOf<T>)>(&signer, (42u32.into(), 1_000_000_000u32.into()));
}: _(RawOrigin::Signed(signer.clone()))
verify {
assert!(TeerDays::<T>::pending_unlock(&signer).is_none());
Expand Down

0 comments on commit d9223be

Please sign in to comment.