mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 19:47:59 +00:00
Convert timestamp to unit type wrapper (#8333)
The timestamp inherent type was up to now just a simple `u64`. This worked, but doesn't give you that much guarantees at compile time about the type. This pr changes that by converting this type to a unit type wrapper, similar to what we have done for `Slot`. This is required for some future pr that touches quite a lot of the inherents stuff :) Besides this unit wrapper type, this pr also moves the `OnTimestampSet` trait to `frame_support::traits`.
This commit is contained in:
@@ -2291,6 +2291,13 @@ pub trait ExecuteBlock<Block: BlockT> {
|
||||
fn execute_block(block: Block);
|
||||
}
|
||||
|
||||
/// A trait which is called when the timestamp is set in the runtime.
|
||||
#[impl_trait_for_tuples::impl_for_tuples(30)]
|
||||
pub trait OnTimestampSet<Moment> {
|
||||
/// Called when the timestamp is set.
|
||||
fn on_timestamp_set(moment: Moment);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user