-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Make Staking pallet using a proper Time module. #4662
Changes from 13 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -858,6 +858,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.
I'm not sure what to think about this default, because if we add staking in a running chain (so without executing GenesisConfig) then we must insert the storage version in the runtime upgrade.
I think a staking module without any storage version must be considered invalid now.
otherwise if a chain introduce staking module without inserting the storage version then the storage version depends on when it has been inserted, and storage version could be V2 or V3 there is no way to know it.