mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 03:31:05 +00:00
Companion for Substrate 12740 (#1898)
* add helper config trait
* benchmarkhelper
* update config
* update tests
* into
* update lockfile for {"substrate", "polkadot"}
* include benchmarks in tomls
Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+256
-253
File diff suppressed because it is too large
Load Diff
@@ -246,6 +246,7 @@ impl pallet_assets::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Balance = Balance;
|
||||
type AssetId = AssetId;
|
||||
type AssetIdParameter = codec::Compact<AssetId>;
|
||||
type Currency = Balances;
|
||||
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
|
||||
type ForceOrigin = AssetsForceOrigin;
|
||||
@@ -259,6 +260,8 @@ impl pallet_assets::Config for Runtime {
|
||||
type WeightInfo = weights::pallet_assets::WeightInfo<Runtime>;
|
||||
type AssetAccountDeposit = AssetAccountDeposit;
|
||||
type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type BenchmarkHelper = ();
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
|
||||
@@ -32,7 +32,7 @@ fn test_asset_xcm_trader() {
|
||||
let local_asset_id = 1;
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
local_asset_id,
|
||||
local_asset_id.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
minimum_asset_balance
|
||||
@@ -41,7 +41,7 @@ fn test_asset_xcm_trader() {
|
||||
// We first mint enough asset for the account to exist for assets
|
||||
assert_ok!(Assets::mint(
|
||||
RuntimeHelper::<Runtime>::origin_of(AccountId::from(ALICE)),
|
||||
local_asset_id,
|
||||
local_asset_id.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
minimum_asset_balance
|
||||
));
|
||||
@@ -118,7 +118,7 @@ fn test_asset_xcm_trader_with_refund() {
|
||||
// We set existential deposit to be identical to the one for Balances first
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
ExistentialDeposit::get()
|
||||
@@ -127,7 +127,7 @@ fn test_asset_xcm_trader_with_refund() {
|
||||
// We first mint enough asset for the account to exist for assets
|
||||
assert_ok!(Assets::mint(
|
||||
RuntimeHelper::<Runtime>::origin_of(AccountId::from(ALICE)),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
ExistentialDeposit::get()
|
||||
));
|
||||
@@ -205,7 +205,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() {
|
||||
// We set existential deposit to be identical to the one for Balances first
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
ExistentialDeposit::get()
|
||||
@@ -265,7 +265,7 @@ fn test_that_buying_ed_refund_does_not_refund() {
|
||||
// We set existential deposit to be identical to the one for Balances first
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
ExistentialDeposit::get()
|
||||
@@ -338,7 +338,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() {
|
||||
let minimum_asset_balance = 1_000_000_u128;
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
false,
|
||||
minimum_asset_balance
|
||||
@@ -347,7 +347,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() {
|
||||
// We first mint enough asset for the account to exist for assets
|
||||
assert_ok!(Assets::mint(
|
||||
RuntimeHelper::<Runtime>::origin_of(AccountId::from(ALICE)),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
minimum_asset_balance
|
||||
));
|
||||
|
||||
@@ -262,6 +262,7 @@ impl pallet_assets::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Balance = Balance;
|
||||
type AssetId = AssetId;
|
||||
type AssetIdParameter = codec::Compact<AssetId>;
|
||||
type Currency = Balances;
|
||||
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
|
||||
type ForceOrigin = AssetsForceOrigin;
|
||||
@@ -275,6 +276,8 @@ impl pallet_assets::Config for Runtime {
|
||||
type WeightInfo = weights::pallet_assets::WeightInfo<Runtime>;
|
||||
type AssetAccountDeposit = AssetAccountDeposit;
|
||||
type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type BenchmarkHelper = ();
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
|
||||
@@ -32,7 +32,7 @@ fn test_asset_xcm_trader() {
|
||||
let local_asset_id = 1;
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
local_asset_id,
|
||||
local_asset_id.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
minimum_asset_balance
|
||||
@@ -41,7 +41,7 @@ fn test_asset_xcm_trader() {
|
||||
// We first mint enough asset for the account to exist for assets
|
||||
assert_ok!(Assets::mint(
|
||||
RuntimeHelper::<Runtime>::origin_of(AccountId::from(ALICE)),
|
||||
local_asset_id,
|
||||
local_asset_id.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
minimum_asset_balance
|
||||
));
|
||||
@@ -121,7 +121,7 @@ fn test_asset_xcm_trader_with_refund() {
|
||||
// We set existential deposit to be identical to the one for Balances first
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
ExistentialDeposit::get()
|
||||
@@ -130,7 +130,7 @@ fn test_asset_xcm_trader_with_refund() {
|
||||
// We first mint enough asset for the account to exist for assets
|
||||
assert_ok!(Assets::mint(
|
||||
RuntimeHelper::<Runtime>::origin_of(AccountId::from(ALICE)),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
ExistentialDeposit::get()
|
||||
));
|
||||
@@ -211,7 +211,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() {
|
||||
// We set existential deposit to be identical to the one for Balances first
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
ExistentialDeposit::get()
|
||||
@@ -274,7 +274,7 @@ fn test_that_buying_ed_refund_does_not_refund() {
|
||||
// We set existential deposit to be identical to the one for Balances first
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
ExistentialDeposit::get()
|
||||
@@ -347,7 +347,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() {
|
||||
let minimum_asset_balance = 1_000_000_u128;
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
false,
|
||||
minimum_asset_balance
|
||||
@@ -356,7 +356,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() {
|
||||
// We first mint enough asset for the account to exist for assets
|
||||
assert_ok!(Assets::mint(
|
||||
RuntimeHelper::<Runtime>::origin_of(AccountId::from(ALICE)),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
minimum_asset_balance
|
||||
));
|
||||
|
||||
@@ -227,6 +227,7 @@ impl pallet_assets::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Balance = Balance;
|
||||
type AssetId = AssetId;
|
||||
type AssetIdParameter = codec::Compact<AssetId>;
|
||||
type Currency = Balances;
|
||||
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
|
||||
type ForceOrigin = AssetsForceOrigin;
|
||||
@@ -240,6 +241,8 @@ impl pallet_assets::Config for Runtime {
|
||||
type WeightInfo = weights::pallet_assets::WeightInfo<Runtime>;
|
||||
type AssetAccountDeposit = AssetAccountDeposit;
|
||||
type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type BenchmarkHelper = ();
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
|
||||
@@ -32,7 +32,7 @@ fn test_asset_xcm_trader() {
|
||||
let local_asset_id = 1;
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
local_asset_id,
|
||||
local_asset_id.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
minimum_asset_balance
|
||||
@@ -41,7 +41,7 @@ fn test_asset_xcm_trader() {
|
||||
// We first mint enough asset for the account to exist for assets
|
||||
assert_ok!(Assets::mint(
|
||||
RuntimeHelper::<Runtime>::origin_of(AccountId::from(ALICE)),
|
||||
local_asset_id,
|
||||
local_asset_id.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
minimum_asset_balance
|
||||
));
|
||||
@@ -118,7 +118,7 @@ fn test_asset_xcm_trader_with_refund() {
|
||||
// We set existential deposit to be identical to the one for Balances first
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
ExistentialDeposit::get()
|
||||
@@ -127,7 +127,7 @@ fn test_asset_xcm_trader_with_refund() {
|
||||
// We first mint enough asset for the account to exist for assets
|
||||
assert_ok!(Assets::mint(
|
||||
RuntimeHelper::<Runtime>::origin_of(AccountId::from(ALICE)),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
ExistentialDeposit::get()
|
||||
));
|
||||
@@ -204,7 +204,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() {
|
||||
// We set existential deposit to be identical to the one for Balances first
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
ExistentialDeposit::get()
|
||||
@@ -264,7 +264,7 @@ fn test_that_buying_ed_refund_does_not_refund() {
|
||||
// We set existential deposit to be identical to the one for Balances first
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
true,
|
||||
ExistentialDeposit::get()
|
||||
@@ -336,7 +336,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() {
|
||||
let minimum_asset_balance = 1_000_000_u128;
|
||||
assert_ok!(Assets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
false,
|
||||
minimum_asset_balance
|
||||
@@ -345,7 +345,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() {
|
||||
// We first mint enough asset for the account to exist for assets
|
||||
assert_ok!(Assets::mint(
|
||||
RuntimeHelper::<Runtime>::origin_of(AccountId::from(ALICE)),
|
||||
1,
|
||||
1.into(),
|
||||
AccountId::from(ALICE).into(),
|
||||
minimum_asset_balance
|
||||
));
|
||||
|
||||
@@ -132,6 +132,7 @@ runtime-benchmarks = [
|
||||
"frame-support/runtime-benchmarks",
|
||||
"frame-system-benchmarking/runtime-benchmarks",
|
||||
"frame-system/runtime-benchmarks",
|
||||
"pallet-assets/runtime-benchmarks",
|
||||
"pallet-balances/runtime-benchmarks",
|
||||
"pallet-collator-selection/runtime-benchmarks",
|
||||
"pallet-timestamp/runtime-benchmarks",
|
||||
|
||||
@@ -397,6 +397,7 @@ impl pallet_assets::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Balance = Balance;
|
||||
type AssetId = AssetId;
|
||||
type AssetIdParameter = codec::Compact<AssetId>;
|
||||
type Currency = Balances;
|
||||
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
|
||||
type ForceOrigin = EnsureRoot<AccountId>;
|
||||
@@ -410,6 +411,8 @@ impl pallet_assets::Config for Runtime {
|
||||
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
|
||||
type AssetAccountDeposit = AssetAccountDeposit;
|
||||
type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type BenchmarkHelper = ();
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
|
||||
@@ -10,6 +10,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
|
||||
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
|
||||
|
||||
# Substrate
|
||||
frame-benchmarking = { git = "https://github.com/paritytech/substrate", optional = true, default-features = false, branch = "master" }
|
||||
frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
|
||||
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
|
||||
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
|
||||
@@ -99,3 +100,7 @@ std = [
|
||||
"parachain-info/std",
|
||||
"parachains-common/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"frame-benchmarking/runtime-benchmarks",
|
||||
"pallet-assets/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -496,6 +496,7 @@ impl pallet_assets::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Balance = u64;
|
||||
type AssetId = AssetId;
|
||||
type AssetIdParameter = codec::Compact<AssetId>;
|
||||
type Currency = Balances;
|
||||
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
|
||||
type ForceOrigin = AdminOrigin;
|
||||
@@ -509,6 +510,8 @@ impl pallet_assets::Config for Runtime {
|
||||
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
|
||||
type AssetAccountDeposit = AssetAccountDeposit;
|
||||
type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type BenchmarkHelper = ();
|
||||
}
|
||||
|
||||
impl pallet_aura::Config for Runtime {
|
||||
|
||||
Reference in New Issue
Block a user