-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Make Staking pallet using a proper Time module. #4662
Changes from 6 commits
b00aab3
92d0535
0ef0cfe
77301ba
1e018df
0ae4f62
458fb77
62c8d18
cdd3a72
6a0fcfd
41e288b
596e043
343ded0
0a2b8ab
58dc268
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -785,6 +785,12 @@ pub trait Time { | |
fn now() -> Self::Moment; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now you are mixing some time related functionality ( I still think we should keep this I would add another trait The timestamp module would implement both of these traits and return the same value for both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I completely agree |
||
} | ||
|
||
/// Trait to deal with unix time. | ||
pub trait UnixTime { | ||
/// Return duration since `SystemTime::UNIX_EPOCH`. | ||
fn now() -> core::time::Duration; | ||
} | ||
|
||
impl WithdrawReasons { | ||
/// Choose all variants except for `one`. | ||
/// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main use it to be able to decode the old structure
ActiveInfo<MomentOf<T>>
.But indeed I can just decode the EraIndex and not start field as I don't use it.
I updated code as such, (also fixing that StorageVersion wasn't set)