Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeickert committed Oct 27, 2022
1 parent 636152a commit 95944be
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 21 deletions.
6 changes: 1 addition & 5 deletions base_layer/wallet/src/output_manager_service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2558,11 +2558,7 @@ where
// match found
Some(matched_key) => {
match PrivateKey::from_bytes(
CommsDHKE::new(
&matched_key.private_key,
&output.sender_offset_public_key,
)
.as_bytes(),
CommsDHKE::new(&matched_key.private_key, &output.sender_offset_public_key).as_bytes(),
) {
Ok(spending_sk) => scanned_outputs.push((
output.clone(),
Expand Down
19 changes: 10 additions & 9 deletions base_layer/wallet/src/transaction_service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ use tari_common_types::{
transaction::{ImportStatus, TransactionDirection, TransactionStatus, TxId},
types::{PrivateKey, PublicKey},
};
use tari_comms::{peer_manager::NodeIdentity, types::{CommsDHKE, CommsPublicKey}};
use tari_comms::{
peer_manager::NodeIdentity,
types::{CommsDHKE, CommsPublicKey},
};
use tari_comms_dht::outbound::OutboundMessageRequester;
use tari_core::{
covenants::Covenant,
Expand Down Expand Up @@ -1062,10 +1065,9 @@ where
.get_recipient_sender_offset_private_key(0)
.map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?;

let spend_key = PrivateKey::from_bytes(
CommsDHKE::new(&sender_offset_private_key.clone(), &dest_pubkey.clone()).as_bytes(),
)
.map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?;
let spend_key =
PrivateKey::from_bytes(CommsDHKE::new(&sender_offset_private_key.clone(), &dest_pubkey.clone()).as_bytes())
.map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?;

let sender_message = TransactionSenderMessage::new_single_round_message(stp.get_single_round_message()?);
let rewind_blinding_key = PrivateKey::from_bytes(&hash_secret_key(&spend_key))?;
Expand Down Expand Up @@ -1223,10 +1225,9 @@ where
let sender_offset_private_key = stp
.get_recipient_sender_offset_private_key(0)
.map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?;
let spend_key = PrivateKey::from_bytes(
CommsDHKE::new(&sender_offset_private_key, &dest_pubkey.clone()).as_bytes(),
)
.map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?;
let spend_key =
PrivateKey::from_bytes(CommsDHKE::new(&sender_offset_private_key, &dest_pubkey.clone()).as_bytes())
.map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?;

let sender_message = TransactionSenderMessage::new_single_round_message(stp.get_single_round_message()?);
let rewind_blinding_key = PrivateKey::from_bytes(&hash_secret_key(&spend_key))?;
Expand Down
4 changes: 1 addition & 3 deletions comms/dht/src/crypt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ use tari_comms::{
types::{CommsDHKE, CommsPublicKey},
BufMut,
};
use tari_crypto::{
tari_utilities::{epoch_time::EpochTime, ByteArray},
};
use tari_crypto::tari_utilities::{epoch_time::EpochTime, ByteArray};
use zeroize::Zeroize;

use crate::{
Expand Down
3 changes: 2 additions & 1 deletion comms/dht/src/dht.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ mod test {
pipeline::SinkService,
runtime,
test_utils::mocks::create_connectivity_mock,
wrap_in_envelope_body, types::CommsDHKE,
types::CommsDHKE,
wrap_in_envelope_body,
};
use tari_shutdown::Shutdown;
use tokio::{sync::mpsc, task, time};
Expand Down
2 changes: 1 addition & 1 deletion comms/dht/src/outbound/broadcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use tari_comms::{
message::{MessageExt, MessageTag},
peer_manager::{NodeId, NodeIdentity, Peer},
pipeline::PipelineError,
types::{CommsPublicKey, CommsDHKE},
types::{CommsDHKE, CommsPublicKey},
Bytes,
BytesMut,
};
Expand Down
2 changes: 1 addition & 1 deletion comms/dht/src/store_forward/saf_handler/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use tari_comms::{
message::{EnvelopeBody, MessageTag},
peer_manager::{NodeId, NodeIdentity, Peer, PeerFeatures, PeerManagerError},
pipeline::PipelineError,
types::{CommsPublicKey, CommsDHKE},
types::{CommsDHKE, CommsPublicKey},
BytesMut,
};
use tari_utilities::ByteArray;
Expand Down
2 changes: 1 addition & 1 deletion comms/dht/src/test_utils/makers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use tari_comms::{
multiaddr::Multiaddr,
peer_manager::{NodeId, NodeIdentity, Peer, PeerFeatures, PeerFlags, PeerManager},
transports::MemoryTransport,
types::{CommsDatabase, CommsDHKE, CommsPublicKey, CommsSecretKey},
types::{CommsDHKE, CommsDatabase, CommsPublicKey, CommsSecretKey},
Bytes,
};
use tari_crypto::keys::PublicKey;
Expand Down

0 comments on commit 95944be

Please sign in to comment.