Skip to content

Commit

Permalink
Fix warnings and remove obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreenbury committed Aug 26, 2024
1 parent 031dd07 commit 09271e2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions crates/trustchain-core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,18 +301,6 @@ pub fn generate_key() -> JWK {
JWK::generate_secp256k1().expect("Could not generate key.")
}

#[allow(dead_code)]
pub fn set_panic_hook() {
// When the `console_error_panic_hook` feature is enabled, we can call the
// `set_panic_hook` function at least once during initialization, and then
// we will get better error messages if our code ever panics.
//
// For more details see
// <https://github.com/rustwasm/console_error_panic_hook#readme>
#[cfg(feature = "console_error_panic_hook")]
console_error_panic_hook::set_once();
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
2 changes: 1 addition & 1 deletion crates/trustchain-ion/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ pub fn time_at_block_height(
/// Returns the unix timestamp at 00h:00m:00s UTC on the given date.
fn first_unixtime_on(date: NaiveDate) -> i64 {
let datetime = date.and_hms_opt(0, 0, 0).unwrap();
datetime.timestamp()
datetime.and_utc().timestamp()
}

/// Returns the height of the last block mined before the given date.
Expand Down

0 comments on commit 09271e2

Please sign in to comment.