more chrono warnings, update cursive lib (#3778)

This commit is contained in:
Yeastplume
2024-01-29 12:50:45 +00:00
committed by GitHub
parent d1b7ae5352
commit c5efaa4e7c
12 changed files with 472 additions and 359 deletions
+3 -3
View File
@@ -231,7 +231,7 @@ impl Default for BlockHeader {
BlockHeader {
version: HeaderVersion(1),
height: 0,
timestamp: DateTime::<Utc>::from_utc(
timestamp: DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(0, 0).unwrap(),
Utc,
),
@@ -313,7 +313,7 @@ fn read_block_header<R: Reader>(reader: &mut R) -> Result<BlockHeader, ser::Erro
Ok(BlockHeader {
version,
height,
timestamp: DateTime::<Utc>::from_utc(ts.unwrap(), Utc),
timestamp: DateTime::from_naive_utc_and_offset(ts.unwrap(), Utc),
prev_hash,
prev_root,
output_root,
@@ -667,7 +667,7 @@ impl Block {
return Err(Error::Other("Converting Utc::now() into timestamp".into()));
}
let timestamp = DateTime::<Utc>::from_utc(ts.unwrap(), Utc);
let timestamp = DateTime::from_naive_utc_and_offset(ts.unwrap(), Utc);
// Now build the block with all the above information.
// Note: We have not validated the block here.
// Caller must validate the block as necessary.
+4 -2
View File
@@ -115,8 +115,10 @@ pub fn pow_size(
// and if we're back where we started, update the time (changes the hash as
// well)
if bh.pow.nonce == start_nonce {
bh.timestamp =
DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp_opt(0, 0).unwrap(), Utc);
bh.timestamp = DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(0, 0).unwrap(),
Utc,
);
}
}
}