Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,7 @@ mod tests {
orphan_status: true,
prev_hash: HashString(BlockHash::repeat_byte(12)),
reward: Amount::from_pico(12),
timestamp: DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(61, 0).unwrap(),
Utc,
),
timestamp: DateTime::from_timestamp(61, 0).unwrap(),
};

let expected_bhr = BlockHeaderResponse {
Expand All @@ -663,10 +660,7 @@ mod tests {
orphan_status: true,
prev_hash: BlockHash::repeat_byte(12),
reward: Amount::from_pico(12),
timestamp: DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(61, 0).unwrap(),
Utc,
),
timestamp: DateTime::from_timestamp(61, 0).unwrap(),
};

assert_eq!(BlockHeaderResponse::from(bhrr), expected_bhr);
Expand Down
7 changes: 2 additions & 5 deletions tests/clients_tests/all_clients_interaction.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use chrono::{DateTime, NaiveDateTime, Utc};
use chrono::DateTime;
use hex::ToHex;
use monero::{
cryptonote::subaddress::{self, Index},
Expand Down Expand Up @@ -449,10 +449,7 @@ pub async fn run() {
subaddr_index: Index { major: 0, minor: 0 },
suggested_confirmations_threshold: Some(1),
// this is any date, since it will not be tested against anything
timestamp: DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(0, 0).unwrap(),
Utc,
),
timestamp: DateTime::from_timestamp(0, 0).unwrap(),
txid: HashString(transfer_1_data.tx_hash.0.as_ref().to_vec()),
transfer_type: GetTransfersCategory::Pending,
unlock_time: 0,
Expand Down
7 changes: 2 additions & 5 deletions tests/clients_tests/empty_blockchain.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use chrono::{DateTime, NaiveDateTime, Utc};
use chrono::DateTime;
use monero::{Address, Amount, Network};
use monero_rpc::{BlockHash, BlockHeaderResponse, BlockTemplate, HashString};

Expand Down Expand Up @@ -62,10 +62,7 @@ pub async fn run() {
// this **is** used inside the test functions, since this block header corresponds
// to the genesis block;
// note that in the `non_empty_blockchain`, this field is **not** tested.
timestamp: DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(0, 0).unwrap(),
Utc,
),
timestamp: DateTime::from_timestamp(0, 0).unwrap(),
};

helpers::regtest::get_last_block_header_assert_block_header(
Expand Down
7 changes: 2 additions & 5 deletions tests/clients_tests/non_empty_blockchain.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use chrono::{DateTime, NaiveDateTime, Utc};
use chrono::DateTime;
use monero::{Address, Amount, Network};
use monero_rpc::{BlockHash, BlockHeaderResponse, GetBlockHeaderSelector};

Expand Down Expand Up @@ -76,10 +76,7 @@ pub async fn run() {
reward: Amount::from_pico(35180379334199),
// this is not used inside the test functions below, since its value depend on when the
// test was run, so use any date in this field since it is insignificant for testing.
timestamp: DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(0, 0).unwrap(),
Utc,
),
timestamp: DateTime::from_timestamp(0, 0).unwrap(),
};
helpers::regtest::get_last_block_header_assert_block_header(
&regtest,
Expand Down