fn prepare_stake<T: Config>(
	number_of_stakers: u32,
	provider_id: &T::ProviderId,
	seed: u32,
) -> Result<Vec<T::AccountId>, &'static str> {
	let stake_balance = T::MinimumStakingAmount::get();
	let mut stakers = Vec::new();

	for id in 0..number_of_stakers {
		let staker_acc: T::AccountId = account("pre_staker", id, seed);
		stakers.push(staker_acc.clone());
		T::Currency::make_free_balance_be(&staker_acc, BalanceOf::<T>::max_value());

		DapiStaking::<T>::stake(
			RawOrigin::Signed(staker_acc).into(),
			provider_id.clone(),
			stake_balance.clone(),
		)?;
	}

	Ok(stakers)
}
/// Used to stake the given provider with the specified amount of stakers.
/// Method will create new staker accounts using the provided seed.
///
/// Returns all created staker accounts in a vector.
Used to stake the given provider with the specified amount of stakers.
Method will create new staker accounts using the provided seed.

Returns all created staker accounts in a vector.
Used to stake the given provider with the specified amount of stakers . Method will create new staker accounts using the provided seed . Returns all created staker accounts in a vector .
fn prepare_stake<T: Config>(
	number_of_stakers: u32,
	provider_id: &T::ProviderId,
	seed: u32,
) -> Result<Vec<T::AccountId>, &'static str> {
	let stake_balance = T::MinimumStakingAmount::get();
	let mut stakers = Vec::new();
	for id in 0..number_of_stakers {
		let staker_acc: T::AccountId = account("pre_staker", id, seed);
		stakers.push(staker_acc.clone());
		T::Currency::make_free_balance_be(&staker_acc, BalanceOf::<T>::max_value());
		DapiStaking::<T>::stake(
			RawOrigin::Signed(staker_acc).into(),
			provider_id.clone(),
			stake_balance.clone(),
		)?;
	}
	Ok(stakers)
}
fn prepare_stake < T : Config > ( number_of_stakers : u32 , provider_id : & T :: ProviderId , seed : u32 , ) -> Result < Vec < T :: AccountId > , & ' static str > { let stake_balance = T :: MinimumStakingAmount :: get ( ) ; let mut stakers = Vec :: new ( ) ; for id in 0 .. number_of_stakers { let staker_acc : T :: AccountId = account ( " " , id , seed ) ; stakers . push ( staker_acc . clone ( ) ) ; T :: Currency :: make_free_balance_be ( & staker_acc , BalanceOf :: < T > :: max_value ( ) ) ; DapiStaking :: < T > :: stake ( RawOrigin :: Signed ( staker_acc ) . into ( ) , provider_id . clone ( ) , stake_balance . clone ( ) , ) ? ; } Ok ( stakers ) }
Used to stake the given provider with the specified amount of stakers.
Used to stake the given provider with the specified amount of stakers .
number_of_stakers
u32
provider_id
&T::ProviderId
seed
u32