Skip to content

Commit

Permalink
onchain: fix chrono by removing call to a deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Mar 20, 2024
1 parent 0812dc3 commit a5ef6ea
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 35 deletions.
105 changes: 72 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions onchain/src/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::str::FromStr;

use bitcoin::blockdata::constants;
use bitcoin::{BlockHash, Network, OutPoint};
use chrono::NaiveDateTime;
use chrono::{DateTime, NaiveDateTime};
#[cfg(feature = "electrum")]
use electrum_client::ListUnspentRes;
use strict_encoding::{StrictDecode, StrictEncode};
Expand Down Expand Up @@ -48,7 +48,9 @@ pub struct TimeHeight {
impl Default for TimeHeight {
fn default() -> Self {
TimeHeight {
timestamp: NaiveDateTime::from_timestamp_millis(1231006500).expect("hardcoded value"),
timestamp: DateTime::from_timestamp_millis(1231006500)
.expect("hardcoded value")
.naive_utc(),
block_height: 0,
block_hash: constants::genesis_block(Network::Bitcoin).block_hash(),
}
Expand Down

0 comments on commit a5ef6ea

Please sign in to comment.