Unverified Commit 23f03294 authored by Zeke Mostov's avatar Zeke Mostov Committed by GitHub
Browse files

substrate #9202 companion: Multiple vesting schedules (#3407)

* substrate #9202 companion: Multiple vesting schedules

* Update weights inline with substrate updates

* Use 28 vesting schedules

* Add MaxSchedulesParam everywhere

* Fix var name errors

* rever accidental changes to test-runtime

* try merge origin master

* Revert "try merge origin master"

This reverts commit 398d65d1.

* update to pass integrity test

* Make integrity tests work

* Revert const to storage MinVestedTransfer

* Use MAX_VESTING_SCHEDULES const

* Update Cargo.lock to make it compile

* update Substrate

Co-authored-by: parity-processbot <>
parent 30a6c7fc
Pipeline #153892 passed with stages
in 44 minutes and 3 seconds
This diff is collapsed.
......@@ -773,7 +773,7 @@ mod tests {
}
parameter_types! {
pub const MinVestedTransfer: u64 = 0;
pub const MinVestedTransfer: u64 = 1;
}
impl pallet_vesting::Config for Test {
......@@ -782,6 +782,7 @@ mod tests {
type BlockNumberToBalance = Identity;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
const MAX_VESTING_SCHEDULES: u32 = 28;
}
parameter_types! {
......
......@@ -539,7 +539,7 @@ mod tests {
}
parameter_types! {
pub const MinVestedTransfer: u64 = 0;
pub const MinVestedTransfer: u64 = 1;
}
impl pallet_vesting::Config for Test {
......@@ -548,6 +548,7 @@ mod tests {
type BlockNumberToBalance = Identity;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
const MAX_VESTING_SCHEDULES: u32 = 28;
}
parameter_types! {
......
......@@ -951,6 +951,7 @@ impl pallet_vesting::Config for Runtime {
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
const MAX_VESTING_SCHEDULES: u32 = 28;
}
parameter_types! {
......
......@@ -42,46 +42,71 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_vesting`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
fn vest_locked(l: u32) -> Weight {
(42_136_000 as Weight)
// Standard Error: 16_000
.saturating_add((235_000 as Weight).saturating_mul(l as Weight))
fn vest_locked(l: u32, s: u32, ) -> Weight {
(93_789_000 as Weight)
// Standard Error: 70_000
.saturating_add((41_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 182_000
.saturating_add((211_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_unlocked(l: u32) -> Weight {
(45_276_000 as Weight)
// Standard Error: 10_000
.saturating_add((189_000 as Weight).saturating_mul(l as Weight))
fn vest_unlocked(_l: u32, s: u32, ) -> Weight {
(90_737_000 as Weight)
// Standard Error: 0
.saturating_add((263_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_other_locked(l: u32) -> Weight {
(42_030_000 as Weight)
// Standard Error: 18_000
.saturating_add((243_000 as Weight).saturating_mul(l as Weight))
fn vest_other_locked(l: u32, s: u32, ) -> Weight {
(85_211_000 as Weight)
// Standard Error: 17_000
.saturating_add((153_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 45_000
.saturating_add((289_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vest_other_unlocked(l: u32) -> Weight {
(45_211_000 as Weight)
// Standard Error: 10_000
.saturating_add((191_000 as Weight).saturating_mul(l as Weight))
fn vest_other_unlocked(l: u32, s: u32, ) -> Weight {
(90_368_000 as Weight)
// Standard Error: 17_000
.saturating_add((31_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 45_000
.saturating_add((132_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vested_transfer(l: u32) -> Weight {
(100_375_000 as Weight)
// Standard Error: 13_000
.saturating_add((136_000 as Weight).saturating_mul(l as Weight))
fn vested_transfer(l: u32, _s: u32, ) -> Weight {
(167_500_000 as Weight)
// Standard Error: 194_000
.saturating_add((255_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn force_vested_transfer(l: u32) -> Weight {
(100_907_000 as Weight)
// Standard Error: 12_000
.saturating_add((101_000 as Weight).saturating_mul(l as Weight))
fn force_vested_transfer(l: u32, _s: u32, ) -> Weight {
(174_000_000 as Weight)
// Standard Error: 70_000
.saturating_add((143_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
(101_778_000 as Weight)
// Standard Error: 17_000
.saturating_add((194_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 48_000
.saturating_add((361_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
(104_111_000 as Weight)
// Standard Error: 88_000
.saturating_add((276_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 240_000
.saturating_add((194_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
}
......@@ -861,6 +861,7 @@ impl pallet_vesting::Config for Runtime {
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
const MAX_VESTING_SCHEDULES: u32 = 28;
}
impl pallet_utility::Config for Runtime {
......
......@@ -42,46 +42,71 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_vesting`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
fn vest_locked(l: u32) -> Weight {
(41_282_000 as Weight)
// Standard Error: 14_000
.saturating_add((225_000 as Weight).saturating_mul(l as Weight))
fn vest_locked(l: u32, s: u32, ) -> Weight {
(93_789_000 as Weight)
// Standard Error: 70_000
.saturating_add((41_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 182_000
.saturating_add((211_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_unlocked(l: u32) -> Weight {
(44_048_000 as Weight)
// Standard Error: 10_000
.saturating_add((192_000 as Weight).saturating_mul(l as Weight))
fn vest_unlocked(_l: u32, s: u32, ) -> Weight {
(90_737_000 as Weight)
// Standard Error: 0
.saturating_add((263_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_other_locked(l: u32) -> Weight {
(40_722_000 as Weight)
fn vest_other_locked(l: u32, s: u32, ) -> Weight {
(85_211_000 as Weight)
// Standard Error: 17_000
.saturating_add((242_000 as Weight).saturating_mul(l as Weight))
.saturating_add((153_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 45_000
.saturating_add((289_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vest_other_unlocked(l: u32) -> Weight {
(43_752_000 as Weight)
// Standard Error: 14_000
.saturating_add((215_000 as Weight).saturating_mul(l as Weight))
fn vest_other_unlocked(l: u32, s: u32, ) -> Weight {
(90_368_000 as Weight)
// Standard Error: 17_000
.saturating_add((31_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 45_000
.saturating_add((132_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vested_transfer(l: u32) -> Weight {
(97_642_000 as Weight)
// Standard Error: 13_000
.saturating_add((133_000 as Weight).saturating_mul(l as Weight))
fn vested_transfer(l: u32, _s: u32, ) -> Weight {
(167_500_000 as Weight)
// Standard Error: 194_000
.saturating_add((255_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn force_vested_transfer(l: u32) -> Weight {
(97_119_000 as Weight)
// Standard Error: 13_000
.saturating_add((124_000 as Weight).saturating_mul(l as Weight))
fn force_vested_transfer(l: u32, _s: u32, ) -> Weight {
(174_000_000 as Weight)
// Standard Error: 70_000
.saturating_add((143_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
(101_778_000 as Weight)
// Standard Error: 17_000
.saturating_add((194_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 48_000
.saturating_add((361_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
(104_111_000 as Weight)
// Standard Error: 88_000
.saturating_add((276_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 240_000
.saturating_add((194_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
}
......@@ -442,6 +442,7 @@ impl pallet_vesting::Config for Runtime {
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
const MAX_VESTING_SCHEDULES: u32 = 28;
}
impl pallet_sudo::Config for Runtime {
......
......@@ -629,6 +629,7 @@ impl pallet_vesting::Config for Runtime {
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
const MAX_VESTING_SCHEDULES: u32 = 28;
}
impl pallet_sudo::Config for Runtime {
......
......@@ -42,46 +42,70 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_vesting`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
fn vest_locked(l: u32) -> Weight {
(42_241_000 as Weight)
// Standard Error: 13_000
.saturating_add((220_000 as Weight).saturating_mul(l as Weight))
fn vest_locked(l: u32, s: u32, ) -> Weight {
(93_789_000 as Weight)
// Standard Error: 70_000
.saturating_add((41_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 182_000
.saturating_add((211_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_unlocked(l: u32) -> Weight {
(45_263_000 as Weight)
// Standard Error: 10_000
.saturating_add((188_000 as Weight).saturating_mul(l as Weight))
fn vest_unlocked(_l: u32, s: u32, ) -> Weight {
(90_737_000 as Weight)
// Standard Error: 0
.saturating_add((263_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_other_locked(l: u32) -> Weight {
(41_538_000 as Weight)
fn vest_other_locked(l: u32, s: u32, ) -> Weight {
(85_211_000 as Weight)
// Standard Error: 17_000
.saturating_add((239_000 as Weight).saturating_mul(l as Weight))
.saturating_add((153_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 45_000
.saturating_add((289_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vest_other_unlocked(l: u32) -> Weight {
(44_715_000 as Weight)
// Standard Error: 13_000
.saturating_add((207_000 as Weight).saturating_mul(l as Weight))
fn vest_other_unlocked(l: u32, s: u32, ) -> Weight {
(90_368_000 as Weight)
// Standard Error: 17_000
.saturating_add((31_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 45_000
.saturating_add((132_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vested_transfer(l: u32) -> Weight {
(100_413_000 as Weight)
// Standard Error: 13_000
.saturating_add((103_000 as Weight).saturating_mul(l as Weight))
fn vested_transfer(l: u32, _s: u32, ) -> Weight {
(167_500_000 as Weight)
// Standard Error: 194_000
.saturating_add((255_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn force_vested_transfer(l: u32) -> Weight {
(99_525_000 as Weight)
// Standard Error: 13_000
.saturating_add((108_000 as Weight).saturating_mul(l as Weight))
fn force_vested_transfer(l: u32, _s: u32, ) -> Weight {
(174_000_000 as Weight)
// Standard Error: 70_000
.saturating_add((143_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
}
fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
(101_778_000 as Weight)
// Standard Error: 17_000
.saturating_add((194_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 48_000
.saturating_add((361_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
(104_111_000 as Weight)
// Standard Error: 88_000
.saturating_add((276_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 240_000
.saturating_add((194_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment