Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
sea212 committed Jan 16, 2024
1 parent 14aa375 commit e78d0e2
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.
2 changes: 1 addition & 1 deletion primitives/src/constants/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
pub use super::*;
use crate::{
assets::Asset,
types::{Assets, Balance, Moment, Currencies},
types::{Assets, Balance, Currencies, Moment},
};
use frame_support::{parameter_types, traits::LockIdentifier, PalletId};
use orml_traits::parameter_type_with_key;
Expand Down
2 changes: 1 addition & 1 deletion runtime/zeitgeist/src/xcm_config/asset_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ impl AssetProcessor<Currencies, AssetMetadata<Balance, CustomMetadata>> for Cust
) -> Result<(), DispatchError> {
Ok(())
}
}
}
4 changes: 2 additions & 2 deletions zrml/neo-swaps/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ use zeitgeist_primitives::{
},
traits::{DeployPoolApi, DistributeFees},
types::{
AccountIdTest, Amount, Assets, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, Hash,
Index, MarketId, Moment, PoolId, UncheckedExtrinsicTest, Currencies,
AccountIdTest, Amount, Assets, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest,
Currencies, Hash, Index, MarketId, Moment, PoolId, UncheckedExtrinsicTest,
},
};
use zrml_neo_swaps::BalanceOf;
Expand Down
23 changes: 13 additions & 10 deletions zrml/prediction-markets/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,26 @@

use crate as prediction_markets;
use frame_support::{
construct_runtime, ord_parameter_types, parameter_types,
traits::{Everything, NeverEnsureOrigin, OnFinalize, OnInitialize, AsEnsureOriginWithArg},
construct_runtime, ord_parameter_types, parameter_types,
traits::{AsEnsureOriginWithArg, Everything, NeverEnsureOrigin, OnFinalize, OnInitialize},
};
use frame_system::{EnsureRoot, EnsureSignedBy, EnsureSigned};
use frame_system::{EnsureRoot, EnsureSigned, EnsureSignedBy};
#[cfg(feature = "parachain")]
use orml_asset_registry::AssetMetadata;
use sp_arithmetic::{per_things::Percent};
use parity_scale_codec::Compact;
use sp_arithmetic::per_things::Percent;
use sp_runtime::{
testing::Header,
traits::{ConstU32, BlakeTwo256, IdentityLookup},
traits::{BlakeTwo256, ConstU32, IdentityLookup},
DispatchError, DispatchResult,
};
use parity_scale_codec::Compact;
use std::cell::RefCell;
use substrate_fixed::{types::extra::U33, FixedI128, FixedU128};
use zeitgeist_primitives::{
constants::mock::{
AddOutcomePeriod, AggregationPeriod, AppealBond, AppealPeriod, AuthorizedPalletId,
AddOutcomePeriod, AggregationPeriod, AppealBond, AppealPeriod, AssetsAccountDeposit,
AssetsApprovalDeposit, AssetsDeposit, AssetsMetadataDepositBase,
AssetsMetadataDepositPerByte, AssetsStringLimit, AuthorizedPalletId,
BalanceFractionalDecimals, BlockHashCount, BlocksPerYear, CloseEarlyBlockPeriod,
CloseEarlyDisputeBond, CloseEarlyProtectionBlockPeriod,
CloseEarlyProtectionTimeFramePeriod, CloseEarlyRequestBond, CloseEarlyTimeFramePeriod,
Expand All @@ -56,12 +58,13 @@ use zeitgeist_primitives::{
MinOutcomeVoteAmount, MinSubsidy, MinSubsidyPeriod, MinWeight, MinimumPeriod, OutcomeBond,
OutcomeFactor, OutsiderBond, PmPalletId, RemoveKeysLimit, RequestInterval,
SimpleDisputesPalletId, SwapsPalletId, TreasuryPalletId, VotePeriod, VotingOutcomeFee,
BASE, CENT, MILLISECS_PER_BLOCK, AssetsApprovalDeposit, AssetsAccountDeposit, AssetsDeposit, AssetsMetadataDepositBase, AssetsMetadataDepositPerByte, AssetsStringLimit,
BASE, CENT, MILLISECS_PER_BLOCK,
},
traits::DeployPoolApi,
types::{
AccountIdTest, Amount, Assets, Currencies, Balance, BasicCurrencyAdapter, BlockNumber,
BlockTest, Hash, Index, MarketId, Moment, PoolId, UncheckedExtrinsicTest, CampaignAsset, CustomAsset, MarketAsset, CustomAssetId, CampaignAssetId
AccountIdTest, Amount, Assets, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest,
CampaignAsset, CampaignAssetId, Currencies, CustomAsset, CustomAssetId, Hash, Index,
MarketAsset, MarketId, Moment, PoolId, UncheckedExtrinsicTest,
},
};
use zrml_rikiddo::types::{EmaMarketVolume, FeeSigmoid, RikiddoSigmoidMV};
Expand Down
20 changes: 16 additions & 4 deletions zrml/prediction-markets/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4039,10 +4039,22 @@ fn create_market_and_deploy_assets_results_in_expected_balances_and_pool_params(
assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 2), &ALICE), 0);
assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 3), &ALICE), 0);

assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 0), &pool_account), amount);
assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 1), &pool_account), amount);
assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 2), &pool_account), amount);
assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 3), &pool_account), amount);
assert_eq!(
AssetManager::free_balance(Asset::CategoricalOutcome(0, 0), &pool_account),
amount
);
assert_eq!(
AssetManager::free_balance(Asset::CategoricalOutcome(0, 1), &pool_account),
amount
);
assert_eq!(
AssetManager::free_balance(Asset::CategoricalOutcome(0, 2), &pool_account),
amount
);
assert_eq!(
AssetManager::free_balance(Asset::CategoricalOutcome(0, 3), &pool_account),
amount
);
assert_eq!(AssetManager::free_balance(base_asset, &pool_account), amount);

let pool = Pools::<Runtime>::get(0).unwrap();
Expand Down

0 comments on commit e78d0e2

Please sign in to comment.