Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
gitofdeepanshu committed Jun 27, 2023
1 parent 1937622 commit e1b0d3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pallets/block-reward/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@

pub use pallet::*;

use astar_primitives::Balance;
use frame_support::pallet_prelude::*;
use frame_support::{
log,
Expand All @@ -95,7 +96,6 @@ pub mod benchmarking;
mod mock;
#[cfg(test)]
mod tests;
use astar_primitives::Balance;

pub mod weights;
pub use weights::WeightInfo;
Expand Down
10 changes: 5 additions & 5 deletions pallets/dapps-staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ benchmarks! {
let (developer, contract_id) = register_contract::<T>(1)?;
let stakers = prepare_bond_and_stake::<T>(1, &contract_id, SEED)?;
let staker = stakers[0].clone();
let stake_amount = Balance::max_value() / u128::from(2u32);
let stake_amount = Balance::max_value() / 2u128;

DappsStaking::<T>::bond_and_stake(RawOrigin::Signed(staker.clone()).into(), contract_id.clone(), stake_amount)?;
DappsStaking::<T>::unregister(RawOrigin::Root.into(), contract_id.clone())?;
Expand All @@ -175,7 +175,7 @@ benchmarks! {

let staker = whitelisted_caller();
let _ = T::Currency::make_free_balance_be(&staker, Balance::max_value());
let amount = Balance::max_value() / u128::from(2u32);
let amount = Balance::max_value() / 2u128;

}: _(RawOrigin::Signed(staker.clone()), contract_id.clone(), amount)
verify {
Expand All @@ -189,7 +189,7 @@ benchmarks! {

let staker = whitelisted_caller();
let _ = T::Currency::make_free_balance_be(&staker, Balance::max_value());
let amount = Balance::max_value() / u128::from(2u32);
let amount = Balance::max_value() / 2u128;

DappsStaking::<T>::bond_and_stake(RawOrigin::Signed(staker.clone()).into(), contract_id.clone(), amount)?;

Expand All @@ -205,8 +205,8 @@ benchmarks! {

let staker = whitelisted_caller();
let _ = T::Currency::make_free_balance_be(&staker, Balance::max_value());
let stake_amount = Balance::max_value() / u128::from(2u32);
let unstake_amount = stake_amount / u128::from(2u32);
let stake_amount = Balance::max_value() / 2u128;
let unstake_amount = stake_amount / 2u128;

DappsStaking::<T>::bond_and_stake(RawOrigin::Signed(staker.clone()).into(), contract_id.clone(), stake_amount)?;
DappsStaking::<T>::unbond_and_unstake(RawOrigin::Signed(staker.clone()).into(), contract_id, unstake_amount)?;
Expand Down

0 comments on commit e1b0d3a

Please sign in to comment.