mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Put correct key-image into transaction prefix
This commit is contained in:
parent
fd783846cf
commit
370718ab66
@ -152,15 +152,11 @@ async fn monerod_integration_test() {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let k_image = {
|
let signing_key = signing_key
|
||||||
let k = lock_kp.spend.scalar;
|
+ KeyGenerator::from_key(&viewpair, our_output.tx_pubkey)
|
||||||
let K = ViewPair::from(&lock_kp).spend.point;
|
.get_rvn_scalar(our_output.index)
|
||||||
|
.scalar;
|
||||||
let k_image = k * hash_point_to_point(K.decompress().unwrap());
|
let H_p_pk = hash_point_to_point(signing_key * ED25519_BASEPOINT_POINT);
|
||||||
KeyImage {
|
|
||||||
image: monero::cryptonote::hash::Hash(k_image.compress().to_bytes()),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let prefix = TransactionPrefix {
|
let prefix = TransactionPrefix {
|
||||||
version: VarInt(2),
|
version: VarInt(2),
|
||||||
@ -168,7 +164,9 @@ async fn monerod_integration_test() {
|
|||||||
inputs: vec![TxIn::ToKey {
|
inputs: vec![TxIn::ToKey {
|
||||||
amount: VarInt(0),
|
amount: VarInt(0),
|
||||||
key_offsets: relative_key_offsets,
|
key_offsets: relative_key_offsets,
|
||||||
k_image,
|
k_image: KeyImage {
|
||||||
|
image: monero::cryptonote::hash::Hash(H_p_pk.compress().to_bytes()),
|
||||||
|
},
|
||||||
}],
|
}],
|
||||||
outputs: vec![
|
outputs: vec![
|
||||||
TxOut {
|
TxOut {
|
||||||
@ -200,15 +198,6 @@ async fn monerod_integration_test() {
|
|||||||
]),
|
]),
|
||||||
};
|
};
|
||||||
|
|
||||||
// assert_eq!(prefix.hash(),
|
|
||||||
// "c3ded4d1a8cddd4f76c09b63edff4e312e759b3afc46beda4e1fd75c9c68d997".parse().
|
|
||||||
// unwrap());
|
|
||||||
|
|
||||||
let signing_key = signing_key
|
|
||||||
+ KeyGenerator::from_key(&viewpair, our_output.tx_pubkey)
|
|
||||||
.get_rvn_scalar(our_output.index)
|
|
||||||
.scalar;
|
|
||||||
|
|
||||||
let commitment_ring = response
|
let commitment_ring = response
|
||||||
.outs
|
.outs
|
||||||
.iter()
|
.iter()
|
||||||
@ -230,7 +219,6 @@ async fn monerod_integration_test() {
|
|||||||
[our_output.index]
|
[our_output.index]
|
||||||
.open_commitment(&viewpair, &our_output.tx_pubkey, our_output.index);
|
.open_commitment(&viewpair, &our_output.tx_pubkey, our_output.index);
|
||||||
|
|
||||||
let H_p_pk = hash_point_to_point(signing_key * ED25519_BASEPOINT_POINT);
|
|
||||||
let alpha = Scalar::random(&mut rng);
|
let alpha = Scalar::random(&mut rng);
|
||||||
|
|
||||||
let mut responses = random_array(|| Scalar::random(&mut rng));
|
let mut responses = random_array(|| Scalar::random(&mut rng));
|
||||||
|
Loading…
Reference in New Issue
Block a user