zeitgeist icon indicating copy to clipboard operation
zeitgeist copied to clipboard

Why does `ReportingPeriod` have type `u32` instead of `BlockNumber`?

Open maltekliemann opened this issue 2 years ago • 2 comments

maltekliemann avatar Jul 16 '22 14:07 maltekliemann

Maybe for convenience when coding, not sure about that. It should be BlockNumber.

sea212 avatar Jul 18 '22 08:07 sea212

AFAIU BlockNumber is mostly u64, then converting it to Moment requires try_into() as Moment is AtLeastU32 and that does not have From. when ReportingPeriod is just a duration so if it is in u32 it can be converted to BlockNumber easily and also (ReportingPeriod * MILLISECS_PER_BLOCK (u32) ) gets converted to Moment. Also why it should be BlockNumber? if it is just for readability then can we have u32 aliased as BlockDuration and use it for representing such values?

vivekvpandya avatar Aug 16 '22 04:08 vivekvpandya

Closed as no longer relevant.

maltekliemann avatar May 03 '24 16:05 maltekliemann