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

Companion for Substrate 12740 #1898

Merged
merged 11 commits into from
Nov 28, 2022
3 changes: 3 additions & 0 deletions parachains/runtimes/assets/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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! {
Expand Down
12 changes: 6 additions & 6 deletions parachains/runtimes/assets/statemine/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn test_asset_xcm_trader() {
// 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()
Expand All @@ -37,7 +37,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)),
1,
1.into(),
AccountId::from(ALICE).into(),
ExistentialDeposit::get()
));
Expand Down Expand Up @@ -98,7 +98,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()
Expand All @@ -107,7 +107,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()
));
Expand Down Expand Up @@ -185,7 +185,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()
Expand Down Expand Up @@ -245,7 +245,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()
Expand Down
3 changes: 3 additions & 0 deletions parachains/runtimes/assets/statemint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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! {
Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/assets/statemint/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn test_asset_xcm_trader_does_not_work_in_statemine() {
// 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()
Expand Down
3 changes: 3 additions & 0 deletions parachains/runtimes/assets/westmint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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! {
Expand Down
12 changes: 6 additions & 6 deletions parachains/runtimes/assets/westmint/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn test_asset_xcm_trader() {
// 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()
Expand All @@ -38,7 +38,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)),
1,
1.into(),
AccountId::from(ALICE).into(),
ExistentialDeposit::get()
));
Expand Down Expand Up @@ -99,7 +99,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()
Expand All @@ -108,7 +108,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()
));
Expand Down Expand Up @@ -185,7 +185,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()
Expand Down Expand Up @@ -245,7 +245,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()
Expand Down
3 changes: 3 additions & 0 deletions parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand All @@ -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! {
Expand Down
3 changes: 3 additions & 0 deletions parachains/runtimes/testing/rococo-parachain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down