Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit b8169b7

Browse files
gilescopejsidorenkoruseinovbkchrsam0x17
authored
Asset Conversion pallet (#12984)
* Add pallet dex * Fmt * Add RPC endpoint * Fix RPC * Fix the build * Some more fixes * Add a method to topup pallet's account * Add support for multi-currency into Uniques * Fix the build * Add [transactional] + setup() + fix balances * Improve tests * Fix price quotation * Code clean up * Validate swaps * Fmt * Update README * add test * mint LP assets in a different instance * remove transactional as now the default AssetsLocal renamed to Assets * merge master * Revert "Merge master" * fix tests post merge. * attempt to set create origin * Internally allocate lp asset id. * Simplify * Bump to be in line * additional bumps to make compile * fix compile * less bounds * use fungible crates * multiasset enum * only allow native currency pairs * added slippage tests * transfer into separate method (Also fee not set in 2 places now.) Added test where lp and user are different users. * Add benchmarks + weights * Typos * Clean up * More tests, split error into two because it wasn't clear which parameter. renamed liquidity to lp_tokens_minted or lp_tokens_burned in events. * tighten up naming * Default, zero, square root traits not needed Also let's not force people to be compact * add keep-alive param * add insufficient liquidity test * Fix quote() to support u64 * Avoid recording balances twice * cargo fmt * Didn't mean to change error type * temp * Less * Rework get_amount_in/get_amount_out * Convert other places * Rework the last piece * Typo * Fix benchmarks * use hash trait * Extract a native asset check into the runtime setting * Don't set the metadata * Remove spec file * Enable multi-assets swaps by default * Refactor conversion into u128 * Add path param to swap_token_for_exact_tokens * Fix typo + a bit of refactoring * Implement path param for swap_exact_tokens_for_tokens() * Deref * Minor fixes * Add test with sensible scale values * Use .windows() * Fix benchmarks * update docs * Fix everything :) * Chore * Revert * Chore * prev way of creating sub accounts lead to collisions * Update frame/dex/src/lib.rs Co-authored-by: Jegor Sidorenko <[email protected]> * Update frame/dex/src/lib.rs Co-authored-by: Jegor Sidorenko <[email protected]> * Chore * Fmt fix on Uniques * add call_index bring code up to date with latest master * revert readme changes * add cr * revert uniques changes * reducing noise * no need for deadline (#12990) (there's generic transaction deadline functionality already) * fix kitchen sink (#12991) * fix kitchen sink * Only the dex can mint lp_tokens * add BenchmarkHelper for second instance (#12998) * update mock to latest master * less indirections (#13012) * remove dex PR's custom RPC (#13050) * As we have state_call we don't need a custom RPC * fix docs * no longer a need to upgrade rpc version (#13053) * add CallbackHadle * quote bugfix (#13191) quote was giving same price in both directions as we were inverting needlessly. * merging in dex specific changes due to pay by dex * update lock file * merging in kitchen sink changes * Add get_reserves() api method * Partial updating of the benchmarks * Fix tests * clippy * Temp fix weights * Fix benchmarks * Add pool setup fee * Money upfront * Address some comments * Use u128 in mock * Fix benchmarks * Change error message * Update comments * Change error names * Implement PartialOrd for NativeOrAssetId * add note * Update errors * More tests for assets sorting * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_dex * Change the way we generate pool accounts * Improve the liquidity removal method * Extract MintMinLiquidity to config, rework all tests * Add comments * Validate provided amount * Rename to asset-conversion * Validate ED * Improve handling the ED related errors * typos * Try to fix benchmarks * Another try * Another day, another try * Fix benchmarks * Expose fee related params * Validate token's minimal amount the same way as ED * fix typo * Use longer path for swaps in benchmarks * need to ref sp_std's vec. * Remove From<u32> requirement when benchmarking * impl BenchmarkHelper for () * only for runtime benchmarks * MultiLocation: !MaybeDisplay Looks like we might not need this bound from initial testing. * Update frame/asset-conversion/src/lib.rs Co-authored-by: Jegor Sidorenko <[email protected]> * Update frame/asset-conversion/src/lib.rs Co-authored-by: Jegor Sidorenko <[email protected]> * Add documentation links * add collision test * Revert "[Enhancement] Throw an error when there are too many pallets (#13763)" This reverts commit 9b8e6e7. * [Enhancement] Throw an error when there are too many pallets (#13763) * [Enhancement] Throw an error when there are too many pallets * fix ui test * fix PR comments * Update frame/support/procedural/src/construct_runtime/mod.rs Co-authored-by: Bastian Köcher <[email protected]> * Update frame/support/procedural/src/construct_runtime/mod.rs Co-authored-by: Bastian Köcher <[email protected]> * ".git/.scripts/commands/fmt/fmt.sh" --------- Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: command-bot <> * add benchmark helper + doc fix * cargo fmt * Fix adding liquidity to non-empty pool * Fix compilation error * Fix params ordering issue * additional docs * The swap path elements should be unique * Fix account collision * Validate all the pool in a swap path are unique * Change the way we add liquidity to empty pools * Improve docs * remove unnessisary Display impl * cargo fmt * remove unused imports * Make api consistent * Chore * Touch the pool account so it could hold the pair tokens * Check the balance before touching the pool's account * Introduce liquidity provision fee * Touch the pool acc one more time * Apply suggestions from code review Co-authored-by: Sam Johnson <[email protected]> * Update frame/asset-conversion/README.md Co-authored-by: Sam Johnson <[email protected]> * Use ContainsPair instead of the balance checker * Remove old Currency trait * Add liquidity withdrawal fee * Update docs * Use 0 withdrawal fee in mock * Rename vars * asset id not clone * fix: shadow var was being used * correct tests * fix benches * merge master * neater --------- Co-authored-by: Jegor Sidorenko <[email protected]> Co-authored-by: Jegor Sidorenko <[email protected]> Co-authored-by: parity-processbot <> Co-authored-by: Roman Useinov <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Sam Johnson <[email protected]>
1 parent 5a4f49b commit b8169b7

File tree

20 files changed

+3727
-10
lines changed

20 files changed

+3727
-10
lines changed

Cargo.lock

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ members = [
7474
"client/transaction-pool/api",
7575
"client/utils",
7676
"frame/alliance",
77+
"frame/asset-conversion",
7778
"frame/assets",
7879
"frame/atomic-swap",
7980
"frame/aura",

bin/node/cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ sc-storage-monitor = { version = "0.1.0", path = "../../../client/storage-monito
8888
frame-system = { version = "4.0.0-dev", path = "../../../frame/system" }
8989
frame-system-rpc-runtime-api = { version = "4.0.0-dev", path = "../../../frame/system/rpc/runtime-api" }
9090
pallet-transaction-payment = { version = "4.0.0-dev", path = "../../../frame/transaction-payment" }
91+
pallet-asset-conversion = { version = "4.0.0-dev", path = "../../../frame/asset-conversion" }
9192
pallet-assets = { version = "4.0.0-dev", path = "../../../frame/assets/" }
9293
pallet-asset-tx-payment = { version = "4.0.0-dev", path = "../../../frame/transaction-payment/asset-tx-payment/" }
9394
pallet-im-online = { version = "4.0.0-dev", default-features = false, path = "../../../frame/im-online" }

bin/node/cli/src/chain_spec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ pub fn testnet_genesis(
363363
assets: vec![(9, get_account_id_from_seed::<sr25519::Public>("Alice"), true, 1)],
364364
..Default::default()
365365
},
366+
pool_assets: Default::default(),
366367
transaction_storage: Default::default(),
367368
transaction_payment: Default::default(),
368369
alliance: Default::default(),

bin/node/runtime/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ scale-info = { version = "2.5.0", default-features = false, features = ["derive"
2424
static_assertions = "1.1.0"
2525
log = { version = "0.4.17", default-features = false }
2626

27+
# pallet-asset-conversion: turn on "num-traits" feature
28+
primitive-types = { version = "0.12.0", default-features = false, features = ["codec", "scale-info", "num-traits"] }
29+
2730
# primitives
2831
sp-authority-discovery = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/authority-discovery" }
2932
sp-consensus-babe = { version = "0.10.0-dev", default-features = false, path = "../../../primitives/consensus/babe" }
@@ -54,6 +57,7 @@ frame-election-provider-support = { version = "4.0.0-dev", default-features = fa
5457
frame-system-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, path = "../../../frame/system/rpc/runtime-api/" }
5558
frame-try-runtime = { version = "0.10.0-dev", default-features = false, path = "../../../frame/try-runtime", optional = true }
5659
pallet-alliance = { version = "4.0.0-dev", default-features = false, path = "../../../frame/alliance" }
60+
pallet-asset-conversion = { version = "4.0.0-dev", default-features = false, path = "../../../frame/asset-conversion" }
5761
pallet-asset-rate = { version = "4.0.0-dev", default-features = false, path = "../../../frame/asset-rate" }
5862
pallet-assets = { version = "4.0.0-dev", default-features = false, path = "../../../frame/assets" }
5963
pallet-authority-discovery = { version = "4.0.0-dev", default-features = false, path = "../../../frame/authority-discovery" }
@@ -137,6 +141,7 @@ std = [
137141
"frame-system-benchmarking?/std",
138142
"frame-election-provider-support/std",
139143
"sp-authority-discovery/std",
144+
"pallet-asset-conversion/std",
140145
"pallet-assets/std",
141146
"pallet-authority-discovery/std",
142147
"pallet-authorship/std",
@@ -236,6 +241,7 @@ runtime-benchmarks = [
236241
"frame-system/runtime-benchmarks",
237242
"sp-runtime/runtime-benchmarks",
238243
"pallet-alliance/runtime-benchmarks",
244+
"pallet-asset-conversion/runtime-benchmarks",
239245
"pallet-assets/runtime-benchmarks",
240246
"pallet-babe/runtime-benchmarks",
241247
"pallet-bags-list/runtime-benchmarks",
@@ -297,6 +303,7 @@ try-runtime = [
297303
"frame-system/try-runtime",
298304
"frame-support/try-runtime",
299305
"pallet-alliance/try-runtime",
306+
"pallet-asset-conversion/try-runtime",
300307
"pallet-assets/try-runtime",
301308
"pallet-authority-discovery/try-runtime",
302309
"pallet-authorship/try-runtime",

bin/node/runtime/src/lib.rs

Lines changed: 93 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ use frame_election_provider_support::{
2929
use frame_support::{
3030
construct_runtime,
3131
dispatch::DispatchClass,
32+
instances::{Instance1, Instance2},
33+
ord_parameter_types,
3234
pallet_prelude::Get,
3335
parameter_types,
3436
traits::{
@@ -48,10 +50,11 @@ use frame_support::{
4850
};
4951
use frame_system::{
5052
limits::{BlockLength, BlockWeights},
51-
EnsureRoot, EnsureRootWithSuccess, EnsureSigned, EnsureWithSuccess,
53+
EnsureRoot, EnsureRootWithSuccess, EnsureSigned, EnsureSignedBy, EnsureWithSuccess,
5254
};
5355
pub use node_primitives::{AccountId, Signature};
5456
use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Index, Moment};
57+
use pallet_asset_conversion::{NativeOrAssetId, NativeOrAssetIdConverter};
5558
use pallet_election_provider_multi_phase::SolutionAccuracyOf;
5659
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
5760
use pallet_nfts::PalletFeatures;
@@ -69,8 +72,8 @@ use sp_runtime::{
6972
curve::PiecewiseLinear,
7073
generic, impl_opaque_keys,
7174
traits::{
72-
self, BlakeTwo256, Block as BlockT, Bounded, ConvertInto, NumberFor, OpaqueKeys,
73-
SaturatedConversion, StaticLookup,
75+
self, AccountIdConversion, BlakeTwo256, Block as BlockT, Bounded, ConvertInto, NumberFor,
76+
OpaqueKeys, SaturatedConversion, StaticLookup,
7477
},
7578
transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity},
7679
ApplyExtrinsicResult, FixedPointNumber, FixedU128, Perbill, Percent, Permill, Perquintill,
@@ -482,7 +485,7 @@ impl pallet_asset_tx_payment::Config for Runtime {
482485
type RuntimeEvent = RuntimeEvent;
483486
type Fungibles = Assets;
484487
type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter<
485-
pallet_assets::BalanceToAssetBalance<Balances, Runtime, ConvertInto>,
488+
pallet_assets::BalanceToAssetBalance<Balances, Runtime, ConvertInto, Instance1>,
486489
CreditToBlockAuthor,
487490
>;
488491
}
@@ -1473,7 +1476,7 @@ parameter_types! {
14731476
pub const MetadataDepositPerByte: Balance = 1 * DOLLARS;
14741477
}
14751478

1476-
impl pallet_assets::Config for Runtime {
1479+
impl pallet_assets::Config<Instance1> for Runtime {
14771480
type RuntimeEvent = RuntimeEvent;
14781481
type Balance = u128;
14791482
type AssetId = u32;
@@ -1496,6 +1499,66 @@ impl pallet_assets::Config for Runtime {
14961499
type BenchmarkHelper = ();
14971500
}
14981501

1502+
ord_parameter_types! {
1503+
pub const AssetConversionOrigin: AccountId = AccountIdConversion::<AccountId>::into_account_truncating(&AssetConversionPalletId::get());
1504+
}
1505+
1506+
impl pallet_assets::Config<Instance2> for Runtime {
1507+
type RuntimeEvent = RuntimeEvent;
1508+
type Balance = u128;
1509+
type AssetId = u32;
1510+
type AssetIdParameter = codec::Compact<u32>;
1511+
type Currency = Balances;
1512+
type CreateOrigin = AsEnsureOriginWithArg<EnsureSignedBy<AssetConversionOrigin, AccountId>>;
1513+
type ForceOrigin = EnsureRoot<AccountId>;
1514+
type AssetDeposit = AssetDeposit;
1515+
type AssetAccountDeposit = ConstU128<DOLLARS>;
1516+
type MetadataDepositBase = MetadataDepositBase;
1517+
type MetadataDepositPerByte = MetadataDepositPerByte;
1518+
type ApprovalDeposit = ApprovalDeposit;
1519+
type StringLimit = StringLimit;
1520+
type Freezer = ();
1521+
type Extra = ();
1522+
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
1523+
type RemoveItemsLimit = ConstU32<1000>;
1524+
type CallbackHandle = ();
1525+
#[cfg(feature = "runtime-benchmarks")]
1526+
type BenchmarkHelper = ();
1527+
}
1528+
1529+
parameter_types! {
1530+
pub const AssetConversionPalletId: PalletId = PalletId(*b"py/ascon");
1531+
pub AllowMultiAssetPools: bool = true;
1532+
pub const PoolSetupFee: Balance = 1 * DOLLARS; // should be more or equal to the existential deposit
1533+
pub const MintMinLiquidity: Balance = 100; // 100 is good enough when the main currency has 10-12 decimals.
1534+
pub const LiquidityWithdrawalFee: Permill = Permill::from_percent(0); // should be non-zero if AllowMultiAssetPools is true, otherwise can be zero.
1535+
}
1536+
1537+
impl pallet_asset_conversion::Config for Runtime {
1538+
type RuntimeEvent = RuntimeEvent;
1539+
type Currency = Balances;
1540+
type AssetBalance = <Self as pallet_balances::Config>::Balance;
1541+
type HigherPrecisionBalance = sp_core::U256;
1542+
type Assets = Assets;
1543+
type Balance = u128;
1544+
type PoolAssets = PoolAssets;
1545+
type AssetId = <Self as pallet_assets::Config<Instance1>>::AssetId;
1546+
type MultiAssetId = NativeOrAssetId<u32>;
1547+
type PoolAssetId = <Self as pallet_assets::Config<Instance2>>::AssetId;
1548+
type PalletId = AssetConversionPalletId;
1549+
type LPFee = ConstU32<3>; // means 0.3%
1550+
type PoolSetupFee = PoolSetupFee;
1551+
type PoolSetupFeeReceiver = AssetConversionOrigin;
1552+
type LiquidityWithdrawalFee = LiquidityWithdrawalFee;
1553+
type WeightInfo = pallet_asset_conversion::weights::SubstrateWeight<Runtime>;
1554+
type AllowMultiAssetPools = AllowMultiAssetPools;
1555+
type MaxSwapPathLength = ConstU32<4>;
1556+
type MintMinLiquidity = MintMinLiquidity;
1557+
type MultiAssetIdConverter = NativeOrAssetIdConverter<u32>;
1558+
#[cfg(feature = "runtime-benchmarks")]
1559+
type BenchmarkHelper = ();
1560+
}
1561+
14991562
parameter_types! {
15001563
pub const QueueCount: u32 = 300;
15011564
pub const MaxQueueLen: u32 = 1000;
@@ -1617,7 +1680,7 @@ impl pallet_nft_fractionalization::Config for Runtime {
16171680
type NftCollectionId = <Self as pallet_nfts::Config>::CollectionId;
16181681
type NftId = <Self as pallet_nfts::Config>::ItemId;
16191682
type AssetBalance = <Self as pallet_balances::Config>::Balance;
1620-
type AssetId = <Self as pallet_assets::Config>::AssetId;
1683+
type AssetId = <Self as pallet_assets::Config<Instance1>>::AssetId;
16211684
type Assets = Assets;
16221685
type Nfts = Nfts;
16231686
type PalletId = NftFractionalizationPalletId;
@@ -1838,7 +1901,8 @@ construct_runtime!(
18381901
Multisig: pallet_multisig,
18391902
Bounties: pallet_bounties,
18401903
Tips: pallet_tips,
1841-
Assets: pallet_assets,
1904+
Assets: pallet_assets::<Instance1>,
1905+
PoolAssets: pallet_assets::<Instance2>,
18421906
Mmr: pallet_mmr,
18431907
Lottery: pallet_lottery,
18441908
Nis: pallet_nis,
@@ -1861,6 +1925,7 @@ construct_runtime!(
18611925
NominationPools: pallet_nomination_pools,
18621926
RankedPolls: pallet_referenda::<Instance2>,
18631927
RankedCollective: pallet_ranked_collective,
1928+
AssetConversion: pallet_asset_conversion,
18641929
FastUnstake: pallet_fast_unstake,
18651930
MessageQueue: pallet_message_queue,
18661931
Pov: frame_benchmarking_pallet_pov,
@@ -1951,6 +2016,7 @@ mod benches {
19512016
[pallet_contracts, Contracts]
19522017
[pallet_core_fellowship, CoreFellowship]
19532018
[pallet_democracy, Democracy]
2019+
[pallet_asset_conversion, AssetConversion]
19542020
[pallet_election_provider_multi_phase, ElectionProviderMultiPhase]
19552021
[pallet_election_provider_support_benchmarking, EPSBench::<Runtime>]
19562022
[pallet_elections_phragmen, Elections]
@@ -2288,6 +2354,26 @@ impl_runtime_apis! {
22882354
}
22892355
}
22902356

2357+
impl pallet_asset_conversion::AssetConversionApi<
2358+
Block,
2359+
Balance,
2360+
u128,
2361+
NativeOrAssetId<u32>
2362+
> for Runtime
2363+
{
2364+
fn quote_price_exact_tokens_for_tokens(asset1: NativeOrAssetId<u32>, asset2: NativeOrAssetId<u32>, amount: u128, include_fee: bool) -> Option<Balance> {
2365+
AssetConversion::quote_price_exact_tokens_for_tokens(asset1, asset2, amount, include_fee)
2366+
}
2367+
2368+
fn quote_price_tokens_for_exact_tokens(asset1: NativeOrAssetId<u32>, asset2: NativeOrAssetId<u32>, amount: u128, include_fee: bool) -> Option<Balance> {
2369+
AssetConversion::quote_price_tokens_for_exact_tokens(asset1, asset2, amount, include_fee)
2370+
}
2371+
2372+
fn get_reserves(asset1: NativeOrAssetId<u32>, asset2: NativeOrAssetId<u32>) -> Option<(Balance, Balance)> {
2373+
AssetConversion::get_reserves(&asset1, &asset2).ok()
2374+
}
2375+
}
2376+
22912377
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
22922378
for Runtime
22932379
{

bin/node/testing/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ frame-system = { version = "4.0.0-dev", path = "../../../frame/system" }
2222
node-executor = { version = "3.0.0-dev", path = "../executor" }
2323
node-primitives = { version = "2.0.0", path = "../primitives" }
2424
kitchensink-runtime = { version = "3.0.0-dev", path = "../runtime" }
25+
pallet-asset-conversion = { version = "4.0.0-dev", path = "../../../frame/asset-conversion" }
2526
pallet-assets = { version = "4.0.0-dev", path = "../../../frame/assets" }
2627
pallet-asset-tx-payment = { version = "4.0.0-dev", path = "../../../frame/transaction-payment/asset-tx-payment" }
2728
pallet-transaction-payment = { version = "4.0.0-dev", path = "../../../frame/transaction-payment" }

bin/node/testing/src/genesis.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ pub fn config_endowed(code: Option<&[u8]>, extra_endowed: Vec<AccountId>) -> Gen
8989
society: SocietyConfig { members: vec![alice(), bob()], pot: 0, max_members: 999 },
9090
vesting: Default::default(),
9191
assets: AssetsConfig { assets: vec![(9, alice(), true, 1)], ..Default::default() },
92+
pool_assets: Default::default(),
9293
transaction_storage: Default::default(),
9394
transaction_payment: Default::default(),
9495
alliance: Default::default(),

frame/asset-conversion/Cargo.toml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[package]
2+
name = "pallet-asset-conversion"
3+
version = "4.0.0-dev"
4+
authors = ["Parity Technologies <[email protected]>"]
5+
edition = "2021"
6+
license = "Apache-2.0"
7+
homepage = "https://substrate.io"
8+
repository = "https://github.com/paritytech/substrate/"
9+
description = "FRAME asset conversion pallet"
10+
readme = "README.md"
11+
12+
[package.metadata.docs.rs]
13+
targets = ["x86_64-unknown-linux-gnu"]
14+
15+
[dependencies]
16+
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
17+
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
18+
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
19+
frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true }
20+
scale-info = { version = "2.0.0", default-features = false, features = ["derive"] }
21+
sp-api = { version = "4.0.0-dev", default-features = false, path = "../../primitives/api" }
22+
sp-io = { version = "7.0.0", default-features = false, path = "../../primitives/io" }
23+
sp-std = { version = "5.0.0", default-features = false, path = "../../primitives/std" }
24+
sp-runtime = { version = "7.0.0", default-features = false, path = "../../primitives/runtime" }
25+
sp-arithmetic = { version = "6.0.0", default-features = false, path = "../../primitives/arithmetic" }
26+
27+
[dev-dependencies]
28+
pallet-balances = { version = "4.0.0-dev", path = "../balances" }
29+
pallet-assets = { version = "4.0.0-dev", path = "../assets" }
30+
primitive-types = { version = "0.12.0", default-features = false, features = ["codec", "scale-info", "num-traits"] }
31+
sp-std = { version = "5.0.0", path = "../../primitives/std" }
32+
sp-core = { version = "7.0.0", path = "../../primitives/core" }
33+
sp-io = { version = "7.0.0", path = "../../primitives/io" }
34+
35+
[features]
36+
default = ["std"]
37+
std = [
38+
"codec/std",
39+
"frame-benchmarking?/std",
40+
"frame-support/std",
41+
"frame-system/std",
42+
"scale-info/std",
43+
"sp-std/std",
44+
"sp-runtime/std",
45+
"sp-arithmetic/std"
46+
]
47+
runtime-benchmarks = [
48+
"frame-benchmarking/runtime-benchmarks",
49+
"frame-system/runtime-benchmarks",
50+
"sp-runtime/runtime-benchmarks",
51+
]
52+
try-runtime = ["frame-support/try-runtime"]

0 commit comments

Comments
 (0)