mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 03:31:10 +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:
@@ -22,7 +22,6 @@ sp-runtime = { version = "3.0.0", default-features = false, path = "../../primit
|
||||
frame-support = { version = "3.0.0", default-features = false, path = "../support" }
|
||||
sp-consensus-aura = { version = "0.9.0", path = "../../primitives/consensus/aura", default-features = false }
|
||||
frame-system = { version = "3.0.0", default-features = false, path = "../system" }
|
||||
sp-timestamp = { version = "3.0.0", default-features = false, path = "../../primitives/timestamp" }
|
||||
pallet-timestamp = { version = "3.0.0", default-features = false, path = "../timestamp" }
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -42,7 +41,6 @@ std = [
|
||||
"frame-support/std",
|
||||
"sp-consensus-aura/std",
|
||||
"frame-system/std",
|
||||
"sp-timestamp/std",
|
||||
"pallet-timestamp/std",
|
||||
]
|
||||
try-runtime = ["frame-support/try-runtime"]
|
||||
|
||||
@@ -39,12 +39,13 @@
|
||||
|
||||
use sp_std::prelude::*;
|
||||
use codec::{Encode, Decode};
|
||||
use frame_support::{Parameter, traits::{Get, FindAuthor, OneSessionHandler}, ConsensusEngineId};
|
||||
use frame_support::{
|
||||
Parameter, traits::{Get, FindAuthor, OneSessionHandler, OnTimestampSet}, ConsensusEngineId,
|
||||
};
|
||||
use sp_runtime::{
|
||||
RuntimeAppPublic,
|
||||
traits::{SaturatedConversion, Saturating, Zero, Member, IsMember}, generic::DigestItem,
|
||||
};
|
||||
use sp_timestamp::OnTimestampSet;
|
||||
use sp_consensus_aura::{AURA_ENGINE_ID, ConsensusLog, AuthorityIndex, Slot};
|
||||
|
||||
mod mock;
|
||||
|
||||
Reference in New Issue
Block a user