Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
maltekliemann committed Oct 4, 2023
1 parent 3f7bb11 commit 65d2168
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
16 changes: 12 additions & 4 deletions zrml/prediction-markets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2288,7 +2288,7 @@ mod pallet {
};
Ok(())
}

#[require_transactional]
pub(crate) fn do_sell_complete_set(
who: T::AccountId,
Expand All @@ -2299,7 +2299,10 @@ mod pallet {

let market = <zrml_market_commons::Pallet<T>>::market(&market_id)?;
ensure!(
matches!(market.scoring_rule, ScoringRule::CPMM | ScoringRule::Lmsr | ScoringRule::Orderbook),
matches!(
market.scoring_rule,
ScoringRule::CPMM | ScoringRule::Lmsr | ScoringRule::Orderbook
),
Error::<T>::InvalidScoringRule
);
Self::ensure_market_is_active(&market)?;
Expand Down Expand Up @@ -2347,7 +2350,10 @@ mod pallet {
Error::<T>::NotEnoughBalance
);
ensure!(
matches!(market.scoring_rule, ScoringRule::CPMM | ScoringRule::Lmsr | ScoringRule::Orderbook),
matches!(
market.scoring_rule,
ScoringRule::CPMM | ScoringRule::Lmsr | ScoringRule::Orderbook
),
Error::<T>::InvalidScoringRule
);
Self::ensure_market_is_active(&market)?;
Expand Down Expand Up @@ -3169,7 +3175,9 @@ mod pallet {
}
let status: MarketStatus = match creation {
MarketCreation::Permissionless => match scoring_rule {
ScoringRule::CPMM | ScoringRule::Lmsr | ScoringRule::Orderbook => MarketStatus::Active,
ScoringRule::CPMM | ScoringRule::Lmsr | ScoringRule::Orderbook => {
MarketStatus::Active
}
ScoringRule::RikiddoSigmoidFeeMarketEma => MarketStatus::CollectingSubsidy,
},
MarketCreation::Advised => MarketStatus::Proposed,
Expand Down
8 changes: 6 additions & 2 deletions zrml/swaps/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2551,7 +2551,9 @@ mod pallet {
ScoringRule::RikiddoSigmoidFeeMarketEma => Ok(
T::WeightInfo::swap_exact_amount_in_rikiddo(pool.assets.len().saturated_into()),
),
ScoringRule::Lmsr | ScoringRule::Orderbook => Err(Error::<T>::InvalidScoringRule.into()),
ScoringRule::Lmsr | ScoringRule::Orderbook => {
Err(Error::<T>::InvalidScoringRule.into())
}
}
}

Expand Down Expand Up @@ -2723,7 +2725,9 @@ mod pallet {
pool.assets.len().saturated_into(),
))
}
ScoringRule::Lmsr | ScoringRule::Orderbook => Err(Error::<T>::InvalidScoringRule.into()),
ScoringRule::Lmsr | ScoringRule::Orderbook => {
Err(Error::<T>::InvalidScoringRule.into())
}
}
}
}
Expand Down

0 comments on commit 65d2168

Please sign in to comment.