Skip to content

Commit

Permalink
chore: remove deprecated ExtendBytes, update EpochTime
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Mar 15, 2022
1 parent 80b70bb commit 36f4063
Show file tree
Hide file tree
Showing 127 changed files with 221 additions and 207 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion applications/tari_app_grpc/src/conversions/block_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::convert::TryFrom;

use tari_common_types::types::BlindingFactor;
use tari_core::{blocks::BlockHeader, proof_of_work::ProofOfWork};
use tari_crypto::tari_utilities::{ByteArray, Hashable};
use tari_utilities::{ByteArray, Hashable};

use crate::{
conversions::{datetime_to_timestamp, timestamp_to_datetime},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use tari_core::transactions::transaction_components::{
SideChainCheckpointFeatures,
TemplateParameter,
};
use tari_crypto::tari_utilities::ByteArray;
use tari_utilities::ByteArray;

use crate::tari_rpc as grpc;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use tari_core::transactions::{
tari_amount::MicroTari,
transaction_components::{KernelFeatures, TransactionKernel, TransactionKernelVersion},
};
use tari_crypto::tari_utilities::{ByteArray, Hashable};
use tari_utilities::{ByteArray, Hashable};

use crate::tari_rpc as grpc;

Expand Down
2 changes: 1 addition & 1 deletion applications/tari_app_utilities/src/identity_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use tari_common::{
exit_codes::{ExitCode, ExitError},
};
use tari_comms::{multiaddr::Multiaddr, peer_manager::PeerFeatures, NodeIdentity};
use tari_crypto::tari_utilities::hex::Hex;
use tari_utilities::hex::Hex;

pub const LOG_TARGET: &str = "tari_application";

Expand Down
12 changes: 4 additions & 8 deletions applications/tari_base_node/src/commands/command_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use std::{
};

use anyhow::{anyhow, Error};
use chrono::{DateTime, Utc};
use chrono::Utc;
use log::*;
use tari_app_utilities::{consts, utilities::parse_emoji_id_or_public_key};
use tari_common::GlobalConfig;
Expand Down Expand Up @@ -141,14 +141,10 @@ impl CommandHandler {
.get_header(height)
.await?
.ok_or_else(|| anyhow!("No last header"))?;
let last_block_time = DateTime::<Utc>::from(last_header.header().timestamp);
let last_block_time = last_header.header().to_chrono_datetime().to_rfc2822();
status_line.add_field(
"Tip",
format!(
"{} ({})",
metadata.height_of_longest_chain(),
last_block_time.to_rfc2822()
),
format!("{} ({})", metadata.height_of_longest_chain(), last_block_time),
);

let constants = self
Expand Down Expand Up @@ -959,7 +955,7 @@ impl CommandHandler {
solve_time,
normalized_solve_time,
pow_algo,
chrono::DateTime::from(header.header().timestamp),
header.header().to_chrono_datetime(),
target_diff.get(pow_algo).len(),
acc_monero.as_u64(),
acc_sha3.as_u64(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use tari_app_utilities::utilities::{parse_emoji_id_or_public_key, parse_hash};
use tari_common_types::types::PublicKey;
use tari_comms::multiaddr::Multiaddr;
use tari_core::transactions::tari_amount::MicroTari;
use tari_crypto::tari_utilities::hex::Hex;
use tari_utilities::hex::Hex;

use crate::automation::{commands::WalletCommand, error::ParseError};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ use tari_core::transactions::{
tari_amount::MicroTari,
transaction_components::{OutputFeatures, UnblindedOutput},
};
use tari_crypto::{ristretto::RistrettoPublicKey, tari_utilities::Hashable};
use tari_utilities::{hex::Hex, ByteArray};
use tari_crypto::ristretto::RistrettoPublicKey;
use tari_utilities::{hex::Hex, ByteArray, Hashable};
use tari_wallet::{
connectivity_service::{OnlineStatus, WalletConnectivityInterface},
output_manager_service::handle::OutputManagerHandle,
Expand Down
2 changes: 1 addition & 1 deletion applications/tari_console_wallet/src/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ use futures::FutureExt;
use log::*;
use rustyline::Editor;
use tari_common::exit_codes::{ExitCode, ExitError};
use tari_crypto::tari_utilities::hex::Hex;
use tari_key_manager::{cipher_seed::CipherSeed, mnemonic::Mnemonic};
use tari_shutdown::Shutdown;
use tari_utilities::hex::Hex;
use tari_wallet::{
storage::sqlite_db::wallet::WalletSqliteDatabase,
utxo_scanner_service::{handle::UtxoScannerEvent, service::UtxoScannerService},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use tari_crypto::tari_utilities::hex::Hex;
use tari_utilities::hex::Hex;
use tui::{
backend::Backend,
layout::{Constraint, Rect},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::HashMap;

use log::*;
use tari_comms::peer_manager::Peer;
use tari_crypto::tari_utilities::hex::Hex;
use tari_utilities::hex::Hex;
use tokio::runtime::Handle;
use tui::{
backend::Backend,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use tari_crypto::tari_utilities::hex::Hex;
use tari_utilities::hex::Hex;
use tui::{
backend::Backend,
layout::{Constraint, Rect},
Expand Down
3 changes: 2 additions & 1 deletion applications/tari_console_wallet/src/ui/state/app_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ use tari_core::transactions::{
tari_amount::{uT, MicroTari},
weight::TransactionWeight,
};
use tari_crypto::{ristretto::RistrettoPublicKey, tari_utilities::hex::Hex};
use tari_crypto::ristretto::RistrettoPublicKey;
use tari_p2p::auto_update::SoftwareUpdaterHandle;
use tari_shutdown::ShutdownSignal;
use tari_utilities::hex::Hex;
use tari_wallet::{
assets::Asset,
base_node_service::{handle::BaseNodeEventReceiver, service::BaseNodeState},
Expand Down
2 changes: 1 addition & 1 deletion applications/tari_console_wallet/src/ui/ui_error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use tari_comms::connectivity::ConnectivityError;
use tari_crypto::tari_utilities::hex::HexError;
use tari_utilities::hex::HexError;
use tari_wallet::{
contacts_service::error::ContactsServiceError,
error::{WalletError, WalletStorageError},
Expand Down
2 changes: 1 addition & 1 deletion applications/tari_console_wallet/src/utils/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use tari_comms::{
multiaddr::Multiaddr,
peer_manager::{NodeId, Peer, PeerFeatures, PeerFlags},
};
use tari_crypto::tari_utilities::hex::Hex;
use tari_utilities::hex::Hex;
use tari_wallet::WalletSqlite;

pub const LOG_TARGET: &str = "wallet::utils::db";
Expand Down
4 changes: 3 additions & 1 deletion applications/tari_mining_node/src/difficulty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ pub mod test {

pub fn get_header() -> (BlockHeader, CoreBlockHeader) {
let mut header = CoreBlockHeader::new(0);
header.timestamp = DateTime::<Utc>::from_utc(NaiveDate::from_ymd(2000, 1, 1).and_hms(1, 1, 1), Utc).into();
header.timestamp =
(DateTime::<Utc>::from_utc(NaiveDate::from_ymd(2000, 1, 1).and_hms(1, 1, 1), Utc).timestamp() as u64)
.into();
header.pow.pow_algo = tari_core::proof_of_work::PowAlgorithm::Sha3;
(header.clone().into(), header)
}
Expand Down
3 changes: 2 additions & 1 deletion applications/tari_mining_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ use tari_common::{
};
use tari_comms::utils::multiaddr::multiaddr_to_socketaddr;
use tari_core::blocks::BlockHeader;
use tari_crypto::{ristretto::RistrettoPublicKey, tari_utilities::hex::Hex};
use tari_crypto::ristretto::RistrettoPublicKey;
use tari_utilities::hex::Hex;
use tokio::{runtime::Runtime, time::sleep};
use tonic::transport::Channel;
use utils::{coinbase_request, extract_outputs_and_kernels};
Expand Down
2 changes: 1 addition & 1 deletion base_layer/common_types/src/chain_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use std::fmt::{Display, Error, Formatter};

use serde::{Deserialize, Serialize};
use tari_crypto::tari_utilities::hex::Hex;
use tari_utilities::hex::Hex;

use crate::types::BlockHash;

Expand Down
2 changes: 1 addition & 1 deletion base_layer/common_types/src/types/bullet_rangeproofs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use serde::{
Serialize,
Serializer,
};
use tari_crypto::tari_utilities::{hex::*, ByteArray, ByteArrayError, Hashable};
use tari_utilities::{hex::*, ByteArray, ByteArrayError, Hashable};

use crate::types::HashDigest;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use std::{

use serde::{Deserialize, Serialize};
use tari_common_types::types::{Commitment, HashOutput, PrivateKey, PublicKey, Signature};
use tari_crypto::tari_utilities::hex::Hex;
use tari_utilities::hex::Hex;

use crate::{blocks::NewBlockTemplate, chain_storage::MmrTree, proof_of_work::PowAlgorithm};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ use log::*;
use strum_macros::Display;
use tari_common_types::types::{BlockHash, HashOutput, PublicKey};
use tari_comms::{connectivity::ConnectivityRequester, peer_manager::NodeId};
use tari_crypto::tari_utilities::{hash::Hashable, hex::Hex};
use tari_utilities::ByteArray;
use tari_utilities::{hash::Hashable, hex::Hex, ByteArray};
use tokio::sync::Semaphore;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion base_layer/core/src/base_node/rpc/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::convert::TryFrom;
use log::*;
use tari_common_types::types::Signature;
use tari_comms::protocol::rpc::{Request, Response, RpcStatus, Streaming};
use tari_crypto::tari_utilities::hex::Hex;
use tari_utilities::hex::Hex;
use tokio::sync::mpsc;

use crate::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::{sync::Arc, time::Instant};

use log::*;
use tari_comms::protocol::rpc::RpcStatus;
use tari_crypto::tari_utilities::{hex::Hex, Hashable};
use tari_utilities::{hex::Hex, Hashable};
use tokio::{sync::mpsc, task};

use crate::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use log::*;
use num_format::{Locale, ToFormattedString};
use serde::{Deserialize, Serialize};
use tari_common_types::chain_metadata::ChainMetadata;
use tari_crypto::tari_utilities::epoch_time::EpochTime;
use tari_utilities::epoch_time::EpochTime;
use tokio::sync::broadcast;

use crate::{
Expand Down
3 changes: 1 addition & 2 deletions base_layer/core/src/base_node/sync/rpc/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ use tari_comms::{
protocol::rpc::{Request, Response, RpcStatus, Streaming},
utils,
};
use tari_crypto::tari_utilities::hex::Hex;
use tari_utilities::Hashable;
use tari_utilities::{hex::Hex, Hashable};
use tokio::{
sync::{mpsc, RwLock},
task,
Expand Down
2 changes: 1 addition & 1 deletion base_layer/core/src/base_node/sync/rpc/sync_utxos_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use tari_comms::{
protocol::rpc::{Request, RpcStatus},
utils,
};
use tari_crypto::tari_utilities::{hex::Hex, Hashable};
use tari_utilities::{hex::Hex, Hashable};
use tokio::{sync::mpsc, task};

use crate::{
Expand Down
3 changes: 1 addition & 2 deletions base_layer/core/src/blocks/accumulated_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ use serde::{
Serializer,
};
use tari_common_types::types::{BlindingFactor, Commitment, HashOutput};
use tari_crypto::tari_utilities::hex::Hex;
use tari_mmr::{pruned_hashset::PrunedHashSet, ArrayLike};
use tari_utilities::Hashable;
use tari_utilities::{hex::Hex, Hashable};

use crate::{
blocks::{error::BlockError, Block, BlockHeader},
Expand Down
4 changes: 1 addition & 3 deletions base_layer/core/src/blocks/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ use std::{
use log::*;
use serde::{Deserialize, Serialize};
use tari_common_types::types::PrivateKey;
use tari_crypto::tari_utilities::Hashable;
use tari_utilities::hex::Hex;
use tari_utilities::{hex::Hex, Hashable};
use thiserror::Error;

use crate::{
Expand Down Expand Up @@ -163,7 +162,6 @@ impl Display for Block {
}
}

#[derive(Default)]
pub struct BlockBuilder {
header: BlockHeader,
inputs: Vec<TransactionInput>,
Expand Down
Loading

0 comments on commit 36f4063

Please sign in to comment.