Skip to content

Commit cc148a7

Browse files
authored
add MaxEncodedLen (#768)
1 parent 443ed51 commit cc148a7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

vesting/src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub const VESTING_LOCK_ID: LockIdentifier = *b"ormlvest";
5959
/// Benefits would be granted gradually, `per_period` amount every `period`
6060
/// of blocks after `start`.
6161
#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, MaxEncodedLen, TypeInfo)]
62-
pub struct VestingSchedule<BlockNumber, Balance: HasCompact> {
62+
pub struct VestingSchedule<BlockNumber, Balance: MaxEncodedLen + HasCompact> {
6363
/// Vesting starting block
6464
pub start: BlockNumber,
6565
/// Number of blocks between vest
@@ -71,7 +71,9 @@ pub struct VestingSchedule<BlockNumber, Balance: HasCompact> {
7171
pub per_period: Balance,
7272
}
7373

74-
impl<BlockNumber: AtLeast32Bit + Copy, Balance: AtLeast32Bit + Copy> VestingSchedule<BlockNumber, Balance> {
74+
impl<BlockNumber: AtLeast32Bit + Copy, Balance: AtLeast32Bit + MaxEncodedLen + Copy>
75+
VestingSchedule<BlockNumber, Balance>
76+
{
7577
/// Returns the end of all periods, `None` if calculation overflows.
7678
pub fn end(&self) -> Option<BlockNumber> {
7779
// period * period_count + start

0 commit comments

Comments
 (0)