Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Chralt98 committed Sep 29, 2023
1 parent 03af54b commit 3647980
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions zrml/orderbook-v1/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,44 @@ use crate::*;
use frame_support::traits::Currency;
use sp_runtime::traits::AccountIdConversion;
use zeitgeist_primitives::traits::MarketCommonsPalletApi;
use zeitgeist_primitives::types::{
Asset, Market, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus,
MarketType, ScoringRule, Deadlines,
};

type CurrencyOf<T> = <<T as Config>::MarketCommons as MarketCommonsPalletApi>::Currency;
type BalanceOf<T> = <CurrencyOf<T> as Currency<<T as frame_system::Config>::AccountId>>::Balance;
type MarketOf<T> = zeitgeist_primitives::types::Market<
type MarketOf<T> = Market<
<T as frame_system::Config>::AccountId,
BalanceOf<T>,
<T as frame_system::Config>::BlockNumber,
MomentOf<T>,
zeitgeist_primitives::types::Asset<MarketIdOf<T>>,
Asset<MarketIdOf<T>>,
>;

pub(crate) fn market_mock<T>() -> MarketOf<T>
where
T: crate::Config,
{
zeitgeist_primitives::types::Market {
base_asset: zeitgeist_primitives::types::Asset::Ztg,
creation: zeitgeist_primitives::types::MarketCreation::Permissionless,
Market {
base_asset: Asset::Ztg,
creation: MarketCreation::Permissionless,
creator_fee: sp_runtime::Perbill::zero(),
creator: T::PalletId::get().into_account_truncating(),
market_type: zeitgeist_primitives::types::MarketType::Categorical(64u16),
dispute_mechanism: zeitgeist_primitives::types::MarketDisputeMechanism::Authorized,
market_type: MarketType::Categorical(64u16),
dispute_mechanism: Some(MarketDisputeMechanism::Authorized),
metadata: Default::default(),
oracle: T::PalletId::get().into_account_truncating(),
period: zeitgeist_primitives::types::MarketPeriod::Block(Default::default()),
deadlines: zeitgeist_primitives::types::Deadlines {
period: MarketPeriod::Block(Default::default()),
deadlines: Deadlines {
grace_period: 1_u32.into(),
oracle_duration: 1_u32.into(),
dispute_duration: 1_u32.into(),
},
report: None,
resolved_outcome: None,
scoring_rule: ScoringRule::Orderbook,
status: zeitgeist_primitives::types::MarketStatus::Active,
status: MarketStatus::Active,
bonds: Default::default(),
}
}

0 comments on commit 3647980

Please sign in to comment.