Trait TimestampChecker

Source
pub trait TimestampChecker {
    // Required method
    fn current_timestamp(&self) -> u32;

    // Provided method
    fn is_valid(&self, timestamp: u32) -> bool { ... }
}
Expand description

Public trait that handles timestamp fetching across different chains

Required Methods§

Provided Methods§

Source

fn is_valid(&self, timestamp: u32) -> bool

Returns if the timestamp used in the signature is valid Returns false if the timestamp is not at most 1 hour old to prevent replays. Returns false if the timestamp is not from the past, with some leeway to accomodate for some benign time drift. These values are appropriate in most cases, but you can adjust them if you are aware of the implications.

§Arguments
  • timestamp Timestamp used in the signature

Implementors§