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

Substrate 13843 (Asset Freezing) Companion #2437

Merged
merged 10 commits into from
May 8, 2023
5 changes: 4 additions & 1 deletion parachains/runtimes/assets/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,10 @@ pub type UncheckedExtrinsic =
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
/// Migrations to apply on runtime upgrade.
pub type Migrations = ();
pub type Migrations = (
pallet_assets::migration::v2::MigrateToV2<Runtime, TrustBackedAssetsInstance>,
pallet_assets::migration::v2::MigrateToV2<Runtime, ForeignAssetsInstance>,
);

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Expand Down
60 changes: 60 additions & 0 deletions parachains/runtimes/assets/statemine/src/weights/pallet_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,4 +441,64 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
fn freeze_creating() -> Weight {
// Proof Size summary in bytes:
// Measured: `460`
// Estimated: `7275`
// Minimum execution time: 1_678_959_000 picoseconds.
Weight::from_parts(1_700_851_000, 0)
.saturating_add(Weight::from_parts(0, 7275))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
fn touch() -> Weight {
// Proof Size summary in bytes:
// Measured: `453`
// Estimated: `10868`
// Minimum execution time: 864_190_000 picoseconds.
Weight::from_parts(901_733_000, 0)
.saturating_add(Weight::from_parts(0, 10868))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
fn refund() -> Weight {
// Proof Size summary in bytes:
// Measured: `613`
// Estimated: `10868`
// Minimum execution time: 921_263_000 picoseconds.
Weight::from_parts(931_595_000, 0)
.saturating_add(Weight::from_parts(0, 10868))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
fn refund_other() -> Weight {
// Proof Size summary in bytes:
// Measured: `511`
// Estimated: `7275`
// Minimum execution time: 1_810_882_000 picoseconds.
Weight::from_parts(1_879_786_000, 0)
.saturating_add(Weight::from_parts(0, 7275))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
}
3 changes: 2 additions & 1 deletion parachains/runtimes/assets/statemint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,8 @@ pub type UncheckedExtrinsic =
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
/// Migrations to apply on runtime upgrade.
pub type Migrations = ();
pub type Migrations =
(pallet_assets::migration::v2::MigrateToV2<Runtime, TrustBackedAssetsInstance>,);

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Expand Down
60 changes: 60 additions & 0 deletions parachains/runtimes/assets/statemint/src/weights/pallet_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,4 +447,64 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
fn freeze_creating() -> Weight {
// Proof Size summary in bytes:
// Measured: `460`
// Estimated: `7275`
// Minimum execution time: 1_678_959_000 picoseconds.
Weight::from_parts(1_700_851_000, 0)
.saturating_add(Weight::from_parts(0, 7275))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
fn touch() -> Weight {
// Proof Size summary in bytes:
// Measured: `453`
// Estimated: `10868`
// Minimum execution time: 864_190_000 picoseconds.
Weight::from_parts(901_733_000, 0)
.saturating_add(Weight::from_parts(0, 10868))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
fn refund() -> Weight {
// Proof Size summary in bytes:
// Measured: `613`
// Estimated: `10868`
// Minimum execution time: 921_263_000 picoseconds.
Weight::from_parts(931_595_000, 0)
.saturating_add(Weight::from_parts(0, 10868))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
fn refund_other() -> Weight {
// Proof Size summary in bytes:
// Measured: `511`
// Estimated: `7275`
// Minimum execution time: 1_810_882_000 picoseconds.
Weight::from_parts(1_879_786_000, 0)
.saturating_add(Weight::from_parts(0, 7275))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
}
6 changes: 5 additions & 1 deletion parachains/runtimes/assets/westmint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,11 @@ pub type UncheckedExtrinsic =
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
/// Migrations to apply on runtime upgrade.
pub type Migrations = (pallet_nfts::migration::v1::MigrateToV1<Runtime>,);
pub type Migrations = (
pallet_nfts::migration::v1::MigrateToV1<Runtime>,
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved
pallet_assets::migration::v2::MigrateToV2<Runtime, TrustBackedAssetsInstance>,
pallet_assets::migration::v2::MigrateToV2<Runtime, ForeignAssetsInstance>,
);

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Expand Down
60 changes: 60 additions & 0 deletions parachains/runtimes/assets/westmint/src/weights/pallet_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,4 +443,64 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
fn freeze_creating() -> Weight {
// Proof Size summary in bytes:
// Measured: `460`
// Estimated: `7275`
// Minimum execution time: 1_678_959_000 picoseconds.
Weight::from_parts(1_700_851_000, 0)
.saturating_add(Weight::from_parts(0, 7275))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
fn touch() -> Weight {
// Proof Size summary in bytes:
// Measured: `453`
// Estimated: `10868`
// Minimum execution time: 864_190_000 picoseconds.
Weight::from_parts(901_733_000, 0)
.saturating_add(Weight::from_parts(0, 10868))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
fn refund() -> Weight {
// Proof Size summary in bytes:
// Measured: `613`
// Estimated: `10868`
// Minimum execution time: 921_263_000 picoseconds.
Weight::from_parts(931_595_000, 0)
.saturating_add(Weight::from_parts(0, 10868))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Assets Account (r:1 w:1)
/// Proof: Assets Account (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen)
/// Storage: Assets Asset (r:1 w:1)
/// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen)
fn refund_other() -> Weight {
// Proof Size summary in bytes:
// Measured: `511`
// Estimated: `7275`
// Minimum execution time: 1_810_882_000 picoseconds.
Weight::from_parts(1_879_786_000, 0)
.saturating_add(Weight::from_parts(0, 7275))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
}
6 changes: 4 additions & 2 deletions parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ pub type UncheckedExtrinsic =
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;

pub type Migrations =
(pallet_balances::migration::MigrateToTrackInactive<Runtime, xcm_config::CheckingAccount>,);
pub type Migrations = (
pallet_balances::migration::MigrateToTrackInactive<Runtime, xcm_config::CheckingAccount>,
pallet_assets::migration::v2::MigrateToV2<Runtime>,
);

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Expand Down
4 changes: 3 additions & 1 deletion parachains/runtimes/testing/rococo-parachain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,11 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
RemoveCollectiveFlip,
Migrations,
>;

pub type Migrations = (pallet_assets::migration::v2::MigrateToV2<Runtime>, RemoveCollectiveFlip);

pub struct RemoveCollectiveFlip;
impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip {
fn on_runtime_upgrade() -> Weight {
Expand Down