Fix weight estimation for RctType::ClsagBulletproof TXs

This commit is contained in:
Luke Parker
2024-07-06 20:35:52 -04:00
parent 3cf0b84523
commit 4743ea732c
5 changed files with 12 additions and 5 deletions

View File

@@ -251,6 +251,7 @@ impl SignableTransaction {
Err(SendError::NoInputs)?;
}
for (_, decoys) in &self.inputs {
// TODO: Add a function for the ring length
if decoys.len() !=
match self.rct_type {
RctType::ClsagBulletproof => 11,

View File

@@ -122,7 +122,14 @@ impl SignableTransaction {
key_images.push(ED25519_BASEPOINT_POINT);
clsags.push(Clsag {
D: ED25519_BASEPOINT_POINT,
s: vec![Scalar::ZERO; 16],
s: vec![
Scalar::ZERO;
match self.rct_type {
RctType::ClsagBulletproof => 11,
RctType::ClsagBulletproofPlus => 16,
_ => unreachable!("unsupported RCT type"),
}
],
c1: Scalar::ZERO,
});
pseudo_outs.push(ED25519_BASEPOINT_POINT);

View File

@@ -126,7 +126,7 @@ pub async fn rpc() -> SimpleRequestRpc {
SimpleRequestRpc::new("http://serai:seraidex@127.0.0.1:18081".to_string()).await.unwrap();
// Only run once
if rpc.get_height().await.unwrap() < 100 {
if rpc.get_height().await.unwrap() < 120 {
return rpc;
}
@@ -138,7 +138,7 @@ pub async fn rpc() -> SimpleRequestRpc {
);
// Mine 100 blocks to ensure decoy availability
rpc.generate_blocks(&addr, 100).await.unwrap();
rpc.generate_blocks(&addr, 120).await.unwrap();
rpc
}