Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulhakim2902 committed Oct 3, 2022
1 parent d20e6a9 commit c1bebae
Show file tree
Hide file tree
Showing 27 changed files with 2,412 additions and 1,401 deletions.
49 changes: 49 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pallets/labs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1068,4 +1068,11 @@ impl<T: Config> LabsProvider<T> for Pallet<T> {
fn lab_verification_status(account_id: &AccountIdOf<T>) -> Option<VerificationStatus> {
Self::lab_verification_status(account_id)
}

fn is_lab_exists(account_id: &T::AccountId) -> bool {
match Self::lab_by_account_id(account_id) {
None => false,
Some(_) => true,
}
}
}
1 change: 1 addition & 0 deletions pallets/labs/traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ use primitives_verification_status::VerificationStatus;

pub trait LabsProvider<T: Config> {
fn lab_verification_status(account_id: &T::AccountId) -> Option<VerificationStatus>;
fn is_lab_exists(account: &T::AccountId) -> bool;
}
12 changes: 12 additions & 0 deletions pallets/orders/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use frame_support::{
use primitives_price_and_currency::CurrencyType;
use scale_info::prelude::string::String;
use sp_std::vec;
use traits_order::OrderProvider;

pub const PALLET_ID: PalletId = PalletId(*b"orders!!");

Expand Down Expand Up @@ -243,3 +244,14 @@ impl<T: Config> OrderStatusUpdater<T> for Pallet<T> {
}
}
}

impl<T: Config> OrderProvider<T> for Pallet<T>
where
OrderOf<T>: traits_order::OrderInfo<T>,
{
type Orders = OrderOf<T>;

fn get_order_by_id(order_id: &T::Hash) -> Option<Self::Orders> {
Self::order_by_id(order_id)
}
}
Loading

0 comments on commit c1bebae

Please sign in to comment.