Skip to content

Commit

Permalink
test runtime build
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauthamastro committed Jan 24, 2024
1 parent 98a4054 commit 8d7a959
Show file tree
Hide file tree
Showing 19 changed files with 873 additions and 599 deletions.
7 changes: 6 additions & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion pallets/liquidity-mining/src/callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ impl<T: Config> LiquidityMiningCrowdSourcePallet<T::AccountId> for Pallet<T> {
base_freed: Decimal,
quote_freed: Decimal,
) -> DispatchResult {
let mut pool_config = <Pools<T>>::get(market, market_maker).ok_or(Error::<T>::UnknownPool)?;
let mut pool_config =
<Pools<T>>::get(market, market_maker).ok_or(Error::<T>::UnknownPool)?;
pool_config.force_closed = true;
<Pools<T>>::insert(market, market_maker, pool_config);
let base_freed = base_freed
Expand Down
20 changes: 12 additions & 8 deletions pallets/liquidity-mining/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#![cfg_attr(not(feature = "std"), no_std)]


// Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
Expand All @@ -37,6 +35,7 @@ mod tests;
pub mod pallet {
use super::*;
use crate::types::MarketMakerConfig;
use core::ops::{Div, DivAssign, MulAssign};
use frame_support::{
pallet_prelude::*,
sp_runtime::{traits::AccountIdConversion, SaturatedConversion},
Expand All @@ -60,15 +59,18 @@ pub mod pallet {
Saturating,
};
use sp_std::collections::btree_map::BTreeMap;
use core::ops::{Div, DivAssign, MulAssign};

type BalanceOf<T> = <<T as Config>::NativeCurrency as Currency<
<T as frame_system::Config>::AccountId,
>>::Balance;
type SumOfScores<T: Config> = BalanceOf<T>;
type MMScore<T: Config> = BalanceOf<T>;
type SumOfScores<T> = BalanceOf<T>;
type MMScore<T> = BalanceOf<T>;
type MMClaimFlag = bool;
type MMInfo<T: Config> = (BTreeMap<T::AccountId, (MMScore<T>, MMClaimFlag)>, SumOfScores<T>, MMClaimFlag);
type MMInfo<T> = (
BTreeMap<<T as frame_system::Config>::AccountId, (MMScore<T>, MMClaimFlag)>,
SumOfScores<T>,
MMClaimFlag,
);

#[pallet::config]
pub trait Config: frame_system::Config + SendTransactionTypes<Call<Self>> {
Expand Down Expand Up @@ -384,7 +386,9 @@ pub mod pallet {
market.quote.asset_id().ok_or(Error::<T>::ConversionError)?,
&market_maker,
&pool,
T::OtherAssets::minimum_balance(market.quote.asset_id().ok_or(Error::<T>::ConversionError)?),
T::OtherAssets::minimum_balance(
market.quote.asset_id().ok_or(Error::<T>::ConversionError)?,
),
Preservation::Preserve,
)?;
// Register on OCEX pallet
Expand All @@ -396,7 +400,7 @@ pub mod pallet {
exit_fee,
public_funds_allowed,
name,
share_id: share_id,
share_id,
force_closed: false,
};
<Pools<T>>::insert(market, market_maker, config);
Expand Down
Loading

0 comments on commit 8d7a959

Please sign in to comment.