mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-02-22 07:39:56 -05:00
Appease clippy
This commit is contained in:
parent
e35e5c7939
commit
1af0116cac
@ -88,11 +88,15 @@ async fn monerod_integration_test() {
|
|||||||
|
|
||||||
let target_address = "498AVruCDWgP9Az9LjMm89VWjrBrSZ2W2K3HFBiyzzrRjUJWUcCVxvY1iitfuKoek2FdX6MKGAD9Qb1G1P8QgR5jPmmt3Vj".parse().unwrap();
|
let target_address = "498AVruCDWgP9Az9LjMm89VWjrBrSZ2W2K3HFBiyzzrRjUJWUcCVxvY1iitfuKoek2FdX6MKGAD9Qb1G1P8QgR5jPmmt3Vj".parse().unwrap();
|
||||||
|
|
||||||
let transaction =
|
let transaction = ConfidentialTransactionBuilder::new(
|
||||||
ConfidentialTransactionBuilder::new(input_to_spend, global_output_index, decoy_inputs, lock_kp)
|
input_to_spend,
|
||||||
.with_output(target_address, spend_amount, &mut rng)
|
global_output_index,
|
||||||
.with_output(target_address, 0, &mut rng) // TODO: Do this inside `build`
|
decoy_inputs,
|
||||||
.build(&mut rng);
|
lock_kp,
|
||||||
|
)
|
||||||
|
.with_output(target_address, spend_amount, &mut rng)
|
||||||
|
.with_output(target_address, 0, &mut rng) // TODO: Do this inside `build`
|
||||||
|
.build(&mut rng);
|
||||||
|
|
||||||
client.send_raw_transaction(transaction).await.unwrap();
|
client.send_raw_transaction(transaction).await.unwrap();
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ use monero::blockdata::transaction::{KeyImage, SubField, TxOutTarget};
|
|||||||
use monero::cryptonote::hash::Hashable;
|
use monero::cryptonote::hash::Hashable;
|
||||||
use monero::cryptonote::onetime_key::KeyGenerator;
|
use monero::cryptonote::onetime_key::KeyGenerator;
|
||||||
use monero::util::key::H;
|
use monero::util::key::H;
|
||||||
use monero::util::ringct::{CtKey, EcdhInfo, Key, RctSigBase, RctSigPrunable, RctType};
|
use monero::util::ringct::{CtKey, EcdhInfo, Key, RctSig, RctSigBase, RctSigPrunable, RctType};
|
||||||
use monero::{
|
use monero::{
|
||||||
Address, KeyPair, OwnedTxOut, PrivateKey, PublicKey, Transaction, TransactionPrefix, TxIn,
|
Address, KeyPair, OwnedTxOut, PrivateKey, PublicKey, Transaction, TransactionPrefix, TxIn,
|
||||||
TxOut, VarInt,
|
TxOut, VarInt,
|
||||||
@ -45,8 +45,10 @@ impl ConfidentialTransactionBuilder {
|
|||||||
decoy_inputs: [DecoyInput; 10],
|
decoy_inputs: [DecoyInput; 10],
|
||||||
keys: KeyPair,
|
keys: KeyPair,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let mut prefix = TransactionPrefix::default();
|
let prefix = TransactionPrefix {
|
||||||
prefix.version = VarInt(2);
|
version: VarInt(2),
|
||||||
|
..TransactionPrefix::default()
|
||||||
|
};
|
||||||
|
|
||||||
let actual_signing_key = input_to_spend.recover_key(&keys).scalar;
|
let actual_signing_key = input_to_spend.recover_key(&keys).scalar;
|
||||||
let signing_pk = actual_signing_key * ED25519_BASEPOINT_POINT;
|
let signing_pk = actual_signing_key * ED25519_BASEPOINT_POINT;
|
||||||
@ -224,10 +226,14 @@ impl ConfidentialTransactionBuilder {
|
|||||||
.collect(); // TODO: Return EdwardsPoints from bulletproof lib
|
.collect(); // TODO: Return EdwardsPoints from bulletproof lib
|
||||||
let pseudo_out = self.compute_pseudo_out(output_commitments); // TODO: either mutate or return
|
let pseudo_out = self.compute_pseudo_out(output_commitments); // TODO: either mutate or return
|
||||||
|
|
||||||
let mut transaction = Transaction::default();
|
let mut transaction = Transaction {
|
||||||
transaction.prefix = self.prefix;
|
prefix: self.prefix,
|
||||||
transaction.rct_signatures.sig = Some(dbg!(self.base));
|
rct_signatures: RctSig {
|
||||||
transaction.rct_signatures.p = Some(self.prunable);
|
sig: Some(self.base),
|
||||||
|
p: Some(self.prunable),
|
||||||
|
},
|
||||||
|
..Transaction::default()
|
||||||
|
};
|
||||||
|
|
||||||
let alpha = Scalar::random(rng);
|
let alpha = Scalar::random(rng);
|
||||||
let fake_responses = random_array(|| Scalar::random(rng));
|
let fake_responses = random_array(|| Scalar::random(rng));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user