stratus/eth/primitives/
unix_time_now.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
use display_json::DebugAsJson;

use crate::eth::primitives::UnixTime;

/// [`UnixTime`] that automatically sets the current time when created.
#[derive(DebugAsJson, Clone, PartialEq, Eq, derive_more::Deref, fake::Dummy, serde::Serialize, serde::Deserialize)]
pub struct UnixTimeNow(#[deref] UnixTime);

impl Default for UnixTimeNow {
    fn default() -> Self {
        Self(UnixTime::now())
    }
}