Skip to content

Commit

Permalink
Fixed error
Browse files Browse the repository at this point in the history
  • Loading branch information
ndkazu committed Oct 27, 2023
1 parent 0c6a8ba commit afe1ccb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pallets/bidding/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ impl<T: Config> Pallet<T> {

let mut remaining_amount = asset_price.clone();
//Max contribution from asset Price
let max_contribution = T::MaxContribution::get().mul_floor(asset_price.clone());
let max_contribution = T::MaxContributionper::get().mul_floor(asset_price.clone());
//Min contribution from asset price
let min_contribution = <T as Config>::MinContribution::get().mul_floor(asset_price);
let min_contribution = <T as Config>::MinContributionper::get().mul_floor(asset_price);

//get the list of investors accounts
let mut investors = vec![];
Expand Down Expand Up @@ -65,7 +65,7 @@ impl<T: Config> Pallet<T> {

/// Randomly choose an investor from among an investors list, & returns investoraccount plus index in the list.
/// Returns `None` if there are no investors in the list.
fn choose_investor(mut investors: Vec<AccountIdOf<T>>) -> (Option<AccountIdOf<T>>,usize) {
fn choose_investor(investors: Vec<AccountIdOf<T>>) -> (Option<AccountIdOf<T>>,usize) {
let total = investors.len() as u32;
if total == 0 {
return (None,0)
Expand Down
4 changes: 2 additions & 2 deletions pallets/bidding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ pub mod pallet {
#[pallet::constant]
type MaxGenerateRandom: Get<u32>;
#[pallet::constant]
type MaxContribution: Get<Percent>;
type MaxContributionper: Get<Percent>;
#[pallet::constant]
type MinContribution: Get<Percent>;
type MinContributionper: Get<Percent>;
}

/// A storage item for this pallet.
Expand Down
8 changes: 4 additions & 4 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,16 @@ impl pallet_roles::Config for Runtime {

parameter_types!{
pub const MaxGenerateRandom:u32 =60;
pub const MinContribution: Percent= Percent::from_percent(5);
pub const MaxContribution: Percent= Percent::from_percent(30);
pub const MinContributionper: Percent= Percent::from_percent(5);
pub const MaxContributionper: Percent= Percent::from_percent(30);

}
impl pallet_bidding::Config for Runtime{
type RuntimeEvent = RuntimeEvent;
type MaxGenerateRandom = MaxGenerateRandom;
type Randomness = RandomnessCollectiveFlip;
type MinContribution = MinContribution;
type MaxContribution = MaxContribution;
type MinContributionper = MinContributionper;
type MaxContributionper = MaxContributionper;

}

Expand Down

0 comments on commit afe1ccb

Please sign in to comment.