Skip to content

Commit

Permalink
WIP: dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeickert committed Oct 24, 2022
1 parent 1251a4e commit b506a3d
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions base_layer/wallet/src/output_manager_service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ use tari_crypto::{
commitment::HomomorphicCommitmentFactory,
errors::RangeProofError,
keys::{PublicKey as PublicKeyTrait, SecretKey},
ristretto::RistrettoSecretKey,
};
use tari_script::{inputs, script, Opcode, TariScript};
use tari_service_framework::reply_channel;
Expand Down Expand Up @@ -100,7 +99,6 @@ use crate::{
types::WalletHasher,
WalletOutputEncryptionKeysDomainHasher,
WalletOutputRewindKeysDomainHasher,
WalletOutputSpendingKeysDomainHasher,
};

const LOG_TARGET: &str = "wallet::output_manager_service";
Expand Down Expand Up @@ -2324,7 +2322,6 @@ where
fee_per_gram: MicroTari,
) -> Result<(TxId, MicroTari, MicroTari, Transaction), OutputManagerError> {
let shared_secret = CommsDHKE::new(self.node_identity.as_ref().secret_key(), &output.sender_offset_public_key);
let spending_key = shared_secret_to_output_spending_key(&shared_secret)?;
let blinding_key = shared_secret_to_output_rewind_key(&shared_secret)?;
let encryption_key = shared_secret_to_output_encryption_key(&shared_secret)?;
if let Ok(amount) = EncryptedValue::decrypt_value(&encryption_key, &output.commitment, &output.encrypted_value)
Expand Down Expand Up @@ -2749,16 +2746,6 @@ fn shared_secret_to_output_encryption_key(shared_secret: &CommsDHKE) -> Result<P
)
}

/// Generate an output spending key from a Diffie-Hellman shared secret
fn shared_secret_to_output_spending_key(shared_secret: &CommsDHKE) -> Result<PrivateKey, ByteArrayError> {
PrivateKey::from_bytes(
WalletOutputSpendingKeysDomainHasher::new()
.chain(shared_secret.as_bytes())
.finalize()
.as_ref()
)
}

#[derive(Debug, Clone)]
struct UtxoSelection {
utxos: Vec<DbUnblindedOutput>,
Expand Down

0 comments on commit b506a3d

Please sign in to comment.